public override void OnDisabled()
        {
            if (Config.IsEnabledCustom)
            {
                UnregisterEvents();
            }

            handler = null;
            Log.Info($"{Name} has been disabled!");
            base.OnDisabled();
        }
Beispiel #2
0
        public override void OnDisabled()
        {
            Server.SendingRemoteAdminCommand -= handler.OnCommand;
            if (Config.IsEnabledCustom)
            {
                UnregisterEvents();
            }

            handler = null;
            Log.Info($"{Name} has been disabled!");
        }
        public override void OnEnabled()
        {
            Instance = this;
            handler  = new EventsHandler(this);

            if (Config.IsEnabledCustom)
            {
                RegisterEvents();
            }

            Timing.CallDelayed(1f, () => {
                try {
                    Config.roleBlacklist = Config.BlacklistedRoles();
                    Config.specialRoles  = Config.SpecialRoles();
                } catch (Exception e) {
                    Log.Error("Exception caused while loading Blacklisted/Special roles: " + e.Message + " - " + e.StackTrace);
                }
            });

            Log.Info($"{Name} has been enabled!");
            base.OnEnabled();
        }