From 1a567846efdfb287277622963ec4a40f172ec404 Mon Sep 17 00:00:00 2001 From: Micdu70 Date: Mon, 15 Jul 2024 19:21:55 +0200 Subject: [PATCH] Bug fix --- Entities/LogFileWatcher.cs | 20 ++++++++++++-------- Entities/Multilingual.cs | 6 ++++++ Views/LevelDetails.cs | 2 +- Views/Stats.cs | 24 ++++++++++++++++++++++++ 4 files changed, 43 insertions(+), 9 deletions(-) diff --git a/Entities/LogFileWatcher.cs b/Entities/LogFileWatcher.cs index ca39c12e..54f66ed2 100644 --- a/Entities/LogFileWatcher.cs +++ b/Entities/LogFileWatcher.cs @@ -247,7 +247,7 @@ private void ReadLogFile() { || line.Line.IndexOf("[GameStateMachine] Replacing FGClient.StateDisconnectingFromServer with FGClient.StateMainMenu", StringComparison.OrdinalIgnoreCase) != -1 || line.Line.IndexOf("[StateMainMenu] Loading scene MainMenu", StringComparison.OrdinalIgnoreCase) != -1 || line.Line.IndexOf("[EOSPartyPlatformService.Base] Reset, reason: Shutdown", StringComparison.OrdinalIgnoreCase) != -1 - || (string.Equals(this.threadLocalVariable.Value.selectedShowId, "casual_show") && (line.Line.IndexOf("[GameplaySpectatorUltimatePartyFlowViewModel] Begin countdown", StringComparison.OrdinalIgnoreCase) != -1 + || (this.IsShowIsCasualShow(this.threadLocalVariable.Value.selectedShowId) && (line.Line.IndexOf("[GameplaySpectatorUltimatePartyFlowViewModel] Begin countdown", StringComparison.OrdinalIgnoreCase) != -1 || line.Line.IndexOf("[GlobalGameStateClient] Received instruction that server is ending a round", StringComparison.OrdinalIgnoreCase) != -1))) { if (line.Line.IndexOf("[StateMainMenu] Loading scene MainMenu", StringComparison.OrdinalIgnoreCase) != -1 || line.Line.IndexOf("[EOSPartyPlatformService.Base] Reset, reason: Shutdown", StringComparison.OrdinalIgnoreCase) != -1) { @@ -337,6 +337,10 @@ private void AddLineAfterClientShutdown() { { "FallGuy_BlueJay_UNPACKED", "FallGuy_BlueJay" } }; + private bool IsShowIsCasualShow(string showId) { + return string.Equals(showId, "casual_show") || string.Equals(showId, "no_elimination_explore"); + } + private bool IsRealFinalRound(string roundId, string showId) { if ((showId.StartsWith("knockout_fp") && showId.EndsWith("_srs")) || (showId.StartsWith("show_wle_s10_") && showId.IndexOf("_srs", StringComparison.OrdinalIgnoreCase) != -1) @@ -641,7 +645,7 @@ private void UpdateServerConnectionLog(string session, string show) { private void UpdatePersonalBestLog(RoundInfo info) { if (info.PrivateLobby || (!info.IsCasualShow && info.UseShareCode) || !info.Finish.HasValue) { return; } - if (info.IsCasualShow) { + if (info.IsCasualShow && !string.Equals(info.ShowNameId, "no_elimination_explore")) { if (string.IsNullOrEmpty(info.Name) || !string.Equals(info.ShowNameId, "user_creative_race_round")) { return; } @@ -686,11 +690,11 @@ private void UpdatePersonalBestLog(RoundInfo info) { private bool ParseLine(LogLine line, List round, LogRound logRound) { int index; - if ((string.Equals(this.threadLocalVariable.Value.selectedShowId, "casual_show") && line.Line.IndexOf("[MatchmakeWhileInGameHandler] Cancel matchmaking, reason: Cancel", StringComparison.OrdinalIgnoreCase) != -1) - || (string.Equals(this.threadLocalVariable.Value.selectedShowId, "casual_show") && line.Line.IndexOf("[GameplaySpectatorUltimatePartyFlowViewModel] Stop previous countdown", StringComparison.OrdinalIgnoreCase) != -1)) { + if (this.IsShowIsCasualShow(this.threadLocalVariable.Value.selectedShowId) && (line.Line.IndexOf("[MatchmakeWhileInGameHandler] Cancel matchmaking, reason: Cancel", StringComparison.OrdinalIgnoreCase) != -1 + || line.Line.IndexOf("[GameplaySpectatorUltimatePartyFlowViewModel] Stop previous countdown", StringComparison.OrdinalIgnoreCase) != -1)) { Stats.InShow = false; this.ResetVariablesUsedForOverlay(); - } else if ((!string.Equals(this.threadLocalVariable.Value.selectedShowId, "casual_show") && line.Line.IndexOf("[StateDisconnectingFromServer] Shutting down game and resetting scene to reconnect", StringComparison.OrdinalIgnoreCase) != -1) + } else if ((!this.IsShowIsCasualShow(this.threadLocalVariable.Value.selectedShowId) && line.Line.IndexOf("[StateDisconnectingFromServer] Shutting down game and resetting scene to reconnect", StringComparison.OrdinalIgnoreCase) != -1) || line.Line.IndexOf("[GameStateMachine] Replacing FGClient.StateDisconnectingFromServer with FGClient.StateMainMenu", StringComparison.OrdinalIgnoreCase) != -1) { this.StatsForm.UpdateServerConnectionLog(this.threadLocalVariable.Value.currentSessionId, false); Stats.InShow = false; @@ -763,7 +767,7 @@ private bool ParseLine(LogLine line, List round, LogRound logRound) { logRound.Info = new RoundInfo { ShowNameId = this.threadLocalVariable.Value.selectedShowId, SessionId = this.threadLocalVariable.Value.currentSessionId, - UseShareCode = this.threadLocalVariable.Value.useShareCode, IsCasualShow = string.Equals(this.threadLocalVariable.Value.selectedShowId, "casual_show"), + UseShareCode = this.threadLocalVariable.Value.useShareCode, IsCasualShow = this.IsShowIsCasualShow(this.threadLocalVariable.Value.selectedShowId), OnlineServiceType = (int)Stats.OnlineServiceType, OnlineServiceId = Stats.OnlineServiceId, OnlineServiceNickname = Stats.OnlineServiceNickname }; @@ -891,7 +895,7 @@ private bool ParseLine(LogLine line, List round, LogRound logRound) { || line.Line.IndexOf("[GameStateMachine] Replacing FGClient.StateReloadingToMainMenu with FGClient.StateMainMenu", StringComparison.OrdinalIgnoreCase) != -1 || line.Line.IndexOf("[StateMainMenu] Loading scene MainMenu", StringComparison.OrdinalIgnoreCase) != -1 || line.Line.IndexOf("[EOSPartyPlatformService.Base] Reset, reason: Shutdown", StringComparison.OrdinalIgnoreCase) != -1 - || (string.Equals(this.threadLocalVariable.Value.selectedShowId, "casual_show") && (line.Line.IndexOf("[GameplaySpectatorUltimatePartyFlowViewModel] Begin countdown", StringComparison.OrdinalIgnoreCase) != -1 + || (this.IsShowIsCasualShow(this.threadLocalVariable.Value.selectedShowId) && (line.Line.IndexOf("[GameplaySpectatorUltimatePartyFlowViewModel] Begin countdown", StringComparison.OrdinalIgnoreCase) != -1 || line.Line.IndexOf("[GlobalGameStateClient] Received instruction that server is ending a round", StringComparison.OrdinalIgnoreCase) != -1)) || Stats.IsClientHasBeenClosed) { this.ResetVariablesUsedForOverlay(); @@ -917,7 +921,7 @@ private bool ParseLine(LogLine line, List round, LogRound logRound) { logRound.Info.End = line.Date; } logRound.Info.Playing = false; - if (string.Equals(this.threadLocalVariable.Value.selectedShowId, "casual_show")) { + if (this.IsShowIsCasualShow(this.threadLocalVariable.Value.selectedShowId)) { if (!Stats.EndedShow) { DateTime showEnd = logRound.Info.End; for (int i = 0; i < round.Count; i++) { diff --git a/Entities/Multilingual.cs b/Entities/Multilingual.cs index 4c5907b7..d1311dd5 100644 --- a/Entities/Multilingual.cs +++ b/Entities/Multilingual.cs @@ -13347,6 +13347,7 @@ public static class Multilingual { { "main_show_template_base", "Main Show" }, { "main_show_template_large", "Main Show" }, { "main_show_template_medium", "Main Show" }, + { "no_elimination_explore", "Explore - Classic" }, { "no_elimination_show", "SOLOS CHILL" }, { "only_1v1_volleyfall", "Volleyfall Tournament" }, { "only_1v1_volleyfall_191022_211022", "Volleyfall Tournament" }, @@ -14249,6 +14250,7 @@ public static class Multilingual { { "main_show_template_base", "Émission principale" }, { "main_show_template_large", "Émission principale" }, { "main_show_template_medium", "Émission principale" }, + { "no_elimination_explore", "Exploration - Classique" }, { "no_elimination_show", "SOLO SIMPLE" }, { "only_1v1_volleyfall", "Tournoi de volleyfall" }, { "only_1v1_volleyfall_191022_211022", "Tournoi de volleyfall" }, @@ -15151,6 +15153,7 @@ public static class Multilingual { { "main_show_template_base", "메인 쇼" }, { "main_show_template_large", "메인 쇼" }, { "main_show_template_medium", "메인 쇼" }, + { "no_elimination_explore", "탐험 - 클래식" }, { "no_elimination_show", "솔로 느긋함" }, { "only_1v1_volleyfall", "배구 토너먼트" }, { "only_1v1_volleyfall_191022_211022", "배구 토너먼트" }, @@ -16053,6 +16056,7 @@ public static class Multilingual { { "main_show_template_base", "メインショー" }, { "main_show_template_large", "メインショー" }, { "main_show_template_medium", "メインショー" }, + { "no_elimination_explore", "自由探索 - クラシック" }, { "no_elimination_show", "ソロゆったり" }, { "only_1v1_volleyfall", "バレーフォールトーナメント" }, { "only_1v1_volleyfall_191022_211022", "バレーフォールトーナメント" }, @@ -16955,6 +16959,7 @@ public static class Multilingual { { "main_show_template_base", "主要专题" }, { "main_show_template_large", "主要专题" }, { "main_show_template_medium", "主要专题" }, + { "no_elimination_explore", "探索 - 经典" }, { "no_elimination_show", "单人轻松" }, { "only_1v1_volleyfall", "糖豆排球锦标赛" }, { "only_1v1_volleyfall_191022_211022", "糖豆排球锦标赛" }, @@ -17857,6 +17862,7 @@ public static class Multilingual { { "main_show_template_base", "主要專題" }, { "main_show_template_large", "主要專題" }, { "main_show_template_medium", "主要專題" }, + { "no_elimination_explore", "探索 - 經典" }, { "no_elimination_show", "單人簡易" }, { "only_1v1_volleyfall", "糖豆排球錦標賽" }, { "only_1v1_volleyfall_191022_211022", "糖豆排球錦標賽" }, diff --git a/Views/LevelDetails.cs b/Views/LevelDetails.cs index bd5f293b..6c409f27 100644 --- a/Views/LevelDetails.cs +++ b/Views/LevelDetails.cs @@ -665,7 +665,7 @@ private void gridDetails_CellFormatting(object sender, DataGridViewCellFormattin if (info.PrivateLobby) { // Custom e.CellStyle.BackColor = this.Theme == MetroThemeStyle.Light ? Color.LightGray : Color.FromArgb(8, 8, 8); e.CellStyle.ForeColor = this.Theme == MetroThemeStyle.Light ? Color.Black : Color.DarkGray; - } else if (info.IsCasualShow) { // "Explore" Show + } else if (info.IsCasualShow) { // "Explore" Shows e.CellStyle.BackColor = this.Theme == MetroThemeStyle.Light ? Color.LightBlue : Color.FromArgb(8, 8, 40); e.CellStyle.ForeColor = this.Theme == MetroThemeStyle.Light ? Color.MidnightBlue : Color.SkyBlue; } diff --git a/Views/Stats.cs b/Views/Stats.cs index 40a4e296..1aa3f6b1 100644 --- a/Views/Stats.cs +++ b/Views/Stats.cs @@ -3176,6 +3176,29 @@ where string.Equals(ri.ShowNameId, "event_april_fools") && ri.IsFinal == false this.CurrentSettings.Version = 98; this.SaveUserSettings(); } + + if (this.CurrentSettings.Version == 98) { + List roundInfoList = (from ri in this.RoundDetails.FindAll() + where !string.IsNullOrEmpty(ri.ShowNameId) && string.Equals(ri.ShowNameId, "no_elimination_explore") + select ri).ToList(); + + foreach (RoundInfo ri in roundInfoList) { + Profiles profile = this.Profiles.FindOne(Query.EQ("LinkedShowId", "main_show")); + int profileId = profile?.ProfileId ?? -1; + if (profileId != -1) ri.Profile = profileId; + ri.IsCasualShow = true; + ri.Round = 1; + ri.Qualified = ri.Finish.HasValue; + ri.IsFinal = false; + ri.Crown = false; + ri.IsAbandon = false; + } + this.StatsDB.BeginTrans(); + this.RoundDetails.Update(roundInfoList); + this.StatsDB.Commit(); + this.CurrentSettings.Version = 99; + this.SaveUserSettings(); + } } private UserSettings GetDefaultSettings() { @@ -4589,6 +4612,7 @@ public string GetAlternateShowId(string showId) { case "turbo_2_show": case "knockout_mode": case "classic_solo_main_show": + case "no_elimination_explore": return "main_show"; case "knockout_duos": case "classic_duos_show":