Пример #1
0
        public override void OnDisabled()
        {
            if (Config.IsEnabledCustom)
            {
                UnregisterEvents();
            }

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

            handler = null;
            Log.Info($"{Name} has been disabled!");
        }
Пример #3
0
        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();
        }