diff --git a/Application/IW4MServer.cs b/Application/IW4MServer.cs
index aa937e1b..2874d263 100644
--- a/Application/IW4MServer.cs
+++ b/Application/IW4MServer.cs
@@ -940,7 +940,7 @@ namespace IW4MAdmin
await Manager.GetPenaltyService().Create(newPenalty);
}
- override protected async Task Ban(string reason, EFClient targetClient, EFClient originClient, bool isEvade)
+ override protected async Task Ban(string reason, EFClient targetClient, EFClient originClient, bool isEvade = false)
{
// ensure player gets banned if command not performed on them in game
if (targetClient.ClientNumber < 0)
diff --git a/Application/RconParsers/IW4RConParser.cs b/Application/RconParsers/IW4RConParser.cs
index 0f325b78..95c0f8d8 100644
--- a/Application/RconParsers/IW4RConParser.cs
+++ b/Application/RconParsers/IW4RConParser.cs
@@ -124,13 +124,14 @@ namespace IW4MAdmin.Application.RconParsers
IsBot = ip == null,
State = EFClient.ClientState.Connecting
};
- StatusPlayers.Add(client);
// they've not fully connected yet
if (!client.IsBot && ping == 999)
{
continue;
}
+
+ StatusPlayers.Add(client);
}
}
diff --git a/Plugins/Stats/Helpers/StatManager.cs b/Plugins/Stats/Helpers/StatManager.cs
index 2fade33f..b72b8048 100644
--- a/Plugins/Stats/Helpers/StatManager.cs
+++ b/Plugins/Stats/Helpers/StatManager.cs
@@ -618,8 +618,9 @@ namespace IW4MAdmin.Plugins.Stats.Helpers
}
},
Level = EFClient.Permission.Console,
- CurrentServer = attacker.CurrentServer
- });
+ CurrentServer = attacker.CurrentServer,
+
+ }, false);
if (clientDetection.Tracker.HasChanges)
{
SaveTrackedSnapshots(clientDetection, ctx);
diff --git a/SharedLibraryCore/Commands/NativeCommands.cs b/SharedLibraryCore/Commands/NativeCommands.cs
index 5ea73389..a49396ca 100644
--- a/SharedLibraryCore/Commands/NativeCommands.cs
+++ b/SharedLibraryCore/Commands/NativeCommands.cs
@@ -231,7 +231,7 @@ namespace SharedLibraryCore.Commands
public override async Task ExecuteAsync(GameEvent E)
{
- var _ = !(await E.Target.Ban(E.Data, E.Origin).WaitAsync()).Failed ?
+ var _ = !(await E.Target.Ban(E.Data, E.Origin, false).WaitAsync()).Failed ?
E.Origin.Tell($"^5{E.Target} ^7{Utilities.CurrentLocalization.LocalizationIndex["COMMANDS_BAN_SUCCESS"]}") :
E.Origin.Tell($"{Utilities.CurrentLocalization.LocalizationIndex["COMMANDS_BAN_FAIL"]} {E.Target.Name}");
}
diff --git a/SharedLibraryCore/Objects/EFClient.cs b/SharedLibraryCore/Objects/EFClient.cs
index 5c0ac2af..8b5377cb 100644
--- a/SharedLibraryCore/Objects/EFClient.cs
+++ b/SharedLibraryCore/Objects/EFClient.cs
@@ -348,7 +348,7 @@ namespace SharedLibraryCore.Database.Models
///
/// reason for the ban
/// client performing the ban
- public GameEvent Ban(String banReason, EFClient sender, bool isEvade = false)
+ public GameEvent Ban(String banReason, EFClient sender, bool isEvade)
{
var e = new GameEvent()
{
diff --git a/SharedLibraryCore/Server.cs b/SharedLibraryCore/Server.cs
index 053f8a2e..967ea57d 100644
--- a/SharedLibraryCore/Server.cs
+++ b/SharedLibraryCore/Server.cs
@@ -208,7 +208,7 @@ namespace SharedLibraryCore
/// The reason for the ban
/// The person to ban
/// The person who banned the target
- abstract protected Task Ban(String Reason, EFClient Target, EFClient Origin, bool isEvade);
+ abstract protected Task Ban(String Reason, EFClient Target, EFClient Origin, bool isEvade = false);
abstract protected Task Warn(String Reason, EFClient Target, EFClient Origin);
diff --git a/SharedLibraryCore/Services/PenaltyService.cs b/SharedLibraryCore/Services/PenaltyService.cs
index b024b48a..b8434b71 100644
--- a/SharedLibraryCore/Services/PenaltyService.cs
+++ b/SharedLibraryCore/Services/PenaltyService.cs
@@ -66,7 +66,6 @@ namespace SharedLibraryCore.Services
public async Task> Find(Func expression)
{
throw await Task.FromResult(new Exception());
-
}
public Task Get(int entityID)
@@ -96,7 +95,7 @@ namespace SharedLibraryCore.Services
.OrderByDescending(p => p.When)
.Skip(offset)
.Take(count)
- .ToListAsync();
+ .ToListAsync();
}
}
@@ -116,7 +115,7 @@ namespace SharedLibraryCore.Services
///
/// Get a read-only copy of client penalties
///
- ///
+ ///
/// Retreive penalties for clients receiving penalties, other wise given
///
public async Task> ReadGetClientPenaltiesAsync(int clientId, bool victim = true)
diff --git a/WebfrontCore/ViewComponents/PenaltyListViewComponent.cs b/WebfrontCore/ViewComponents/PenaltyListViewComponent.cs
index 0cbec742..e0e539cc 100644
--- a/WebfrontCore/ViewComponents/PenaltyListViewComponent.cs
+++ b/WebfrontCore/ViewComponents/PenaltyListViewComponent.cs
@@ -1,5 +1,6 @@
using Microsoft.AspNetCore.Mvc;
using SharedLibraryCore;
+using SharedLibraryCore.Database.Models;
using SharedLibraryCore.Dtos;
using SharedLibraryCore.Objects;
using System;
@@ -12,6 +13,9 @@ namespace WebfrontCore.ViewComponents
{
public async Task InvokeAsync(int offset, Penalty.PenaltyType showOnly)
{
+ string showEvadeString(EFPenalty penalty) => penalty.IsEvadedOffense == true ?
+ $"({Utilities.CurrentLocalization.LocalizationIndex["WEBFRONT_PENALTY_EVADE"]}) " : "";
+
var penalties = await Program.Manager.GetPenaltyService().GetRecentPenalties(12, offset, showOnly);
var penaltiesDto = penalties.Select(p => new PenaltyInfo()
{
@@ -25,9 +29,9 @@ namespace WebfrontCore.ViewComponents
#if DEBUG
Offense = !string.IsNullOrEmpty(p.AutomatedOffense) ? p.AutomatedOffense : p.Offense,
#else
- Offense = User.Identity.IsAuthenticated && !string.IsNullOrEmpty(p.AutomatedOffense) ? (p.IsEvadedOffense ?
- $"({Utilities.CurrentLocalization.LocalizationIndex["WEBFRONT_PENALTY_EVADE"]}) " : "") + p.AutomatedOffense :
- $"({Utilities.CurrentLocalization.LocalizationIndex["WEBFRONT_PENALTY_EVADE"]}) " + p.Offense,
+ Offense = (User.Identity.IsAuthenticated && !string.IsNullOrEmpty(p.AutomatedOffense)) ?
+ $"{showEvadeString(p)}{p.AutomatedOffense}" :
+ $"{showEvadeString(p)}{p.Offense}",
#endif
Type = p.Type.ToString(),
TimePunished = Utilities.GetTimePassed(p.When, false),