Exemplo n.º 1
0
        protected override void Dispose(bool disposing)
        {
            if (disposing)
            {
                ServerApi.Hooks.NetGetData.Deregister(this, GetData);
                ServerApi.Hooks.ServerJoin.Deregister(this, OnJoin);

                PlayerHooks.PlayerPostLogin -= OnPlayerPostLogin;

                GetDataHandlers.NewProjectile -= OnNewProjectile;

                pvpHandler.Unsubscribe();

                config.Write(Config.configPath);
            }
            base.Dispose(disposing);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Disposes timers, deregisters hooks, and writes all changes of config to .json
        /// </summary>
        protected override void Dispose(bool disposing)
        {
            if (disposing)
            {
                ServerApi.Hooks.GamePostInitialize.Deregister(this, OnGamePostInitialize);
                ServerApi.Hooks.NetGetData.Deregister(this, GetData);
                ServerApi.Hooks.ServerJoin.Deregister(this, OnJoin);

                PlayerHooks.PlayerPostLogin -= OnPlayerPostLogin;

                PvPTimer.Dispose();

                PvPHandler.Unsubscribe();

                PvPTimer.Elapsed -= PvPTimerElapsed;

                Config.Write(Config.ConfigPath);
            }
            base.Dispose(disposing);
        }