Skip to content

Commit

Permalink
Bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
qutrits committed Jun 27, 2023
1 parent 7409bb1 commit d819890
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 14 deletions.
20 changes: 10 additions & 10 deletions Entities/LevelStats.cs
Original file line number Diff line number Diff line change
Expand Up @@ -240,16 +240,16 @@ public class LevelStats {
{ "wle_s10_player_round_wk5_17", new LevelStats("Big Bookcase", LevelType.Race, true, false, 10, Properties.Resources.round_gauntlet_icon, Properties.Resources.round_gauntlet_big_icon) },
{ "wle_s10_player_round_wk5_18", new LevelStats("Digital Doom", LevelType.Race, true, false, 10, Properties.Resources.round_gauntlet_icon, Properties.Resources.round_gauntlet_big_icon) },

{ "wle_mrs_bagel_opener_1", new LevelStats("Tunnel of Love", LevelType.Race, true, false, 10, Properties.Resources.round_gauntlet_icon, Properties.Resources.round_gauntlet_big_icon) },
{ "wle_mrs_bagel_opener_2", new LevelStats("Pink Parade", LevelType.Race, true, false, 10, Properties.Resources.round_gauntlet_icon, Properties.Resources.round_gauntlet_big_icon) },
{ "wle_mrs_bagel_opener_3", new LevelStats("Prideful Path", LevelType.Race, true, false, 10, Properties.Resources.round_gauntlet_icon, Properties.Resources.round_gauntlet_big_icon) },
{ "wle_mrs_bagel_opener_4", new LevelStats("Coming Together", LevelType.Race, true, false, 10, Properties.Resources.round_gauntlet_icon, Properties.Resources.round_gauntlet_big_icon) },
{ "wle_mrs_bagel_filler_1", new LevelStats("Clifftop Capers", LevelType.Race, true, false, 10, Properties.Resources.round_gauntlet_icon, Properties.Resources.round_gauntlet_big_icon) },
{ "wle_mrs_bagel_filler_2", new LevelStats("Waveway Splits", LevelType.Race, true, false, 10, Properties.Resources.round_gauntlet_icon, Properties.Resources.round_gauntlet_big_icon) },
{ "wle_mrs_bagel_filler_3", new LevelStats("In the Groove", LevelType.Race, true, false, 10, Properties.Resources.round_gauntlet_icon, Properties.Resources.round_gauntlet_big_icon) },
{ "wle_mrs_bagel_filler_4", new LevelStats("Heartfall Heat", LevelType.Race, true, false, 10, Properties.Resources.round_gauntlet_icon, Properties.Resources.round_gauntlet_big_icon) },
{ "wle_mrs_bagel_final_1", new LevelStats("Rainbow Rise", LevelType.Race, true, true, 10, Properties.Resources.round_gauntlet_icon, Properties.Resources.round_gauntlet_big_icon) },
{ "wle_mrs_bagel_final_2", new LevelStats("Out and About", LevelType.Race, true, true, 10, Properties.Resources.round_gauntlet_icon, Properties.Resources.round_gauntlet_big_icon) },
{ "wle_mrs_bagel_opener_1", new LevelStats("Tunnel of Love", LevelType.Race, true, false, 10, Properties.Resources.round_gauntlet_icon, Properties.Resources.round_gauntlet_big_icon) },
{ "wle_mrs_bagel_opener_2", new LevelStats("Pink Parade", LevelType.Race, true, false, 10, Properties.Resources.round_gauntlet_icon, Properties.Resources.round_gauntlet_big_icon) },
{ "wle_mrs_bagel_opener_3", new LevelStats("Prideful Path", LevelType.Race, true, false, 10, Properties.Resources.round_gauntlet_icon, Properties.Resources.round_gauntlet_big_icon) },
{ "wle_mrs_bagel_opener_4", new LevelStats("Coming Together", LevelType.Race, true, false, 10, Properties.Resources.round_gauntlet_icon, Properties.Resources.round_gauntlet_big_icon) },
{ "wle_mrs_bagel_filler_1", new LevelStats("Clifftop Capers", LevelType.Race, true, false, 10, Properties.Resources.round_gauntlet_icon, Properties.Resources.round_gauntlet_big_icon) },
{ "wle_mrs_bagel_filler_2", new LevelStats("Waveway Splits", LevelType.Race, true, false, 10, Properties.Resources.round_gauntlet_icon, Properties.Resources.round_gauntlet_big_icon) },
{ "wle_mrs_bagel_filler_3", new LevelStats("In the Groove", LevelType.Race, true, false, 10, Properties.Resources.round_gauntlet_icon, Properties.Resources.round_gauntlet_big_icon) },
{ "wle_mrs_bagel_filler_4", new LevelStats("Heartfall Heat", LevelType.Race, true, false, 10, Properties.Resources.round_gauntlet_icon, Properties.Resources.round_gauntlet_big_icon) },
{ "wle_mrs_bagel_final_1", new LevelStats("Rainbow Rise", LevelType.Race, true, true, 10, Properties.Resources.round_gauntlet_icon, Properties.Resources.round_gauntlet_big_icon) },
{ "wle_mrs_bagel_final_2", new LevelStats("Out and About", LevelType.Race, true, true, 10, Properties.Resources.round_gauntlet_icon, Properties.Resources.round_gauntlet_big_icon) },

{ "wle_s10_orig_round_010", new LevelStats("Square Up", LevelType.Race, true, true, 10, Properties.Resources.round_gauntlet_icon, Properties.Resources.round_gauntlet_big_icon) },
{ "wle_s10_orig_round_011", new LevelStats("Slide Showdown", LevelType.Race, true, true, 10, Properties.Resources.round_gauntlet_icon, Properties.Resources.round_gauntlet_big_icon) },
Expand Down
9 changes: 6 additions & 3 deletions Entities/LogFileWatcher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ private void ParseLines() {
private readonly Dictionary<string, string> _sceneNameReplacer = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase) {
{ "FallGuy_FollowTheLeader_UNPACKED", "FallGuy_FollowTheLeader" }, { "FallGuy_BlueJay_UNPACKED", "FallGuy_BlueJay" }
};
private bool GetIsCreativeFinalRound(string showId) {
private bool GetIsCreativeFinalRound(string showId, string roundId) {
return (showId.IndexOf("show_wle_s10_wk01_srs_01", StringComparison.OrdinalIgnoreCase) != -1 ||
showId.IndexOf("show_wle_s10_wk01_srs_02", StringComparison.OrdinalIgnoreCase) != -1 ||
showId.IndexOf("show_wle_s10_wk01_srs_03", StringComparison.OrdinalIgnoreCase) != -1 ||
Expand Down Expand Up @@ -389,7 +389,10 @@ private bool GetIsCreativeFinalRound(string showId) {
showId.IndexOf("show_wle_s10_wk07_srs_03", StringComparison.OrdinalIgnoreCase) != -1 ||
showId.IndexOf("show_wle_s10_wk07_srs_04", StringComparison.OrdinalIgnoreCase) != -1 ||
showId.IndexOf("show_wle_s10_wk07_srs_05", StringComparison.OrdinalIgnoreCase) != -1 ||
showId.IndexOf("show_wle_s10_wk07_srs_06", StringComparison.OrdinalIgnoreCase) != -1);
showId.IndexOf("show_wle_s10_wk07_srs_06", StringComparison.OrdinalIgnoreCase) != -1 ||

(showId.IndexOf("wle_mrs_bagel", StringComparison.OrdinalIgnoreCase) != -1 && roundId.StartsWith("wle_mrs_bagel_final"))
);
}

private bool GetIsRealFinalRound(string roundId) {
Expand Down Expand Up @@ -560,7 +563,7 @@ private bool ParseLine(LogLine line, List<RoundInfo> round, LogRound logRound) {
logRound.Info.Name = line.Line.Substring(index + 62, index2 - index - 62);
}

if (this.GetIsCreativeFinalRound(this.selectedShowId) || logRound.Info.UseShareCode) {
if (this.GetIsCreativeFinalRound(this.selectedShowId, logRound.Info.Name) || logRound.Info.UseShareCode) {
logRound.Info.IsFinal = true;
} else if (this.GetIsRealFinalRound(logRound.Info.Name)) {
logRound.Info.IsFinal = true;
Expand Down
19 changes: 18 additions & 1 deletion Views/Stats.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1712,6 +1712,23 @@ private void UpdateDatabaseVersion() {
this.CurrentSettings.Version = 40;
this.SaveUserSettings();
}

if (this.CurrentSettings.Version == 40) {
this.AllStats.AddRange(this.RoundDetails.FindAll());
this.StatsDB.BeginTrans();
this.CurrentSettings.NotifyServerConnected = false;
for (int i = this.AllStats.Count - 1; i >= 0; i--) {
RoundInfo info = this.AllStats[i];
if ("wle_mrs_bagel".Equals(info.ShowNameId, StringComparison.OrdinalIgnoreCase) && info.Name.StartsWith("wle_mrs_bagel_final")) {
info.IsFinal = true;
this.RoundDetails.Update(info);
}
}
this.StatsDB.Commit();
this.AllStats.Clear();
this.CurrentSettings.Version = 41;
this.SaveUserSettings();
}
}
private UserSettings GetDefaultSettings() {
return new UserSettings {
Expand Down Expand Up @@ -1783,7 +1800,7 @@ private UserSettings GetDefaultSettings() {
UpdatedDateFormat = true,
WinPerDayGraphStyle = 0,
Visible = true,
Version = 40
Version = 41
};
}
private void UpdateHoopsieLegends() {
Expand Down

0 comments on commit d819890

Please sign in to comment.