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