Skip to content

Commit

Permalink
Bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
qutrits committed May 8, 2024
1 parent f14891f commit 8ba05dc
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 2 deletions.
8 changes: 6 additions & 2 deletions Entities/LogFileWatcher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,10 @@ private void AddLineAfterClientShutdown() {
};

private bool IsRealFinalRound(string roundId, string showId) {
if (string.Equals(showId, "casual_show") && roundId.StartsWith("knockout_fp10_final_")) {
return true;
}

if ((showId.StartsWith("show_wle_s10_") && showId.IndexOf("_srs", StringComparison.OrdinalIgnoreCase) != -1)
|| showId.IndexOf("wle_s10_player_round_", StringComparison.OrdinalIgnoreCase) != -1
|| showId.StartsWith("wle_mrs_shuffle_")
Expand Down Expand Up @@ -706,7 +710,7 @@ private bool ParseLine(LogLine line, List<RoundInfo> round, LogRound logRound) {
&& (index = line.Line.IndexOf("[StateGameLoading] Created UGC round: ", StringComparison.OrdinalIgnoreCase)) != -1) {
this.threadLocalVariable.Value.creativeShareCode = line.Line.Substring(index + 42, 14);
this.threadLocalVariable.Value.useShareCode = true;
} else if ((index = line.Line.IndexOf("[RoundLoader] LoadGameLevelSceneASync COMPLETE for scene", StringComparison.OrdinalIgnoreCase)) != -1) {
} else if ((index = line.Line.IndexOf("[RoundLoader] LoadGameLevelSceneASync COMPLETE for scene ", StringComparison.OrdinalIgnoreCase)) != -1) {
if (line.Date > Stats.LastRoundLoad) {
Stats.LastRoundLoad = line.Date;
Stats.InShow = true;
Expand All @@ -732,7 +736,7 @@ private bool ParseLine(LogLine line, List<RoundInfo> round, LogRound logRound) {
logRound.Info.SceneName = this.threadLocalVariable.Value.creativeGameModeId;
} else {
int index2 = line.Line.IndexOf(" on frame ");
logRound.Info.SceneName = line.Line.Substring(index + 58, index2 - (index + 58));
logRound.Info.SceneName = line.Line.Substring(index + 57, index2 - (index + 57));
if (this._sceneNameReplacer.TryGetValue(logRound.Info.SceneName, out string newName)) {
logRound.Info.SceneName = newName;
}
Expand Down
39 changes: 39 additions & 0 deletions Views/Stats.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3054,6 +3054,45 @@ where string.Equals(ri.ShowNameId, "event_april_fools") && ri.IsFinal == false
this.CurrentSettings.Version = 90;
this.SaveUserSettings();
}

if (this.CurrentSettings.Version == 90) {
List<RoundInfo> roundInfoList = (from ri in this.RoundDetails.FindAll()
where !string.IsNullOrEmpty(ri.ShowNameId) && ri.ShowNameId.StartsWith("knockout_")
select ri).ToList();

Dictionary<string, string> sceneToRound = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase) {
{ "knockout_fp10_filler_9", "round_airtime" },
{ "knockout_fp10_opener_3", "round_fruitpunch_s4_show" },
{ "knockout_fp10_opener_4", "round_blastball_arenasurvival_symphony_launch_show" },
{ "knockout_fp10_opener_9", "round_see_saw_360" },
{ "knockout_fp10_filler_8", "round_hoops" },
{ "knockout_fp10_filler_15", "round_hoverboardsurvival_s4_show" },
{ "knockout_fp10_filler_3", "round_jump_club" },
{ "knockout_fp10_filler_7", "round_kraken_attack" },
{ "knockout_fp10_opener_8", "round_follow-the-leader_s6_launch" },
{ "knockout_fp10_opener_2", "round_snowballsurvival" },
{ "knockout_fp10_opener_7", "round_tail_tag" },
{ "knockout_fp10_filler_4", "round_spin_ring_symphony_launch_show" },
{ "knockout_fp10_opener_17", "round_gauntlet_03" },
{ "knockout_fp10_filler_6", "round_1v1_volleyfall_symphony_launch_show" },
{ "knockout_fp10_final_3", "round_fall_mountain_hub_complete" },
{ "knockout_fp10_final_1", "round_crown_maze" },
{ "knockout_fp10_final_2", "round_tunnel_final" },
};

foreach (RoundInfo ri in roundInfoList) {
if (sceneToRound.TryGetValue(ri.Name, out string levelId)) {
Console.WriteLine(levelId);
ri.Name = levelId;
ri.IsFinal = string.Equals(levelId, "round_crown_maze") || string.Equals(levelId, "round_tunnel_final") || string.Equals(levelId, "round_fall_mountain_hub_complete");
}
}
this.StatsDB.BeginTrans();
this.RoundDetails.Update(roundInfoList);
this.StatsDB.Commit();
this.CurrentSettings.Version = 91;
this.SaveUserSettings();
}
}

private UserSettings GetDefaultSettings() {
Expand Down

0 comments on commit 8ba05dc

Please sign in to comment.