Skip to content

Commit

Permalink
Merge pull request #380 from Micdu70/patch-2
Browse files Browse the repository at this point in the history
Bug fix (for new LTM)
  • Loading branch information
qutrits authored Sep 23, 2024
2 parents 9d9d13b + 4d69815 commit fa0110a
Show file tree
Hide file tree
Showing 3 changed files with 69 additions and 36 deletions.
7 changes: 5 additions & 2 deletions Entities/LogFileWatcher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -361,18 +361,21 @@ private bool IsRealFinalRound(string roundId, string showId) {
|| (roundId.IndexOf("round_fall_ball", StringComparison.OrdinalIgnoreCase) != -1
&& roundId.IndexOf("_non_final", StringComparison.OrdinalIgnoreCase) == -1
&& roundId.IndexOf("_cup_only", StringComparison.OrdinalIgnoreCase) == -1
&& roundId.IndexOf("_teamgames", StringComparison.OrdinalIgnoreCase) == -1
&& !string.Equals(showId, "event_anniversary_season_1_alternate_name"))

|| (roundId.IndexOf("round_territory", StringComparison.OrdinalIgnoreCase) != -1
&& roundId.IndexOf("_non_final", StringComparison.OrdinalIgnoreCase) == -1)
&& roundId.IndexOf("_non_final", StringComparison.OrdinalIgnoreCase) == -1
&& roundId.IndexOf("_teamgames", StringComparison.OrdinalIgnoreCase) == -1)

|| (roundId.IndexOf("round_basketfall", StringComparison.OrdinalIgnoreCase) != -1
&& roundId.IndexOf("_non_final", StringComparison.OrdinalIgnoreCase) == -1
&& (roundId.EndsWith("_duos", StringComparison.OrdinalIgnoreCase)
|| roundId.IndexOf("_final", StringComparison.OrdinalIgnoreCase) != -1))

|| (roundId.IndexOf("round_1v1_volleyfall", StringComparison.OrdinalIgnoreCase) != -1
&& roundId.IndexOf("_final", StringComparison.OrdinalIgnoreCase) != -1)
&& (roundId.IndexOf("_final", StringComparison.OrdinalIgnoreCase) != -1
|| roundId.IndexOf("_teamgames", StringComparison.OrdinalIgnoreCase) != -1))

|| ((roundId.IndexOf("round_pixelperfect", StringComparison.OrdinalIgnoreCase) != -1
|| roundId.IndexOf("round_robotrampage", StringComparison.OrdinalIgnoreCase) != -1)
Expand Down
26 changes: 16 additions & 10 deletions Entities/Multilingual.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13485,6 +13485,7 @@ public static class Multilingual {
{ "squads_show_ss2_parrot", "Squads" },
{ "survival_of_the_fittest", "Survival of the Fittest" },
{ "teams_show", "Connection Error" },
{ "teams_show_ltm", "Dynamic Duos" },
{ "toms_main_show_5_2", "Main Show" },
{ "toms_show2", "Toms Show 2" },
{ "turbo_show", "Solos" },
Expand Down Expand Up @@ -14054,7 +14055,7 @@ public static class Multilingual {
{ "casual_show", "Exploration" },
{ "classic_duos_show", "Duos" },
{ "classic_solo_main_show", "Solo" },
{ "classic_squads_show", "Escouades" },
{ "classic_squads_show", "Groupes" },
{ "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 @@ -14305,7 +14306,7 @@ public static class Multilingual {
{ "invisibeans_template", "VOLEURS SUCRÉS" },
{ "knockout_duos", "Duos" },
{ "knockout_mode", "Tournois" },
{ "knockout_squads", "Escouades" },
{ "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 @@ -14369,9 +14370,9 @@ public static class Multilingual {
{ "solo_show_ss2_parrot", "Solo" },
{ "spectator_show", "Sport spectateur" },
{ "squad_duo_slimeclimbs", ""},
{ "squad_show", "ESCOUADES" },
{ "squad_show_2player", "ESCOUADES" },
{ "squad_show_2player_laps", "ESCOUADES" },
{ "squad_show", "GROUPES" },
{ "squad_show_2player", "GROUPES" },
{ "squad_show_2player_laps", "GROUPES" },
{ "squad_show_survival", "DEBUG Squad Show Survival" },
{ "squad_show_team_2player", "Erreur de connexion" },
{ "squadcelebration", "Célébration de groupe" },
Expand All @@ -14384,13 +14385,14 @@ public static class Multilingual {
{ "squads_3player_04012022_to_13012022", "Trios" },
{ "squads_3player_automation", "Trios" },
{ "squads_3player_template", "Trios" },
{ "squads_4player", "Escouades" },
{ "squads_4player_2812_no_end", "Escouades" },
{ "squads_4player_after_potoo", "Escouades" },
{ "squads_show_ss2_launch", "Escouades SS2" },
{ "squads_show_ss2_parrot", "Escouades" },
{ "squads_4player", "Groupes" },
{ "squads_4player_2812_no_end", "Groupes" },
{ "squads_4player_after_potoo", "Groupes" },
{ "squads_show_ss2_launch", "Groupes SS2" },
{ "squads_show_ss2_parrot", "Groupes" },
{ "survival_of_the_fittest", "Le plus fort survivra" },
{ "teams_show", "Erreur de connexion" },
{ "teams_show_ltm", "Duo Dynamique" },
{ "toms_main_show_5_2", "Émission principale" },
{ "toms_show2", "Toms Show 2" },
{ "turbo_show", "Solo" },
Expand Down Expand Up @@ -15297,6 +15299,7 @@ public static class Multilingual {
{ "squads_show_ss2_parrot", "스쿼드" },
{ "survival_of_the_fittest", "적자 생존" },
{ "teams_show", "접속 오류" },
{ "teams_show_ltm", "다이나믹 듀오" },
{ "turbo_show", "솔로" },
{ "turbo_2_show", "솔로" },
{ "toms_main_show_5_2", "메인 쇼" },
Expand Down Expand Up @@ -16203,6 +16206,7 @@ public static class Multilingual {
{ "squads_show_ss2_parrot", "スクワッド" },
{ "survival_of_the_fittest", "強者サバイバル" },
{ "teams_show", "接続エラー" },
{ "teams_show_ltm", "ダイナミック・デュオ" },
{ "toms_main_show_5_2", "メインショー" },
{ "toms_show2", "Toms Show 2" },
{ "turbo_show", "ソロ" },
Expand Down Expand Up @@ -17109,6 +17113,7 @@ public static class Multilingual {
{ "squads_show_ss2_parrot", "小队" },
{ "survival_of_the_fittest", "适者生存" },
{ "teams_show", "网络故障" },
{ "teams_show_ltm", "强力拍档" },
{ "toms_main_show_5_2", "主要专题" },
{ "toms_show2", "Toms Show 2" },
{ "turbo_show", "单人" },
Expand Down Expand Up @@ -18015,6 +18020,7 @@ public static class Multilingual {
{ "squads_show_ss2_parrot", "小隊" },
{ "survival_of_the_fittest", "適者生存" },
{ "teams_show", "網絡故障" },
{ "teams_show_ltm", "霹靂雙人組" },
{ "toms_main_show_5_2", "主要專題" },
{ "toms_show2", "Toms Show 2" },
{ "turbo_show", "單人" },
Expand Down
72 changes: 48 additions & 24 deletions Views/Stats.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2462,8 +2462,8 @@ where string.Equals(ri.ShowNameId, "wle_shuffle_discover")
Profiles profile = this.Profiles.FindOne(Query.EQ("LinkedShowId", "fall_guys_creative_mode"));
int profileId = profile?.ProfileId ?? -1;
foreach (RoundInfo ri in roundInfoList) {
ri.IsFinal = true;
if (profileId != -1) ri.Profile = profileId;
ri.IsFinal = true;
}
this.StatsDB.BeginTrans();
this.RoundDetails.Update(roundInfoList);
Expand All @@ -2483,13 +2483,13 @@ where string.Equals(ri.ShowNameId, "wle_shuffle_discover")
//
// this.StatsDB.BeginTrans();
// foreach (RoundInfo ri in roundInfoList) {
// if (profileId != -1) ri.Profile = profileId;
// if (string.Equals(ri.ShowNameId, "wle_mrs_shuffle_show_squads") && ri.Name.EndsWith("_squads")) {
// ri.Name = ri.Name.Substring(0, ri.Name.LastIndexOf("_squads", StringComparison.OrdinalIgnoreCase));
// }
// if (this.LevelIdReplacerInShuffleShow.TryGetValue(ri.Name, out string newName)) {
// ri.Name = newName;
// }
// if (profileId != -1) ri.Profile = profileId;
// ri.IsFinal = true;
//
// if (string.Equals(ri.ShowNameId, "wle_mrs_shuffle_show_squads") && ri.Round > 1) {
Expand Down Expand Up @@ -2520,13 +2520,13 @@ where string.Equals(ri.ShowNameId, "wle_shuffle_discover")
//
// this.StatsDB.BeginTrans();
// foreach (RoundInfo ri in roundInfoList) {
// if (profileId != -1) ri.Profile = profileId;
// if (string.Equals(ri.ShowNameId, "wle_mrs_shuffle_show_squads") && ri.Name.IndexOf("_squads", StringComparison.OrdinalIgnoreCase) != -1) {
// ri.Name = ri.Name.Replace("_squads", "");
// }
// if (this.LevelIdReplacerInShuffleShow.TryGetValue(ri.Name, out string newName)) {
// ri.Name = newName;
// }
// if (profileId != -1) ri.Profile = profileId;
// ri.IsFinal = true;
//
// if (string.Equals(ri.ShowNameId, "wle_mrs_shuffle_show_squads") && ri.Round > 1) {
Expand Down Expand Up @@ -2573,8 +2573,8 @@ where string.Equals(ri.ShowNameId, "wle_mrs_bouncy_bean_time")
Profiles profile = this.Profiles.FindOne(Query.EQ("LinkedShowId", "fall_guys_creative_mode"));
int profileId = profile?.ProfileId ?? -1;
foreach (RoundInfo ri in roundInfoList) {
ri.IsFinal = ri.Name.EndsWith("_final");
if (profileId != -1) ri.Profile = profileId;
ri.IsFinal = ri.Name.EndsWith("_final");
}
this.StatsDB.BeginTrans();
this.RoundDetails.Update(roundInfoList);
Expand Down Expand Up @@ -2621,10 +2621,10 @@ where string.Equals(ri.ShowNameId, "wle_mrs_winter")
Profiles profile = this.Profiles.FindOne(Query.EQ("LinkedShowId", "fall_guys_creative_mode"));
int profileId = profile?.ProfileId ?? -1;
foreach (RoundInfo ri in roundInfoList) {
if (profileId != -1) ri.Profile = profileId;
if (ri.Name.IndexOf("_final_", StringComparison.OrdinalIgnoreCase) != -1) {
ri.IsFinal = true;
}
if (profileId != -1) ri.Profile = profileId;
}
this.StatsDB.BeginTrans();
this.RoundDetails.Update(roundInfoList);
Expand All @@ -2640,8 +2640,8 @@ where string.Equals(ri.ShowNameId, "event_blast_ball_banger_template")
Profiles profile = this.Profiles.FindOne(Query.EQ("LinkedShowId", "event_blast_ball_banger_template"));
int profileId = profile?.ProfileId ?? -1;
foreach (RoundInfo ri in roundInfoList) {
ri.IsFinal = string.Equals(ri.Name, "round_blastball_arenasurvival_symphony_launch_show");
if (profileId != -1) ri.Profile = profileId;
ri.IsFinal = string.Equals(ri.Name, "round_blastball_arenasurvival_symphony_launch_show");
}
this.StatsDB.BeginTrans();
this.RoundDetails.Update(roundInfoList);
Expand Down Expand Up @@ -2711,8 +2711,8 @@ where string.Equals(ri.ShowNameId, "wle_mrs_bouncy_bean_time")
Profiles profile = this.Profiles.FindOne(Query.EQ("LinkedShowId", "fall_guys_creative_mode"));
int profileId = profile?.ProfileId ?? -1;
foreach (RoundInfo ri in roundInfoList) {
ri.IsFinal = ri.Name.IndexOf("_final", StringComparison.OrdinalIgnoreCase) != -1;
if (profileId != -1) ri.Profile = profileId;
ri.IsFinal = ri.Name.IndexOf("_final", StringComparison.OrdinalIgnoreCase) != -1;
}
this.StatsDB.BeginTrans();
this.RoundDetails.Update(roundInfoList);
Expand Down Expand Up @@ -2778,10 +2778,10 @@ where string.Equals(ri.ShowNameId, "wle_mrs_survival_showdown")
Profiles profile = this.Profiles.FindOne(Query.EQ("LinkedShowId", "fall_guys_creative_mode"));
int profileId = profile?.ProfileId ?? -1;
foreach (RoundInfo ri in roundInfoList) {
if (profileId != -1) ri.Profile = profileId;
if (ri.Name.IndexOf("_showdown_final", StringComparison.OrdinalIgnoreCase) != -1) {
ri.IsFinal = true;
}
if (profileId != -1) ri.Profile = profileId;
}
this.StatsDB.BeginTrans();
this.RoundDetails.Update(roundInfoList);
Expand Down Expand Up @@ -2825,8 +2825,8 @@ where string.Equals(ri.ShowNameId, "wle_shuffle_survival")
Profiles profile = this.Profiles.FindOne(Query.EQ("LinkedShowId", "fall_guys_creative_mode"));
int profileId = profile?.ProfileId ?? -1;
foreach (RoundInfo ri in roundInfoList) {
ri.IsFinal = true;
if (profileId != -1) ri.Profile = profileId;
ri.IsFinal = true;
}
this.StatsDB.BeginTrans();
this.RoundDetails.Update(roundInfoList);
Expand Down Expand Up @@ -2887,8 +2887,8 @@ where string.Equals(ri.ShowNameId, "event_april_fools") && ri.IsFinal == false
Profiles profile = this.Profiles.FindOne(Query.EQ("LinkedShowId", "fall_guys_creative_mode"));
int profileId = profile?.ProfileId ?? -1;
foreach (RoundInfo ri in roundInfoList) {
ri.IsFinal = true;
if (profileId != -1) ri.Profile = profileId;
ri.IsFinal = true;
}
this.StatsDB.BeginTrans();
this.RoundDetails.Update(roundInfoList);
Expand Down Expand Up @@ -3215,9 +3215,9 @@ where string.Equals(ri.ShowNameId, "event_april_fools") && ri.IsFinal == false
where !string.IsNullOrEmpty(ri.ShowNameId) && string.Equals(ri.ShowNameId, "no_elimination_explore")
select ri).ToList();

Profiles profile = this.Profiles.FindOne(Query.EQ("LinkedShowId", "main_show"));
int profileId = profile?.ProfileId ?? -1;
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;
Expand All @@ -3238,9 +3238,9 @@ where string.Equals(ri.ShowNameId, "event_april_fools") && ri.IsFinal == false
where !string.IsNullOrEmpty(ri.ShowNameId) && string.Equals(ri.ShowNameId, "ftue_uk_show")
select ri).ToList();

Profiles profile = this.Profiles.FindOne(Query.EQ("LinkedShowId", "main_show"));
int profileId = profile?.ProfileId ?? -1;
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.IsFinal = string.Equals(ri.Name, "round_snowballsurvival");
}
Expand Down Expand Up @@ -3297,6 +3297,28 @@ where string.Equals(ri.ShowNameId, "event_april_fools") && ri.IsFinal == false
this.CurrentSettings.Version = 102;
this.SaveUserSettings();
}

if (this.CurrentSettings.Version == 102) {
List<RoundInfo> roundInfoList = (from ri in this.RoundDetails.FindAll()
where !string.IsNullOrEmpty(ri.ShowNameId) && string.Equals(ri.ShowNameId, "teams_show_ltm")
select ri).ToList();

Profiles profile = this.Profiles.FindOne(Query.EQ("LinkedShowId", "squads_2player_template"));
int profileId = profile?.ProfileId ?? -1;
foreach (RoundInfo ri in roundInfoList) {
if (profileId != -1) ri.Profile = profileId;
if (string.Equals(ri.Name, "round_territory_control_s4_show") || (string.Equals(ri.Name, "round_fall_ball_60_players") && (ri.Players % 2 == 0) && ri.Round == 1)) {
ri.IsFinal = false;
} else if (string.Equals(ri.Name, "round_1v1_volleyfall_symphony_launch_show")) {
ri.IsFinal = true;
}
}
this.StatsDB.BeginTrans();
this.RoundDetails.Update(roundInfoList);
this.StatsDB.Commit();
this.CurrentSettings.Version = 103;
this.SaveUserSettings();
}
}

private UserSettings GetDefaultSettings() {
Expand Down Expand Up @@ -4715,26 +4737,28 @@ private string GetCurrentProfileLinkedShowId() {

public string GetAlternateShowId(string showId) {
switch (showId) {
case "turbo_show":
case "turbo_2_show":
case "knockout_mode":
case "ftue_uk_show":
// case "anniversary_fp12_ltm":
case "classic_solo_main_show":
case "ftue_uk_show":
case "knockout_mode":
case "no_elimination_explore":
// case "anniversary_fp12_ltm":
case "turbo_2_show":
case "turbo_show":
return "main_show";
case "knockout_duos":
case "classic_duos_show":
case "knockout_duos":
case "teams_show_ltm":
return "squads_2player_template";
case "squadcelebration":
case "classic_squads_show":
case "event_day_at_races_squads_template":
case "knockout_squads":
case "classic_squads_show":
case "squadcelebration":
return "squads_4player";
case "invisibeans_template":
case "invisibeans_pistachio_template":
case "invisibeans_template":
return "invisibeans_mode";
default: return showId;
default:
return showId;
}
}

Expand Down

0 comments on commit fa0110a

Please sign in to comment.