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); }
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); } }