add lobby rating to home

add gametype (WIP) to home
misc UI tweaks
This commit is contained in:
RaidMax
2021-06-30 09:57:07 -05:00
parent fc0bed2405
commit bccbcce3c1
9 changed files with 59 additions and 15 deletions

View File

@ -28,5 +28,6 @@ namespace SharedLibraryCore.Dtos
public string LastConnectionText => (DateTime.UtcNow - LastConnection).HumanizeForCurrentCulture();
public IDictionary<int, long> LinkedAccounts { get; set; }
public MetaType? MetaFilterType { get; set; }
public double? ZScore { get; set; }
}
}

View File

@ -23,5 +23,21 @@ namespace SharedLibraryCore.Dtos
public string IPAddress { get; set; }
public bool IsPasswordProtected { get; set; }
public string Endpoint => $"{IPAddress}:{Port}";
public double? LobbyZScore
{
get
{
var valid = Players.Where(player => player.ZScore != null && player.ZScore != 0)
.ToList();
if (!valid.Any())
{
return null;
}
return Math.Round(valid.Select(player => player.ZScore.Value).Average(), 2);
}
}
}
}
}