mirror of
https://github.com/RaidMax/IW4M-Admin.git
synced 2025-06-10 15:20:48 -05:00
fix aliases for real (hopefully)
fix bug with flag not being applied fix level being set based on IP instead of IP and name
This commit is contained in:
@ -55,7 +55,7 @@ namespace SharedLibraryCore.Services
|
||||
{
|
||||
await context.Clients
|
||||
.Include(c => c.ReceivedPenalties)
|
||||
.Where(c => c.AliasLinkId == newEntity.LinkId)
|
||||
.Where(c => c.AliasLinkId == newEntity.Link.AliasLinkId)
|
||||
.ForEachAsync(c =>
|
||||
{
|
||||
if (c.Level != Permission.Flagged)
|
||||
@ -81,7 +81,7 @@ namespace SharedLibraryCore.Services
|
||||
// we just want to add it to the database
|
||||
else
|
||||
{
|
||||
context.Penalties.Add(new EFPenalty()
|
||||
var penalty = new EFPenalty()
|
||||
{
|
||||
Active = true,
|
||||
OffenderId = newEntity.Offender.ClientId,
|
||||
@ -93,7 +93,10 @@ namespace SharedLibraryCore.Services
|
||||
When = DateTime.UtcNow,
|
||||
AutomatedOffense = newEntity.AutomatedOffense,
|
||||
IsEvadedOffense = newEntity.IsEvadedOffense
|
||||
});
|
||||
};
|
||||
|
||||
newEntity.Offender.ReceivedPenalties.Add(penalty);
|
||||
context.Penalties.Add(penalty);
|
||||
}
|
||||
|
||||
await context.SaveChangesAsync();
|
||||
|
Reference in New Issue
Block a user