diff --git a/Entities/LogFileWatcher.cs b/Entities/LogFileWatcher.cs index 1f764435..9c85f363 100644 --- a/Entities/LogFileWatcher.cs +++ b/Entities/LogFileWatcher.cs @@ -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_") @@ -706,7 +710,7 @@ private bool ParseLine(LogLine line, List 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; @@ -732,7 +736,7 @@ private bool ParseLine(LogLine line, List 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; } diff --git a/Views/Stats.cs b/Views/Stats.cs index 2042598f..f561167a 100644 --- a/Views/Stats.cs +++ b/Views/Stats.cs @@ -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 roundInfoList = (from ri in this.RoundDetails.FindAll() + where !string.IsNullOrEmpty(ri.ShowNameId) && ri.ShowNameId.StartsWith("knockout_") + select ri).ToList(); + + Dictionary sceneToRound = new Dictionary(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() {