update schema to support unique guid + game combinations

This commit is contained in:
RaidMax
2022-06-15 19:37:34 -05:00
parent deeb1dea87
commit 8ae6561f4e
46 changed files with 5449 additions and 181 deletions

View File

@ -54,7 +54,8 @@ public class BanInfoResourceQueryHelper : IResourceQueryHelper<BanInfoRequest, B
client.NetworkId,
client.AliasLinkId,
client.ClientId,
client.CurrentAlias.IPAddress
client.CurrentAlias.IPAddress,
client.GameName
}).ToListAsync();
var results = new List<BanInfo>();
@ -101,7 +102,6 @@ public class BanInfoResourceQueryHelper : IResourceQueryHelper<BanInfoRequest, B
.Select(alias => alias.LinkId)
.ToListAsync()).Distinct();
matchedPenalties = await context.Penalties.Where(penalty => penalty.Type == EFPenalty.PenaltyType.Ban)
.Where(penalty => penalty.Expires == null || penalty.Expires > lateDateTime)
.Where(penalty => penalty.LinkId != null && linkIds.Contains(penalty.LinkId.Value))
@ -158,6 +158,7 @@ public class BanInfoResourceQueryHelper : IResourceQueryHelper<BanInfoRequest, B
ClientId = matchingClient.ClientId,
NetworkId = matchingClient.NetworkId,
IPAddress = matchingClient.IPAddress,
Game = matchingClient.GameName,
AssociatedPenalties = relatedEntities,
AttachedPenalty = allPenalties.FirstOrDefault(penalty =>

View File

@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
using Data.Models;
namespace WebfrontCore.QueryHelpers.Models;
@ -9,6 +10,7 @@ public class BanInfo
public int ClientId { get; set; }
public int? IPAddress { get; set; }
public long NetworkId { get; set; }
public Reference.Game Game { get; set; }
public PenaltyInfo AttachedPenalty { get; set; }
public IEnumerable<PenaltyInfo> AssociatedPenalties { get; set; }
}