diff --git a/ReallifeGamemode.Server/Admin/AntiCheat.cs b/ReallifeGamemode.Server/Admin/AntiCheat.cs index 1feb42ae..16814f14 100644 --- a/ReallifeGamemode.Server/Admin/AntiCheat.cs +++ b/ReallifeGamemode.Server/Admin/AntiCheat.cs @@ -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(); + 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)