Skip to content

Commit

Permalink
Merge pull request #359 from Micdu70/patch-1
Browse files Browse the repository at this point in the history
Bug fix
  • Loading branch information
qutrits authored Jul 16, 2024
2 parents 0335fd5 + 1a56784 commit 073876a
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 9 deletions.
20 changes: 12 additions & 8 deletions Entities/LogFileWatcher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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;
}
Expand Down Expand Up @@ -686,11 +690,11 @@ private void UpdatePersonalBestLog(RoundInfo info) {

private bool ParseLine(LogLine line, List<RoundInfo> 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;
Expand Down Expand Up @@ -763,7 +767,7 @@ private bool ParseLine(LogLine line, List<RoundInfo> 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
};

Expand Down Expand Up @@ -891,7 +895,7 @@ private bool ParseLine(LogLine line, List<RoundInfo> 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();
Expand All @@ -917,7 +921,7 @@ private bool ParseLine(LogLine line, List<RoundInfo> 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++) {
Expand Down
6 changes: 6 additions & 0 deletions Entities/Multilingual.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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" },
Expand Down Expand Up @@ -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" },
Expand Down Expand Up @@ -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", "배구 토너먼트" },
Expand Down Expand Up @@ -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", "バレーフォールトーナメント" },
Expand Down Expand Up @@ -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", "糖豆排球锦标赛" },
Expand Down Expand Up @@ -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", "糖豆排球錦標賽" },
Expand Down
2 changes: 1 addition & 1 deletion Views/LevelDetails.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
24 changes: 24 additions & 0 deletions Views/Stats.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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<RoundInfo> 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() {
Expand Down Expand Up @@ -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":
Expand Down

0 comments on commit 073876a

Please sign in to comment.