public static void Log(BasePlayer ply, AntiHackType type, string message)
 {
     if (ConVar.AntiHack.debuglevel > 1)
     {
         AntiHack.LogToConsole(ply, type, message);
     }
     AntiHack.LogToEAC(ply, type, message);
 }
 public static void AddViolation(BasePlayer ply, AntiHackType type, float amount)
 {
     if (Interface.CallHook("OnPlayerViolation", ply, type, amount) != null)
     {
         return;
     }
     ply.lastViolationType = type;
     ply.lastViolationTime = UnityEngine.Time.realtimeSinceStartup;
     ply.violationLevel   += amount;
     if (ConVar.AntiHack.debuglevel >= 2 && amount > 0f || ConVar.AntiHack.debuglevel >= 3)
     {
         AntiHack.LogToConsole(ply, type, string.Concat(new object[] { "Added violation of ", amount, " in frame ", UnityEngine.Time.frameCount, " (now has ", ply.violationLevel, ")" }));
     }
     AntiHack.EnforceViolations(ply);
 }
Example #3
0
 public static void AddViolation(BasePlayer ply, AntiHackType type, float amount)
 {
     if (Interface.CallHook("OnPlayerViolation", (object)ply, (object)type, (object)amount) != null)
     {
         return;
     }
     ply.lastViolationType = type;
     ply.lastViolationTime = Time.get_realtimeSinceStartup();
     ply.violationLevel   += amount;
     if (ConVar.AntiHack.debuglevel >= 2 && (double)amount > 0.0 || ConVar.AntiHack.debuglevel >= 3)
     {
         AntiHack.LogToConsole(ply, type, "Added violation of " + (object)amount + " in frame " + (object)Time.get_frameCount() + " (now has " + (object)ply.violationLevel + ")");
     }
     AntiHack.EnforceViolations(ply);
 }
 public static void EnforceViolations(BasePlayer ply)
 {
     if (ConVar.AntiHack.enforcementlevel <= 0)
     {
         return;
     }
     if (ply.violationLevel > ConVar.AntiHack.maxviolation)
     {
         if (ConVar.AntiHack.debuglevel >= 1)
         {
             AntiHack.LogToConsole(ply, ply.lastViolationType, string.Concat("Enforcing (violation of ", ply.violationLevel, ")"));
         }
         string str = string.Concat(ply.lastViolationType, " Violation Level ", ply.violationLevel);
         if (ConVar.AntiHack.enforcementlevel > 1)
         {
             AntiHack.Kick(ply, str);
             return;
         }
         AntiHack.Kick(ply, str);
     }
 }
Example #5
0
    public static void EnforceViolations(BasePlayer ply)
    {
        if (ConVar.AntiHack.enforcementlevel <= 0 || (double)ply.violationLevel <= (double)ConVar.AntiHack.maxviolation)
        {
            return;
        }
        if (ConVar.AntiHack.debuglevel >= 1)
        {
            AntiHack.LogToConsole(ply, ply.lastViolationType, "Enforcing (violation of " + (object)ply.violationLevel + ")");
        }
        string reason = ((int)ply.lastViolationType).ToString() + " Violation Level " + (object)ply.violationLevel;

        if (ConVar.AntiHack.enforcementlevel > 1)
        {
            AntiHack.Kick(ply, reason);
        }
        else
        {
            AntiHack.Kick(ply, reason);
        }
    }