Ejemplo n.º 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);
        }
Ejemplo n.º 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);
            }
        }
Ejemplo n.º 3
0
 public EStopper(Main game)
     : base(game)
 {
     Order = 1;
     Config = new Config();
 }