Пример #1
0
        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);
        }
Пример #2
0
        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();
        }
Пример #3
0
        private static void SetUpConfig()
        {
            var configPath = Path.Combine(TShock.SavePath, "CTGtoggle.json");

            (Config = CTGConfig.Read(configPath)).Write(configPath);
        }