Exemplo n.º 1
0
 public void autobc(CommandArgs args)
 {
     try
     {
         Config = ABConfig.Read(ConfigPath).Write(ConfigPath);
         args.Player.SendSuccessMessage("Successfully reloaded AutoBroadcast config!");
     }
     catch (Exception ex)
     {
         Config = new ABConfig();
         args.Player.SendWarningMessage("An exception occurred while parsing the AutoBroadcast config! check logs for more details!");
         Log.Error("[AutoBroadcast] An exception occurred while parsing tbe AutoBroadcast config!\n{0}".SFormat(ex.ToString()));
     }
 }
Exemplo n.º 2
0
 public void AutoBC(ReloadEventArgs args)
 {
     try
     {
         Config = ABConfig.Read(ConfigPath).Write(ConfigPath);
         TShock.Log.Info("Successfully reloaded AutoBroadcast config!");
     }
     catch (Exception ex)
     {
         Config = new ABConfig();
         args.Player.SendWarningMessage("An exception occurred while parsing the AutoBroadcast config! check logs for more details!");
         TShock.Log.ConsoleError("[AutoBroadcast] An exception occurred while parsing the AutoBroadcast config!\n{0}".SFormat(ex.ToString()));
     }
 }
Exemplo n.º 3
0
        public void OnInitialize(EventArgs args)
        {
            Commands.ChatCommands.Add(new Command("abroadcast", autobc, "autobc"));

            try
            {
                Config = ABConfig.Read(ConfigPath).Write(ConfigPath);
            }
            catch (Exception ex)
            {
                Config = new ABConfig();
                Log.ConsoleError("[AutoBroadcast] An exception occurred while parsing the AutoBroadcast config!\n{0}".SFormat(ex.ToString()));
            }
        }
Exemplo n.º 4
0
 public void OnInitialize(EventArgs args)
 {
     try
     {
         Config = ABConfig.Read(ConfigPath).Write(ConfigPath);
     }
     catch (Exception ex)
     {
         Config = new ABConfig();
         TShock.Log.ConsoleError("[AutoBroadcast] An exception occurred while parsing the AutoBroadcast config!\n{0}".SFormat(ex.ToString()));
     }
     Update.Elapsed += OnUpdate;
     Update.Start();
 }