Esempio n. 1
0
 public static bool MigrationExists(int id)
 {
     lock (MigrationLock)
     {
         return(MigrationQueue.ContainsKey(id));
     }
 }
Esempio n. 2
0
        private void AddOffence(OffenceType offence, OffenceValue value)
        {
            if (TotalOffenceValue() >= ServerConstants.MaxOffenceValue)
            {
                //Todo add ban/kick or whatever
                ServerConsole.Warning("Client found with high offence values: " + Enum.GetName(typeof(OffenceType), offence));
            }

            if (OffenceList.ContainsKey(offence))
            {
                OffenceList[offence] += (int)value;
            }
            else
            {
                OffenceList.Add(offence, (int)value);
            }
        }
Esempio n. 3
0
 public static bool AllowConnection(string Ip)
 {
     if (TempBanList.ContainsKey(Ip))
     {
         return(false);
     }
     if (ConnectionCount.ContainsKey(Ip))
     {
         ConnectionCount[Ip] = ConnectionCount[Ip] + 1;
         if (ConnectionCount[Ip] >= FLOOD_MAX)
         {
             ServerConsole.Warning("Detected a TCP flood on " + Ip);
             TempBanList.Add(Ip, true);
             return(false);
         }
     }
     else
     {
         ConnectionCount.Add(Ip, 1);
     }
     return(true);
 }
Esempio n. 4
0
 public static bool wincache_ucache_exists(ExpiringDictionary <string, object> _DictionaryTable, String key)
 {
     return(_DictionaryTable.ContainsKey(key));
 }
Esempio n. 5
0
 public static bool wincache_ucache_exists(String key)
 {
     return(DUserTables.ContainsKey(key));
 }