private void ClientWarningExpireWatcher() { Thread.Sleep(3600000); // 1 Hour foreach (Pair <Int32, Warning> item in Globals.Shield.GetList()) { if (Globals.Shield.IsBlocked(item.Second)) { if (DateTime.Compare(Warning.GetTime(item.Second).AddHours(10), DateTime.Now) > 0) { Globals.Shield.UnBlock(item.Second); } } } Functions.FixLag(); }
public static bool IsVaildProcess(Clientplayer x) { if (Warning.GetLevel(x.clientwarns) > 10) { if (DateTime.Compare(Warning.GetTime(x.clientwarns).AddSeconds(2), DateTime.Now) > 0) { Globals.Shield.Block(GetRemoteEndPointInt(x), x.clientwarns); Disconnect(x, "Illegal Packet delays"); return(false); } else { Warning.Reset(x.clientwarns); // prevent overrun } } else if (Warning.GetKeyErrors(x.clientwarns) > 2) { Globals.Shield.Block(GetRemoteEndPointInt(x), x.clientwarns); Disconnect(x, "Client Key Error!"); return(false); } return(IsAlive(x)); }