public override void OnDisabled() { ServerEvent.WaitingForPlayers -= handler.OnWaitingForPlayers; PlayerEvent.Verified -= handler.OnVerified; PlayerEvent.Dying -= handler.OnDying; PlayerEvent.Died -= handler.OnDied; MapEvent.PlacingBlood -= handler.OnPlacingBlood; PlayerEvent.SpawningRagdoll -= handler.OnSpawningRagdoll; PlayerEvent.IntercomSpeaking -= handler.OnIntercom; PlayerEvent.DroppingItem -= handler.OnDroppingItem; PlayerEvent.DroppingAmmo -= handler.OnDroppingAmmo; PlayerEvent.InteractingDoor -= handler.OnInteractingDoor; PlayerEvent.InteractingElevator -= handler.OnInteractingElevator; PlayerEvent.InteractingLocker -= handler.OnInteractingLocker; MapEvent.ChangingIntoGrenade -= handler.OnChangingIntoGrenade; Scp106Event.CreatingPortal -= handler.OnCreatingPortal; Scp106Event.Teleporting -= handler.OnTeleporting; ServerEvent.RoundStarted -= handler.OnRoundStarted; handler = null; Singleton = null; base.OnDisabled(); }
public override void OnEnabled() { Singleton = this; harmony = new Harmony($"michal78900.wacr-{DateTime.Now.Ticks}"); harmony.PatchAll(); handler = new Handler(); ServerEvent.WaitingForPlayers += handler.OnWaitingForPlayers; PlayerEvent.Verified += handler.OnVerified; PlayerEvent.Dying += handler.OnDying; PlayerEvent.Died += handler.OnDied; MapEvent.PlacingBlood += handler.OnPlacingBlood; PlayerEvent.SpawningRagdoll += handler.OnSpawningRagdoll; PlayerEvent.IntercomSpeaking += handler.OnIntercom; PlayerEvent.DroppingItem += handler.OnDroppingItem; PlayerEvent.DroppingAmmo += handler.OnDroppingAmmo; PlayerEvent.InteractingDoor += handler.OnInteractingDoor; PlayerEvent.InteractingElevator += handler.OnInteractingElevator; PlayerEvent.InteractingLocker += handler.OnInteractingLocker; MapEvent.ChangingIntoGrenade += handler.OnChangingIntoGrenade; Scp106Event.CreatingPortal += handler.OnCreatingPortal; Scp106Event.Teleporting += handler.OnTeleporting; ServerEvent.RoundStarted += handler.OnRoundStarted; base.OnEnabled(); }