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