Esempio n. 1
0
        private void SCReload(CommandArgs args)
        {
            var savePath = Path.Combine(TShock.SavePath, "SignCMD");

            if (!Directory.Exists(savePath))
            {
                Directory.CreateDirectory(savePath);
            }
            var configPath = Path.Combine(savePath, "SC_Config.json");

            (config = ScConfig.Read(configPath)).Write(configPath);

            args.Player.SendSuccessMessage("[SC] Config Reloaded.");
        }
Esempio n. 2
0
        private void OnInitialize(EventArgs args)
        {
            Commands.ChatCommands.Add(new Command("sc.remove", RemoveSign, "rmsign", "rms"));
            Commands.ChatCommands.Add(new Command("sc.reload", SCReload, "scload", "scl"));

            var savePath = Path.Combine(TShock.SavePath, "SignCMD");

            if (!Directory.Exists(savePath))
            {
                Directory.CreateDirectory(savePath);
            }
            var configPath = Path.Combine(savePath, "SC_Config.json");

            (config = ScConfig.Read(configPath)).Write(configPath);

            _updateTimer.Elapsed += UpdateTimerOnElapsed;
        }