This commit is contained in:
hydrant
2021-06-02 00:22:05 +02:00
parent 637ac0bd43
commit c102323380

View File

@@ -3,7 +3,9 @@ using System.Collections.Generic;
using System.Linq;
using System.Text;
using GTANetworkAPI;
using Microsoft.Extensions.Logging;
using ReallifeGamemode.Server.Extensions;
using ReallifeGamemode.Server.Log;
using ReallifeGamemode.Server.Managers;
using ReallifeGamemode.Server.Services;
using ReallifeGamemode.Server.Types;
@@ -12,6 +14,8 @@ namespace ReallifeGamemode.Server.Admin
{
public class AntiCheat : Script
{
private static readonly ILogger logger = LogManager.GetLogger<AntiCheat>();
private static TimeSpan antiCheatMessageCooldown = new TimeSpan(0, 0, 30);
private static Dictionary<(string, string), DateTime> lastAntiCheatBroadcastTime = new Dictionary<(string, string), DateTime>();
@@ -29,7 +33,7 @@ namespace ReallifeGamemode.Server.Admin
return;
}
if(cheater.IsAdminDuty())
if (cheater.IsAdminDuty())
{
return;
}
@@ -41,6 +45,7 @@ namespace ReallifeGamemode.Server.Admin
}
lastAntiCheatBroadcastTime[(cheater.Name, cheat)] = DateTime.Now;
ChatService.BroadcastAdmin($"~r~[ANTICHEAT]~s~ Verdacht auf ~y~{cheat}~s~ bei ~y~{cheater.Name}~s~ (~y~{cheater.Handle.Value}~s~)", AdminLevel.ADMIN);
logger.LogWarning("Player {0} triggered an anticheat message: {1}", cheater.Name, cheat);
}
internal static void NoTpAntiCheatForPlayer(string name)