1
0
mirror of https://github.com/RaidMax/IW4M-Admin.git synced 2025-06-10 23:31:13 -05:00

fix penalty list javascript loading duplicates

make bad GUID parse throw an exception so we don't have a client connect with GUID of 0
no longer print out ac debug messages
fix small issue of trying to parse empty chat messages
fix issue with set level on accounts with multi guid, same IP
This commit is contained in:
RaidMax
2019-05-02 22:33:38 -05:00
parent 68b1e61846
commit b3f636e90a
20 changed files with 144 additions and 138 deletions

View File

@ -17,7 +17,7 @@ namespace WebfrontCore.Controllers.API
public IActionResult ClientInfo(string networkId)
{
var clientInfo = Manager.GetActiveClients()
.FirstOrDefault(c => c.NetworkId == networkId.ConvertLong());
.FirstOrDefault(c => c.NetworkId == networkId.ConvertGuidToLong());
if (clientInfo != null)
{
@ -40,7 +40,7 @@ namespace WebfrontCore.Controllers.API
return Unauthorized();
var client = Manager.GetActiveClients()
.FirstOrDefault(c => c.NetworkId == networkId.ConvertLong());
.FirstOrDefault(c => c.NetworkId == networkId.ConvertGuidToLong());
var server = Manager.GetServers().First(c => c.EndPoint == serverId);

View File

@ -18,7 +18,7 @@ namespace IW4MAdmin.Plugins.Login.Commands
public override async Task ExecuteAsync(GameEvent E)
{
var client = E.Owner.Manager.GetPrivilegedClients()[E.Origin.ClientId];
var client = E.Owner.Manager.PrivilegedClients[E.Origin.ClientId];
bool success = E.Owner.Manager.TokenAuthenticator.AuthorizeToken(E.Origin.NetworkId, E.Data);
if (!success)

View File

@ -42,7 +42,7 @@ namespace IW4MAdmin.Plugins.Login
E.Origin.Level == EFClient.Permission.Console)
return Task.CompletedTask;
E.Owner.Manager.GetPrivilegedClients().TryGetValue(E.Origin.ClientId, out EFClient client);
E.Owner.Manager.PrivilegedClients.TryGetValue(E.Origin.ClientId, out EFClient client);
if (((Command)E.Extra).Name == new SharedLibraryCore.Commands.CSetPassword().Name &&
client?.Password == null)

View File

@ -201,18 +201,18 @@ namespace IW4MAdmin.Plugins.Stats.Cheat
// ban on headshot
if (currentHeadshotRatio > maxHeadshotLerpValueForBan)
{
Log.WriteDebug("**Maximum Headshot Ratio Reached For Ban**");
Log.WriteDebug($"ClientId: {hit.AttackerId}");
Log.WriteDebug($"**HitCount: {HitCount}");
Log.WriteDebug($"**Ratio {currentHeadshotRatio}");
Log.WriteDebug($"**MaxRatio {maxHeadshotLerpValueForFlag}");
var sb = new StringBuilder();
foreach (var kvp in HitLocationCount)
{
sb.Append($"HitLocation: {kvp.Key} -> {kvp.Value}\r\n");
}
//Log.WriteDebug("**Maximum Headshot Ratio Reached For Ban**");
//Log.WriteDebug($"ClientId: {hit.AttackerId}");
//Log.WriteDebug($"**HitCount: {HitCount}");
//Log.WriteDebug($"**Ratio {currentHeadshotRatio}");
//Log.WriteDebug($"**MaxRatio {maxHeadshotLerpValueForFlag}");
//var sb = new StringBuilder();
//foreach (var kvp in HitLocationCount)
//{
// sb.Append($"HitLocation: {kvp.Key} -> {kvp.Value}\r\n");
//}
Log.WriteDebug(sb.ToString());
//Log.WriteDebug(sb.ToString());
result = new DetectionPenaltyResult()
{
@ -225,18 +225,18 @@ namespace IW4MAdmin.Plugins.Stats.Cheat
}
else
{
Log.WriteDebug("**Maximum Headshot Ratio Reached For Flag**");
Log.WriteDebug($"ClientId: {hit.AttackerId}");
Log.WriteDebug($"**HitCount: {HitCount}");
Log.WriteDebug($"**Ratio {currentHeadshotRatio}");
Log.WriteDebug($"**MaxRatio {maxHeadshotLerpValueForFlag}");
var sb = new StringBuilder();
foreach (var kvp in HitLocationCount)
{
sb.Append($"HitLocation: {kvp.Key} -> {kvp.Value}\r\n");
}
//Log.WriteDebug("**Maximum Headshot Ratio Reached For Flag**");
//Log.WriteDebug($"ClientId: {hit.AttackerId}");
//Log.WriteDebug($"**HitCount: {HitCount}");
//Log.WriteDebug($"**Ratio {currentHeadshotRatio}");
//Log.WriteDebug($"**MaxRatio {maxHeadshotLerpValueForFlag}");
//var sb = new StringBuilder();
//foreach (var kvp in HitLocationCount)
//{
// sb.Append($"HitLocation: {kvp.Key} -> {kvp.Value}\r\n");
//}
Log.WriteDebug(sb.ToString());
//Log.WriteDebug(sb.ToString());
result = new DetectionPenaltyResult()
{

View File

@ -491,7 +491,7 @@ namespace IW4MAdmin.Plugins.Stats
/// <returns></returns>
private bool ShouldIgnoreEvent(EFClient origin, EFClient target)
{
return ((origin.ClientId <= 1 && target.ClientId <= 1) || (target.IsBot || origin.IsBot) && ServerManager.GetApplicationSettings().Configuration().IgnoreBots);
return ((origin.ClientId <= 1 && target.ClientId <= 1) || ((target.IsBot || origin.IsBot) && ServerManager.GetApplicationSettings().Configuration().IgnoreBots));
}
}
}