make sure flags are excluded from active penalties on player profile

modify how flags "expire"
This commit is contained in:
RaidMax
2019-06-25 18:01:47 -05:00
parent 421e90cf70
commit 16d2ec82b8
6 changed files with 21 additions and 18 deletions

View File

@ -22,7 +22,8 @@ namespace WebfrontCore.Controllers
return NotFound();
}
var activePenalties = await Manager.GetPenaltyService().GetActivePenaltiesAsync(client.AliasLinkId, client.IPAddress);
var activePenalties = (await Manager.GetPenaltyService().GetActivePenaltiesAsync(client.AliasLinkId, client.IPAddress))
.Where(_penalty => _penalty.Type != PenaltyType.Flag);
var clientDto = new PlayerInfo()
{
@ -46,8 +47,8 @@ namespace WebfrontCore.Controllers
.Distinct()
.OrderBy(i => i)
.ToList(),
HasActivePenalty = activePenalties.Count > 0,
ActivePenaltyType = activePenalties.Count > 0 ? activePenalties.First().Type.ToString() : null,
HasActivePenalty = activePenalties.Count() > 0,
ActivePenaltyType = activePenalties.Count() > 0 ? activePenalties.First().Type.ToString() : null,
Online = Manager.GetActiveClients().FirstOrDefault(c => c.ClientId == client.ClientId) != null,
TimeOnline = (DateTime.UtcNow - client.LastConnection).TimeSpanText(),
LinkedAccounts = client.LinkedAccounts