예제 #1
0
        public override void OnEnabled()
        {
            Singleton = this;

            handler = new Handler();

            ServerEvent.WaitingForPlayers += handler.OnWaitingForPlayers;
            ServerEvent.RoundStarted      += handler.OnRoundStart;

            PlayerEvent.Destroying     += handler.OnDestroy;
            Scp079Event.TriggeringDoor += handler.OnDoor;
            PlayerEvent.PickingUpItem  += handler.OnItemPickup;
            PlayerEvent.DroppingItem   += handler.OnItemDrop;
            PlayerEvent.Hurting        += handler.OnHurting;

            MapEvent.AnnouncingScpTermination += handler.OnAnnouncingScpTermination;

            GhostSpectator = Loader.Plugins.FirstOrDefault(x => x.Name == "GhostSpectator")?.Assembly;

            if (GhostSpectator != null)
            {
                Log.Debug("GhostSpectator plugin detected!", Config.Debug);
            }

            base.OnEnabled();
        }
예제 #2
0
        public override void OnDisabled()
        {
            ServerEvent.WaitingForPlayers -= handler.OnWaitingForPlayers;
            ServerEvent.RoundStarted      -= handler.OnRoundStart;

            PlayerEvent.Destroying     -= handler.OnDestroy;
            Scp079Event.TriggeringDoor -= handler.OnDoor;
            PlayerEvent.PickingUpItem  -= handler.OnItemPickup;
            PlayerEvent.DroppingItem   -= handler.OnItemDrop;
            PlayerEvent.Hurting        -= handler.OnHurting;

            MapEvent.AnnouncingScpTermination -= handler.OnAnnouncingScpTermination;

            handler   = null;
            Singleton = null;

            base.OnDisabled();
        }