예제 #1
0
        public override void Initialize()
        {
            ServerApi.Hooks.GameInitialize.Register(this, OnInitialize);
            ServerApi.Hooks.GameUpdate.Register(this, OnUpdate);

            var configPath = Path.Combine(TShock.SavePath, "EventStop.json");
            if (!File.Exists(configPath))
            {
                Config.Write(configPath);
            }
            Config = Config.Read(configPath);
        }
예제 #2
0
        private void OnReload(ReloadEventArgs e)
        {
            try
            {
                var configPath = Path.Combine(TShock.SavePath, "EventStop.json");
                if (!File.Exists(configPath))
                {
                    Config.Write(configPath);
                }
                Config = Config.Read(configPath);

                e.Player.SendSuccessMessage("Reloaded event stopper plugin's configuration");
            }
            catch (Exception x)
            {
                TShock.Log.ConsoleError("Error occured on reloading event stopper plugin's configuration");
                TShock.Log.ConsoleError(x.ToString());
                e.Player.SendErrorMessage("Error occured on reloading event stopper plugin's configuration");
                e.Player.SendErrorMessage(x.Message);
            }
        }
예제 #3
0
 public EStopper(Main game)
     : base(game)
 {
     Order = 1;
     Config = new Config();
 }