Exemplo n.º 1
0
 public static DSConfig Read(string file)
 {
     if (!File.Exists(file))
     {
         DSConfig.WriteExample(file);
     }
     return(JsonConvert.DeserializeObject <DSConfig>(File.ReadAllText(file)));
 }
Exemplo n.º 2
0
 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();
     }
 }
Exemplo n.º 3
0
 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();
     }
 }
Exemplo n.º 4
0
 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();
     }
 }
Exemplo n.º 5
0
 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();
     }
 }