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 a744a84 commit d4ce440
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 20 deletions.
38 changes: 20 additions & 18 deletions Entities/LogFileWatcher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -685,9 +685,12 @@ private bool ParseLine(LogLine line, List<RoundInfo> 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 {
Expand All @@ -698,7 +701,12 @@ private bool ParseLine(LogLine line, List<RoundInfo> 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;
Expand All @@ -720,12 +728,11 @@ private bool ParseLine(LogLine line, List<RoundInfo> 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;
}
Expand All @@ -738,7 +745,7 @@ private bool ParseLine(LogLine line, List<RoundInfo> 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 {
Expand All @@ -764,14 +771,7 @@ private bool ParseLine(LogLine line, List<RoundInfo> 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) {
Expand Down Expand Up @@ -1027,7 +1027,9 @@ private bool ParseLine(LogLine line, List<RoundInfo> 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++) {
Expand Down
24 changes: 24 additions & 0 deletions Entities/Multilingual.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13054,6 +13054,7 @@ public static class Multilingual {

private static readonly Dictionary<Language, Dictionary<string, string>> MultilingualShowsDictionary = new Dictionary<Language, Dictionary<string, string>> {
{ Language.English, new Dictionary<string, string>(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" },
Expand Down Expand Up @@ -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" },
Expand Down Expand Up @@ -13949,6 +13953,7 @@ public static class Multilingual {
}
},
{ Language.French, new Dictionary<string, string>(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" },
Expand Down Expand Up @@ -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" },
Expand Down Expand Up @@ -14844,6 +14852,7 @@ public static class Multilingual {
}
},
{ Language.Korean, new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase) {
{ "casual_show", "탐험" },
{ "collectables_ss2_batch_01", "Collectables Batch 01" },
{ "collectables_ss2_batch_01_model1", "Collectables Batch 01" },
{ "collectables_ss2_batch_01_model2", "대기실 쇼 디버그" },
Expand Down Expand Up @@ -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", "망치 클랜" },
Expand Down Expand Up @@ -15739,6 +15751,7 @@ public static class Multilingual {
}
},
{ Language.Japanese, new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase) {
{ "casual_show", "自由探索" },
{ "collectables_ss2_batch_01", "Collectables Batch 01" },
{ "collectables_ss2_batch_01_model1", "Collectables Batch 01" },
{ "collectables_ss2_batch_01_model2", "デバッグロビーショー" },
Expand Down Expand Up @@ -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", "ハンマークラン" },
Expand Down Expand Up @@ -16634,6 +16650,7 @@ public static class Multilingual {
}
},
{ Language.SimplifiedChinese, new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase) {
{ "casual_show", "探索" },
{ "collectables_ss2_batch_01", "Collectables Batch 01" },
{ "collectables_ss2_batch_01_model1", "Collectables Batch 01" },
{ "collectables_ss2_batch_01_model2", "调试用专题" },
Expand Down Expand Up @@ -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", "重锤部落" },
Expand Down Expand Up @@ -17529,6 +17549,7 @@ public static class Multilingual {
}
},
{ Language.TraditionalChinese, new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase) {
{ "casual_show", "探索" },
{ "collectables_ss2_batch_01", "Collectables Batch 01" },
{ "collectables_ss2_batch_01_model1", "Collectables Batch 01" },
{ "collectables_ss2_batch_01_model2", "調試用專題" },
Expand Down Expand Up @@ -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", "重錘部落" },
Expand Down
4 changes: 2 additions & 2 deletions FallGuysStats.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -1149,8 +1149,8 @@
<PackageReference Include="Microsoft.NETCore.Platforms" Version="7.0.4" />
<PackageReference Include="Microsoft.Win32.Primitives" Version="4.3.0" />
<PackageReference Include="NETStandard.Library" Version="2.0.3" />
<PackageReference Include="ScottPlot" Version="4.1.73" />
<PackageReference Include="ScottPlot.WinForms" Version="4.1.73" />
<PackageReference Include="ScottPlot" Version="4.1.74" />
<PackageReference Include="ScottPlot.WinForms" Version="4.1.74" />
<PackageReference Include="SteamKit2" Version="2.5.0" />
<PackageReference Include="System.AppContext" Version="4.3.0" />
<PackageReference Include="System.Buffers" Version="4.5.1" />
Expand Down

0 comments on commit d4ce440

Please sign in to comment.