using System; using System.Collections.Generic; using System.Linq; using System.Text; using Holo.Managers; namespace Holo.Source.Socket_servers.Game_Socketsystem { public class SecurityManagement { private static List mBannedAddresses; private static string mLastBannedAddress; internal static void Init() { mBannedAddresses = new List(); mLastBannedAddress = ""; } internal static bool ConnectionBanned(string pIP) { if (mLastBannedAddress == pIP) //Connection banned return true; else if (mBannedAddresses.Contains(pIP)) //Connection banned { mLastBannedAddress = pIP; return true; } else if (userManager.getBanReason(pIP).Length > 0) //Connection banned { mBannedAddresses.Add(pIP); mLastBannedAddress = pIP; return true; } else //Connection allowed return false; } internal static void BanAddress(string IP) { mBannedAddresses.Add(IP); mLastBannedAddress = IP; } } }