private static void reloadConfig(CommandArgs args) { var configPath = Path.Combine(TShock.SavePath, "CTGtoggle.json"); Config = CTGConfig.Read(configPath); args.Player.SendMessage("Config Reloaded!", Color.Green); }
public override void Initialize() { ServerApi.Hooks.GameUpdate.Register(this, OnUpdate); ServerApi.Hooks.NetGreetPlayer.Register(this, OnGreetPlayer); ServerApi.Hooks.NetSendBytes.Register(this, OnSendBytes); ServerApi.Hooks.NetGetData.Register(this, GetData); ServerApi.Hooks.GameInitialize.Register(this, OnInitialize); ServerApi.Hooks.ServerLeave.Register(this, OnLeave); ServerApi.Hooks.ServerChat.Register(this, OnChat); GetDataHandlers.InitGetDataHandler(); Config = new CTGConfig(); }
private static void SetUpConfig() { var configPath = Path.Combine(TShock.SavePath, "CTGtoggle.json"); (Config = CTGConfig.Read(configPath)).Write(configPath); }