mirror of
https://github.com/RaidMax/IW4M-Admin.git
synced 2025-06-10 15:20:48 -05:00
started work on getting the restart functionality in the gamelogserver
fix bug with unbanned players still showing as banned via lock icon move player based stuff into client class finally renamed Player to EFClient via partial class don't try to run this build because it's in between stages
This commit is contained in:
@ -8,6 +8,7 @@ using SharedLibraryCore.Database.Models;
|
||||
using SharedLibraryCore.Dtos;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using SharedLibraryCore.Objects;
|
||||
using static SharedLibraryCore.Database.Models.EFClient;
|
||||
|
||||
namespace SharedLibraryCore.Services
|
||||
{
|
||||
@ -35,7 +36,7 @@ namespace SharedLibraryCore.Services
|
||||
{
|
||||
await context.Clients
|
||||
.Where(c => c.AliasLinkId == addedEntity.LinkId)
|
||||
.ForEachAsync(c => c.Level = Objects.Player.Permission.Banned);
|
||||
.ForEachAsync(c => c.Level = Permission.Banned);
|
||||
}
|
||||
|
||||
// make flags propogate to all aliases
|
||||
@ -43,7 +44,7 @@ namespace SharedLibraryCore.Services
|
||||
{
|
||||
await context.Clients
|
||||
.Where(c => c.AliasLinkId == addedEntity.LinkId)
|
||||
.ForEachAsync(c => c.Level = Objects.Player.Permission.Flagged);
|
||||
.ForEachAsync(c => c.Level = Permission.Flagged);
|
||||
}
|
||||
|
||||
context.Penalties.Add(addedEntity);
|
||||
@ -221,10 +222,12 @@ namespace SharedLibraryCore.Services
|
||||
var iqPenalties = context.Penalties
|
||||
.Where(p => p.LinkId == linkId ||
|
||||
p.Link.Children.Any(a => a.IPAddress == ip))
|
||||
.Where(p => p.Type == Penalty.PenaltyType.TempBan ||
|
||||
p.Type == Penalty.PenaltyType.Ban ||
|
||||
p.Type == Penalty.PenaltyType.Flag)
|
||||
.Where(p => p.Active)
|
||||
.Where(p => p.Expires == null || p.Expires > now);
|
||||
|
||||
|
||||
|
||||
#if DEBUG == true
|
||||
var penaltiesSql = iqPenalties.ToSql();
|
||||
#endif
|
||||
@ -256,7 +259,7 @@ namespace SharedLibraryCore.Services
|
||||
{
|
||||
await internalContext.Clients
|
||||
.Where(c => c.AliasLinkId == p.LinkId)
|
||||
.ForEachAsync(c => c.Level = Player.Permission.User);
|
||||
.ForEachAsync(c => c.Level = EFClient.Permission.User);
|
||||
await internalContext.SaveChangesAsync();
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user