public static DSConfig Read(string file) { if (!File.Exists(file)) { DSConfig.WriteExample(file); } return(JsonConvert.DeserializeObject <DSConfig>(File.ReadAllText(file))); }
public void LoadConfig() { try { Config = DSConfig.Read(ConfigPath).Write(ConfigPath); ParseNotifyIntervals(); } catch (Exception ex) { TShock.Log.ConsoleError("[Delayed Stop] An exception occoured while parsing the config, check the logs for more details!"); TShock.Log.Error(ex.ToString()); Config = new DSConfig(); } }
public void ReloadConfig(CommandArgs args) { try { Config = DSConfig.Read(ConfigPath).Write(ConfigPath); ParseNotifyIntervals(); args.Player.SendSuccessMessage("Reloaded DelayedStop Config!"); } catch (Exception ex) { args.Player.SendErrorMessage("[Delayed Stop] An exception occoured while parsing the config, check the logs for more details!"); TShock.Log.Error("[Delayed Stop] An exception occoured while parsing the config, check the logs for more details!\n" + ex.ToString()); Config = new DSConfig(); } }
public void ReloadConfig(CommandArgs args) { try { Config = DSConfig.Read(ConfigPath).Write(ConfigPath); ParseNotifyIntervals(); args.Player.SendSuccessMessage("Reloaded DelayedStop Config!"); } catch (Exception ex) { args.Player.SendErrorMessage("[Delayed Stop] An exception occoured while parsing the config, check the logs for more details!"); Log.Error("[Delayed Stop] An exception occoured while parsing the config, check the logs for more details!\n" + ex.ToString()); Config = new DSConfig(); } }
public void LoadConfig() { try { Config = DSConfig.Read(ConfigPath).Write(ConfigPath); ParseNotifyIntervals(); } catch (Exception ex) { Log.ConsoleError("[Delayed Stop] An exception occoured while parsing the config, check the logs for more details!"); Log.Error(ex.ToString()); Config = new DSConfig(); } }