Esempio n. 1
0
        public override void OnEnabled()
        {
            Singleton = this;
            Timing.RunCoroutine(Methods.TickCounter(), Segment.Update, "ticks");
            MapEvents    = new MapEvents(this);
            ServerEvents = new ServerEvents(this);
            PlayerEvents = new PlayerEvents(this);

            Handlers.Map.Decontaminating    += MapEvents.OnDecon;
            Handlers.Map.GeneratorActivated += MapEvents.OnGenFinish;
            Handlers.Warhead.Starting       += MapEvents.OnWarheadStart;
            Handlers.Warhead.Stopping       += MapEvents.OnWarheadCancelled;
            Handlers.Warhead.Detonated      += MapEvents.OnWarheadDetonation;
            Handlers.Scp914.UpgradingItems  += MapEvents.OnScp194Upgrade;

            Handlers.Server.SendingRemoteAdminCommand += ServerEvents.OnCommand;
            Handlers.Server.WaitingForPlayers         += ServerEvents.OnWaitingForPlayers;
            Handlers.Server.SendingConsoleCommand     += ServerEvents.OnConsoleCommand;
            Handlers.Server.RoundStarted     += ServerEvents.OnRoundStart;
            Handlers.Server.RoundEnded       += ServerEvents.OnRoundEnd;
            Handlers.Server.RespawningTeam   += ServerEvents.OnRespawn;
            Handlers.Server.ReportingCheater += ServerEvents.OnCheaterReport;


            Handlers.Player.Banned  += PlayerEvents.OnPlayerBanned;
            Handlers.Player.Kicking += PlayerEvents.OnKicking;

            Handlers.Scp914.ChangingKnobSetting      += PlayerEvents.On914KnobChange;
            Handlers.Player.MedicalItemUsed          += PlayerEvents.OnMedicalItem;
            Handlers.Scp079.InteractingTesla         += PlayerEvents.On079Tesla;
            Handlers.Player.PickingUpItem            += PlayerEvents.OnPickupItem;
            Handlers.Player.InsertingGeneratorTablet += PlayerEvents.OnGenInsert;
            Handlers.Player.EjectingGeneratorTablet  += PlayerEvents.OnGenEject;
            Handlers.Player.UnlockingGenerator       += PlayerEvents.OnGenUnlock;
            Handlers.Player.OpeningGenerator         += PlayerEvents.OnGenOpen;
            Handlers.Player.ClosingGenerator         += PlayerEvents.OnGenClosed;
            Handlers.Scp079.GainingLevel             += PlayerEvents.On079GainLvl;
            Handlers.Scp079.GainingExperience        += PlayerEvents.On079GainExp;
            Handlers.Player.EscapingPocketDimension  += PlayerEvents.OnPocketEscape;
            Handlers.Player.EnteringPocketDimension  += PlayerEvents.OnPocketEnter;
            Handlers.Scp106.CreatingPortal           += PlayerEvents.On106CreatePortal;
            Handlers.Player.ActivatingWarheadPanel   += PlayerEvents.OnWarheadAccess;
            Handlers.Player.TriggeringTesla          += PlayerEvents.OnTriggerTesla;
            Handlers.Player.ThrowingGrenade          += PlayerEvents.OnGrenadeThrown;
            Handlers.Player.Hurting += PlayerEvents.OnPlayerHurt;
            Handlers.Player.Dying   += PlayerEvents.OnPlayerDeath;
            //Handlers.Player.InteractingDoor += PlayerEvents.OnDoorInteract;
            Handlers.Player.InteractingElevator += PlayerEvents.OnElevatorInteraction;
            Handlers.Player.InteractingLocker   += PlayerEvents.OnLockerInteraction;
            Handlers.Player.IntercomSpeaking    += PlayerEvents.OnIntercomSpeak;
            Handlers.Player.Handcuffing         += PlayerEvents.OnPlayerHandcuffed;
            Handlers.Player.RemovingHandcuffs   += PlayerEvents.OnPlayerFreed;
            Handlers.Scp106.Teleporting         += PlayerEvents.On106Teleport;
            Handlers.Player.ReloadingWeapon     += PlayerEvents.OnPlayerReload;
            Handlers.Player.ItemDropped         += PlayerEvents.OnDropItem;
            Handlers.Player.Verified            += PlayerEvents.OnPlayerVerified;
            Handlers.Player.Destroying          += PlayerEvents.OnPlayerDestroyed;
            Handlers.Player.ChangingRole        += PlayerEvents.OnSetClass;
            Handlers.Player.ChangingGroup       += PlayerEvents.OnSetGroup;
            Handlers.Player.ChangingItem        += PlayerEvents.OnItemChanged;
            Handlers.Scp914.Activating          += PlayerEvents.On914Activation;
            Handlers.Scp106.Containing          += PlayerEvents.On106Contain;

            LoadTranslation();

            new Thread(ProcessSTT.Init).Start();
            Timing.RunCoroutine(HandleQueue.Handle(), "handle");
            Timing.RunCoroutine(UpdateStatus(), "update");
            Timing.RunCoroutine(Methods.UpdateServerStatus(), "updatechan");
        }
Esempio n. 2
0
        public override void OnDisabled()
        {
            Handlers.Map.Decontaminating    -= MapEvents.OnDecon;
            Handlers.Map.GeneratorActivated -= MapEvents.OnGenFinish;
            Handlers.Warhead.Starting       -= MapEvents.OnWarheadStart;
            Handlers.Warhead.Stopping       -= MapEvents.OnWarheadCancelled;
            Handlers.Warhead.Detonated      -= MapEvents.OnWarheadDetonation;
            Handlers.Scp914.UpgradingItems  -= MapEvents.OnScp194Upgrade;

            Handlers.Server.SendingRemoteAdminCommand -= ServerEvents.OnCommand;
            Handlers.Server.WaitingForPlayers         -= ServerEvents.OnWaitingForPlayers;
            Handlers.Server.SendingConsoleCommand     -= ServerEvents.OnConsoleCommand;
            Handlers.Server.RoundStarted     -= ServerEvents.OnRoundStart;
            Handlers.Server.RoundEnded       -= ServerEvents.OnRoundEnd;
            Handlers.Server.RespawningTeam   -= ServerEvents.OnRespawn;
            Handlers.Server.ReportingCheater -= ServerEvents.OnCheaterReport;


            Handlers.Player.Banned  += PlayerEvents.OnPlayerBanned;
            Handlers.Player.Kicking += PlayerEvents.OnKicking;

            Handlers.Scp914.ChangingKnobSetting      -= PlayerEvents.On914KnobChange;
            Handlers.Player.UsingMedicalItem         -= PlayerEvents.OnMedicalItem;
            Handlers.Scp079.InteractingTesla         -= PlayerEvents.On079Tesla;
            Handlers.Player.PickingUpItem            -= PlayerEvents.OnPickupItem;
            Handlers.Player.InsertingGeneratorTablet -= PlayerEvents.OnGenInsert;
            Handlers.Player.EjectingGeneratorTablet  -= PlayerEvents.OnGenEject;
            Handlers.Player.UnlockingGenerator       -= PlayerEvents.OnGenUnlock;
            Handlers.Player.OpeningGenerator         -= PlayerEvents.OnGenOpen;
            Handlers.Player.ClosingGenerator         -= PlayerEvents.OnGenClosed;
            Handlers.Scp079.GainingLevel             -= PlayerEvents.On079GainLvl;
            Handlers.Scp079.GainingExperience        -= PlayerEvents.On079GainExp;
            Handlers.Player.EscapingPocketDimension  -= PlayerEvents.OnPocketEscape;
            Handlers.Player.EnteringPocketDimension  -= PlayerEvents.OnPocketEnter;
            Handlers.Scp106.CreatingPortal           -= PlayerEvents.On106CreatePortal;
            Handlers.Player.ActivatingWarheadPanel   -= PlayerEvents.OnWarheadAccess;
            Handlers.Player.TriggeringTesla          -= PlayerEvents.OnTriggerTesla;
            Handlers.Player.ThrowingGrenade          -= PlayerEvents.OnGrenadeThrown;
            Handlers.Player.Hurting -= PlayerEvents.OnPlayerHurt;
            Handlers.Player.Dying   -= PlayerEvents.OnPlayerDeath;
            //Handlers.Player.InteractingDoor -= PlayerEvents.OnDoorInteract;
            Handlers.Player.InteractingElevator -= PlayerEvents.OnElevatorInteraction;
            Handlers.Player.InteractingLocker   -= PlayerEvents.OnLockerInteraction;
            Handlers.Player.IntercomSpeaking    -= PlayerEvents.OnIntercomSpeak;
            Handlers.Player.Handcuffing         -= PlayerEvents.OnPlayerHandcuffed;
            Handlers.Player.RemovingHandcuffs   -= PlayerEvents.OnPlayerFreed;
            Handlers.Scp106.Teleporting         -= PlayerEvents.On106Teleport;
            Handlers.Player.ReloadingWeapon     -= PlayerEvents.OnPlayerReload;
            Handlers.Player.ItemDropped         -= PlayerEvents.OnDropItem;
            Handlers.Player.Verified            += PlayerEvents.OnPlayerVerified;
            Handlers.Player.Destroying          += PlayerEvents.OnPlayerDestroyed;
            Handlers.Player.ChangingRole        -= PlayerEvents.OnSetClass;
            Handlers.Player.ChangingGroup       -= PlayerEvents.OnSetGroup;
            Handlers.Player.ChangingItem        -= PlayerEvents.OnItemChanged;
            Handlers.Scp914.Activating          -= PlayerEvents.On914Activation;
            Handlers.Scp106.Containing          -= PlayerEvents.On106Contain;

            PlayerEvents = null;
            MapEvents    = null;
            ServerEvents = null;

            Timing.KillCoroutines("handle");
            Timing.KillCoroutines("update");
            Timing.KillCoroutines("updatechan");
            Timing.KillCoroutines("ticks");
        }