Skip to content

Commit

Permalink
Display the creative map's time limit
Browse files Browse the repository at this point in the history
  • Loading branch information
qutrits committed Jun 29, 2023
1 parent c77b6e1 commit 5abeb68
Showing 1 changed file with 21 additions and 21 deletions.
42 changes: 21 additions & 21 deletions Views/Stats.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2285,27 +2285,27 @@ private void LogFile_OnParsedLogLines(List<RoundInfo> round) {
stat.ShowID = nextShowID;
stat.Profile = profile;

// if (stat.UseShareCode && string.IsNullOrEmpty(stat.CreativeShareCode)) {
// try {
// JsonElement resData = this.GetApiData(this.FALLGUYSDB_API_URL, $"creative/{stat.ShowNameId}.json").GetProperty("data").GetProperty("snapshot");
// string[] onlinePlatformInfo = this.FindCreativeAuthor(resData.GetProperty("author").GetProperty("name_per_platform"));
// stat.CreativeShareCode = resData.GetProperty("share_code").GetString();
// stat.CreativeOnlinePlatformId = onlinePlatformInfo[0];
// stat.CreativeAuthor = onlinePlatformInfo[1];
// stat.CreativeVersion = resData.GetProperty("version_metadata").GetProperty("version").GetInt32();
// stat.CreativeStatus = resData.GetProperty("version_metadata").GetProperty("status").GetString();
// stat.CreativeTitle = resData.GetProperty("version_metadata").GetProperty("title").GetString();
// stat.CreativeDescription = resData.GetProperty("version_metadata").GetProperty("description").GetString();
// stat.CreativeMaxPlayer = resData.GetProperty("version_metadata").GetProperty("max_player_count").GetInt32();
// stat.CreativePlatformId = resData.GetProperty("version_metadata").GetProperty("platform_id").GetString();
// stat.CreativeLastModifiedDate = resData.GetProperty("version_metadata").GetProperty("last_modified_date").GetDateTime();
// stat.CreativePlayCount = resData.GetProperty("play_count").GetInt32();
// stat.CreativeQualificationPercent = resData.GetProperty("version_metadata").GetProperty("qualification_percent").GetInt32();
// stat.CreativeTimeLimitSeconds = resData.GetProperty("version_metadata").GetProperty("config").GetProperty("time_limit_seconds").GetInt32();
// } catch {
// // ignore
// }
// }
if (stat.UseShareCode && string.IsNullOrEmpty(stat.CreativeShareCode)) {
try {
JsonElement resData = this.GetApiData(this.FALLGUYSDB_API_URL, $"creative/{stat.ShowNameId}.json").GetProperty("data").GetProperty("snapshot");
string[] onlinePlatformInfo = this.FindCreativeAuthor(resData.GetProperty("author").GetProperty("name_per_platform"));
stat.CreativeShareCode = resData.GetProperty("share_code").GetString();
stat.CreativeOnlinePlatformId = onlinePlatformInfo[0];
stat.CreativeAuthor = onlinePlatformInfo[1];
stat.CreativeVersion = resData.GetProperty("version_metadata").GetProperty("version").GetInt32();
stat.CreativeStatus = resData.GetProperty("version_metadata").GetProperty("status").GetString();
stat.CreativeTitle = resData.GetProperty("version_metadata").GetProperty("title").GetString();
stat.CreativeDescription = resData.GetProperty("version_metadata").GetProperty("description").GetString();
stat.CreativeMaxPlayer = resData.GetProperty("version_metadata").GetProperty("max_player_count").GetInt32();
stat.CreativePlatformId = resData.GetProperty("version_metadata").GetProperty("platform_id").GetString();
stat.CreativeLastModifiedDate = resData.GetProperty("version_metadata").GetProperty("last_modified_date").GetDateTime();
stat.CreativePlayCount = resData.GetProperty("play_count").GetInt32();
stat.CreativeQualificationPercent = resData.GetProperty("version_metadata").GetProperty("qualification_percent").GetInt32();
stat.CreativeTimeLimitSeconds = resData.GetProperty("version_metadata").GetProperty("config").GetProperty("time_limit_seconds").GetInt32();
} catch {
// ignore
}
}

this.RoundDetails.Insert(stat);
this.AllStats.Add(stat);
Expand Down

0 comments on commit 5abeb68

Please sign in to comment.