Exemple #1
0
        public static bool Prefix(PlyMovementSync __instance)
        {
            if (NetworkServer.active)
            {
                if (__instance._violationsS > 0)
                {
                    if (__instance._violationsS >= 20)
                    {
                        __instance.AntiCheatKillPlayer(
                            "Killed by the anti-cheat system for multiple violations\n(debug code: 2A - anti-noclip violations limit exceeded)");
                        __instance._resetS      = 0.0f;
                        __instance._resetL      = 0.0f;
                        __instance._violationsS = 0;
                        __instance._violationsL = 0;
                    }
                    else
                    {
                        __instance._resetS += Time.fixedUnscaledDeltaTime;
                        if (__instance._resetS > 2.0)
                        {
                            __instance._resetS      = 0.0f;
                            __instance._violationsS = 0;
                        }
                    }
                }

                if (__instance._violationsL > 0)
                {
                    if (__instance._violationsL >= 80)
                    {
                        __instance.AntiCheatKillPlayer(
                            "Killed by the anti-cheat system for multiple violations\n(debug code: 2B - anti-noclip violations limit exceeded)");
                        __instance._resetS      = 0.0f;
                        __instance._resetL      = 0.0f;
                        __instance._violationsS = 0;
                        __instance._violationsL = 0;
                    }
                    else
                    {
                        __instance._resetL += Time.fixedUnscaledDeltaTime;
                        if (__instance._resetL > 20.0)
                        {
                            __instance._resetL      = 0.0f;
                            __instance._violationsL = 0;
                        }
                    }
                }
            }

            return(false);
        }