public static bool MigrationExists(int id) { lock (MigrationLock) { return(MigrationQueue.ContainsKey(id)); } }
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); } }
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); }
public static bool wincache_ucache_exists(ExpiringDictionary <string, object> _DictionaryTable, String key) { return(_DictionaryTable.ContainsKey(key)); }
public static bool wincache_ucache_exists(String key) { return(DUserTables.ContainsKey(key)); }