Skip to content

Commit

Permalink
Add most seen excluding ghosts as a leaderboard table
Browse files Browse the repository at this point in the history
  • Loading branch information
Simyon264 committed May 18, 2024
1 parent 99155e1 commit 8f1ee28
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions ReplayBrowser/Services/LeaderboardService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,12 @@ public async Task<LeaderboardData> GetLeaderboard(RangeOption rangeOption, strin
TrackedData = "Times seen",
Data = new Dictionary<string, PlayerCount>()
}},
{"MostSeenNoGhost", new Leaderboard()
{
Name = "Most Seen Players excluding ghosts",
TrackedData = "Times seen",
Data = new Dictionary<string, PlayerCount>()
}},
{"MostAntagPlayers", new Leaderboard()
{
Name = "Most Antag Players",
Expand Down Expand Up @@ -276,6 +282,13 @@ public async Task<LeaderboardData> GetLeaderboard(RangeOption rangeOption, strin
foreach (var player in distinctBy)
{
CountUp(player, "MostSeenPlayers", ref leaderboards);

// If the player name is not "Unknown" , we count them in the "MostSeenNoGhost" leaderboard.
if (dataReplay.RoundEndPlayers.Any(x => x.PlayerGuid == player.PlayerGuid && x.PlayerIcName != "Unknown")
)
{
CountUp(player, "MostSeenNoGhost", ref leaderboards);
}
}

foreach (var dataReplayRoundEndPlayer in dataReplay.RoundEndPlayers)
Expand Down

0 comments on commit 8f1ee28

Please sign in to comment.