From d4ce440978a604be0fe549af5cc44bd2dfccfd11 Mon Sep 17 00:00:00 2001 From: eunma Date: Wed, 8 May 2024 12:39:02 +0900 Subject: [PATCH] Bug fix --- Entities/LogFileWatcher.cs | 38 ++++++++++++++++++++------------------ Entities/Multilingual.cs | 24 ++++++++++++++++++++++++ FallGuysStats.csproj | 4 ++-- 3 files changed, 46 insertions(+), 20 deletions(-) diff --git a/Entities/LogFileWatcher.cs b/Entities/LogFileWatcher.cs index 4bda9e98a..ab2056efb 100644 --- a/Entities/LogFileWatcher.cs +++ b/Entities/LogFileWatcher.cs @@ -685,9 +685,12 @@ private bool ParseLine(LogLine line, List round, LogRound logRound) { int ipIndex = line.Line.IndexOf("IP:", StringComparison.OrdinalIgnoreCase); Stats.LastServerIp = line.Line.Substring(ipIndex + 3); } - } else if ((index = line.Line.IndexOf("[HandleSuccessfulLogin] Selected show is", StringComparison.OrdinalIgnoreCase)) != -1) { - this.threadLocalVariable.Value.selectedShowId = line.Line.Substring(line.Line.Length - (line.Line.Length - index - 41)); - if (this.threadLocalVariable.Value.selectedShowId.StartsWith("ugc-")) { + } else if ((index = line.Line.IndexOf("[HandleSuccessfulLogin] Selected show is ", StringComparison.OrdinalIgnoreCase)) != -1) { + int index2 = line.Line.IndexOf(" IsUltimatePartyEpisode:"); + this.threadLocalVariable.Value.selectedShowId = line.Line.Substring(index + 41, index2 - (index + 41)); + if (string.Equals(this.threadLocalVariable.Value.selectedShowId, "casual_show")) { + this.threadLocalVariable.Value.useShareCode = true; + } else if (this.threadLocalVariable.Value.selectedShowId.StartsWith("ugc-")) { this.threadLocalVariable.Value.selectedShowId = this.threadLocalVariable.Value.selectedShowId.Substring(4); this.threadLocalVariable.Value.useShareCode = true; } else { @@ -698,7 +701,12 @@ private bool ParseLine(LogLine line, List round, LogRound logRound) { if ((DateTime.UtcNow - Stats.ConnectedToServerDate).TotalMinutes <= 40) { this.UpdateServerConnectionLog(this.threadLocalVariable.Value.sessionId, this.threadLocalVariable.Value.selectedShowId); } - } else if ((index = line.Line.IndexOf("[StateGameLoading] Loading game level scene", StringComparison.OrdinalIgnoreCase)) != -1) { + } else if ((index = line.Line.IndexOf("[StateGameLoading] Created UGC round: ", StringComparison.OrdinalIgnoreCase)) != -1) { + if (string.Equals(this.threadLocalVariable.Value.selectedShowId, "casual_show")) { + this.threadLocalVariable.Value.creativeShareCode = line.Line.Substring(index + 38 + 4, 14); + this.threadLocalVariable.Value.useShareCode = true; + } + } 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; @@ -720,12 +728,11 @@ private bool ParseLine(LogLine line, List round, LogRound logRound) { }; if (logRound.Info.UseShareCode) { - this.SetCreativeLevelVariable(logRound.Info.ShowNameId); + this.SetCreativeLevelVariable(string.Equals(logRound.Info.ShowNameId, "casual_show") ? this.threadLocalVariable.Value.creativeShareCode : logRound.Info.ShowNameId); logRound.Info.SceneName = this.threadLocalVariable.Value.creativeGameModeId; } else { - int index2 = line.Line.IndexOf(" ", index + 44); - if (index2 < 0) { index2 = line.Line.Length; } - logRound.Info.SceneName = line.Line.Substring(index + 44, index2 - index - 44); + int index2 = line.Line.IndexOf(" on frame "); + logRound.Info.SceneName = line.Line.Substring(index + 58, index2 - (index + 58)); if (this._sceneNameReplacer.TryGetValue(logRound.Info.SceneName, out string newName)) { logRound.Info.SceneName = newName; } @@ -738,7 +745,7 @@ private bool ParseLine(LogLine line, List round, LogRound logRound) { if (index2 < 0) { index2 = line.Line.Length; } if (logRound.Info.UseShareCode) { - logRound.Info.Name = logRound.Info.ShowNameId; + logRound.Info.Name = string.Equals(logRound.Info.ShowNameId, "casual_show") ? this.threadLocalVariable.Value.creativeShareCode : logRound.Info.ShowNameId; logRound.Info.ShowNameId = this.StatsForm.GetUserCreativeLevelTypeId(this.threadLocalVariable.Value.creativeGameModeId); this.SetCreativeLevelInfo(logRound.Info); } else { @@ -764,14 +771,7 @@ private bool ParseLine(LogLine line, List round, LogRound logRound) { logRound.CountingPlayers = true; logRound.GetCurrentPlayerID = true; - // } else if (logRound.Info != null && (index = line.Line.IndexOf("NetworkGameOptions: durationInSeconds=", StringComparison.OrdinalIgnoreCase)) != -1) { // legacy code // It seems to have been deleted from the log file now. - // int nextIndex = line.Line.IndexOf(" ", index + 38); - // logRound.Duration = int.Parse(line.Line.Substring(index + 38, nextIndex - index - 38)); - // index = line.Line.IndexOf("isFinalRound=", StringComparison.OrdinalIgnoreCase); - // logRound.HasIsFinal = index > 0; - // index = line.Line.IndexOf("isFinalRound=True", StringComparison.OrdinalIgnoreCase); - // logRound.IsFinal = index > 0; - } else if (logRound.Info != null && logRound.CountingPlayers && line.Line.IndexOf("[ClientGameManager] Finalising spawn", StringComparison.OrdinalIgnoreCase) != -1 || line.Line.IndexOf("[ClientGameManager] Added player ", StringComparison.OrdinalIgnoreCase) != -1) { + } else if (logRound.Info != null && logRound.CountingPlayers && (line.Line.IndexOf("[ClientGameManager] Finalising spawn", StringComparison.OrdinalIgnoreCase) != -1 || line.Line.IndexOf("[ClientGameManager] Added player ", StringComparison.OrdinalIgnoreCase) != -1)) { logRound.Info.Players++; } else if (logRound.Info != null && logRound.CountingPlayers && line.Line.IndexOf("[CameraDirector] Adding Spectator target", StringComparison.OrdinalIgnoreCase) != -1) { if (line.Line.IndexOf("ps4", StringComparison.OrdinalIgnoreCase) != -1) { @@ -1027,7 +1027,9 @@ private bool ParseLine(LogLine line, List round, LogRound logRound) { return false; } - roundInfo.Kudos += questKudos; + if (roundInfo != null) { + roundInfo.Kudos += questKudos; + } DateTime showEnd = logRound.Info.End; for (int i = 0; i < round.Count; i++) { diff --git a/Entities/Multilingual.cs b/Entities/Multilingual.cs index ca435a3ba..1250c100f 100644 --- a/Entities/Multilingual.cs +++ b/Entities/Multilingual.cs @@ -13054,6 +13054,7 @@ public static class Multilingual { private static readonly Dictionary> MultilingualShowsDictionary = new Dictionary> { { Language.English, new Dictionary(StringComparer.OrdinalIgnoreCase) { + { "casual_show", "Explore" }, { "collectables_ss2_batch_01", "Collectables Batch 01" }, { "collectables_ss2_batch_01_model1", "Collectables Batch 01" }, { "collectables_ss2_batch_01_model2", "Debug Lobbies Show" }, @@ -13301,6 +13302,9 @@ public static class Multilingual { { "invisibeans_2808_to_3008_2022", "SWEET THIEVES" }, { "invisibeans_pistachio_template", "Treat Thieves" }, { "invisibeans_template", "SWEET THIEVES" }, + { "knockout_duos", "Duos" }, + { "knockout_mode", "Knockout" }, + { "knockout_squads", "Squads" }, { "live_event_bluejay", "Gotta Go Fast!" }, { "live_event_clan_of_yeetus_0411_0611_2022", "Clan of Yeetus" }, { "live_event_clan_of_yeetus_ss1_template", "Clan of Yeetus" }, @@ -13949,6 +13953,7 @@ public static class Multilingual { } }, { Language.French, new Dictionary(StringComparer.OrdinalIgnoreCase) { + { "casual_show", "Exploration" }, { "collectables_ss2_batch_01", "Collectables Batch 01" }, { "collectables_ss2_batch_01_model1", "Collectables Batch 01" }, { "collectables_ss2_batch_01_model2", "Émission dans lobbies de debug" }, @@ -14196,6 +14201,9 @@ public static class Multilingual { { "invisibeans_2808_to_3008_2022", "VOLEURS SUCRÉS" }, { "invisibeans_pistachio_template", "Voleurs de bonbons" }, { "invisibeans_template", "VOLEURS SUCRÉS" }, + { "knockout_duos", "Duos" }, + { "knockout_mode", "Tournois" }, + { "knockout_squads", "Groupes" }, { "live_event_bluejay", "Gotta Go Fast !" }, { "live_event_clan_of_yeetus_0411_0611_2022", "Clan Yeetus" }, { "live_event_clan_of_yeetus_ss1_template", "Clan Yeetus" }, @@ -14844,6 +14852,7 @@ public static class Multilingual { } }, { Language.Korean, new Dictionary(StringComparer.OrdinalIgnoreCase) { + { "casual_show", "탐험" }, { "collectables_ss2_batch_01", "Collectables Batch 01" }, { "collectables_ss2_batch_01_model1", "Collectables Batch 01" }, { "collectables_ss2_batch_01_model2", "대기실 쇼 디버그" }, @@ -15091,6 +15100,9 @@ public static class Multilingual { { "invisibeans_2808_to_3008_2022", "달콤한 도둑들" }, { "invisibeans_pistachio_template", "사탕 도둑들" }, { "invisibeans_template", "달콤한 도둑들" }, + { "knockout_duos", "듀오" }, + { "knockout_mode", "넉아웃" }, + { "knockout_squads", "스쿼드" }, { "live_event_bluejay", "어서어서 빨리빨리!" }, { "live_event_clan_of_yeetus_0411_0611_2022", "망치 클랜" }, { "live_event_clan_of_yeetus_ss1_template", "망치 클랜" }, @@ -15739,6 +15751,7 @@ public static class Multilingual { } }, { Language.Japanese, new Dictionary(StringComparer.OrdinalIgnoreCase) { + { "casual_show", "自由探索" }, { "collectables_ss2_batch_01", "Collectables Batch 01" }, { "collectables_ss2_batch_01_model1", "Collectables Batch 01" }, { "collectables_ss2_batch_01_model2", "デバッグロビーショー" }, @@ -15986,6 +15999,9 @@ public static class Multilingual { { "invisibeans_2808_to_3008_2022", "キャンディードロボー" }, { "invisibeans_pistachio_template", "お菓子ドロボー" }, { "invisibeans_template", "キャンディードロボー" }, + { "knockout_duos", "デュオ" }, + { "knockout_mode", "ノックアウト" }, + { "knockout_squads", "スクワッド" }, { "live_event_bluejay", "スピードが勝負!" }, { "live_event_clan_of_yeetus_0411_0611_2022", "ハンマークラン" }, { "live_event_clan_of_yeetus_ss1_template", "ハンマークラン" }, @@ -16634,6 +16650,7 @@ public static class Multilingual { } }, { Language.SimplifiedChinese, new Dictionary(StringComparer.OrdinalIgnoreCase) { + { "casual_show", "探索" }, { "collectables_ss2_batch_01", "Collectables Batch 01" }, { "collectables_ss2_batch_01_model1", "Collectables Batch 01" }, { "collectables_ss2_batch_01_model2", "调试用专题" }, @@ -16881,6 +16898,9 @@ public static class Multilingual { { "invisibeans_2808_to_3008_2022", "糖果窃贼" }, { "invisibeans_pistachio_template", "万圣来盗" }, { "invisibeans_template", "糖果窃贼" }, + { "knockout_duos", "双人" }, + { "knockout_mode", "淘汰赛" }, + { "knockout_squads", "小队" }, { "live_event_bluejay", "速度要快!" }, { "live_event_clan_of_yeetus_0411_0611_2022", "重锤部落" }, { "live_event_clan_of_yeetus_ss1_template", "重锤部落" }, @@ -17529,6 +17549,7 @@ public static class Multilingual { } }, { Language.TraditionalChinese, new Dictionary(StringComparer.OrdinalIgnoreCase) { + { "casual_show", "探索" }, { "collectables_ss2_batch_01", "Collectables Batch 01" }, { "collectables_ss2_batch_01_model1", "Collectables Batch 01" }, { "collectables_ss2_batch_01_model2", "調試用專題" }, @@ -17776,6 +17797,9 @@ public static class Multilingual { { "invisibeans_2808_to_3008_2022", "糖果竊賊" }, { "invisibeans_pistachio_template", "萬聖來盜" }, { "invisibeans_template", "糖果竊賊" }, + { "knockout_duos", "雙人" }, + { "knockout_mode", "淘汰賽" }, + { "knockout_squads", "小隊" }, { "live_event_bluejay", "速度要快!" }, { "live_event_clan_of_yeetus_0411_0611_2022", "重錘部落" }, { "live_event_clan_of_yeetus_ss1_template", "重錘部落" }, diff --git a/FallGuysStats.csproj b/FallGuysStats.csproj index 12d96652f..558d57711 100644 --- a/FallGuysStats.csproj +++ b/FallGuysStats.csproj @@ -1149,8 +1149,8 @@ - - + +