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)); }
private static bool IsReal(Warning player) { return(player != null);// && Globals.Warnings.IndexOf(player) >= 0; }
public static DateTime GetTime(Warning player) { return(IsReal(player) ? player.Date : DateTime.MinValue); }
public static Int16 GetLevel(Warning player) { return(IsReal(player) ? player.Level : (short)0); }
public static Int16 GetKeyErrors(Warning player) { return(IsReal(player) ? player.keyerrors : (short)0); }
public bool Contains(Warning player) { return(null != IndexOfObject(player));// != null; }
public void AddClientWatch(Int32 c, Warning player) { lock (_lock) Addresses.Add(new Pair <Int32, Warning>(c, player)); }