Exemple #1
0
 protected override void Unload()
 {
     BlacklistedIPs.Clear();
     U.Events.OnPlayerConnected -= OnPlayerConnected;
     Instance = null;
     base.Unload();
 }
Exemple #2
0
        protected override void Load()
        {
            base.Load();
            Instance = this;

            Logger.LogWarning("\n Loading SimpleIPBan, made by Mr.Kwabs...");
            if (!File.Exists("Plugins/SimpleIPBan/IPBlacklist.json"))
            {
                Logger.LogError("\n IPBlacklist.json does not exist, creating it now...");
                FirstLoad();
                Logger.LogWarning(" Successfully created IPBlacklist.json.");
            }

            SendList();
            Logger.LogWarning($"\n Found IPBlacklist.json, read {BlacklistedIPs.Count} IPs.");
            Logger.LogWarning("\n IP List: \n");
            foreach (string IP in BlacklistedIPs)
            {
                Logger.LogWarning($" {IP}");
            }



            if (Instance.Configuration.Instance.KickOnIPBan)
            {
                Logger.LogWarning("\n Kick on IP Ban: Enabled");
            }
            else
            {
                Logger.LogError("\n Kick on IP Ban: Disabled");
            }

            Logger.LogWarning($"\n Kick Reason: {Configuration.Instance.KickReason}");

            Logger.LogWarning("\n Successfully loaded SimpleIPBan, made by Mr.Kwabs!");


            U.Events.OnPlayerConnected += OnPlayerConnected;
        }