コード例 #1
0
ファイル: DSConfig.cs プロジェクト: moisterrific/DelayedStop
 public static DSConfig Read(string file)
 {
     if (!File.Exists(file))
     {
         DSConfig.WriteExample(file);
     }
     return(JsonConvert.DeserializeObject <DSConfig>(File.ReadAllText(file)));
 }
コード例 #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();
     }
 }
コード例 #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();
     }
 }
コード例 #4
0
ファイル: DelayedStop.cs プロジェクト: Scavenger3/DelayedStop
 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();
     }
 }
コード例 #5
0
ファイル: DelayedStop.cs プロジェクト: Scavenger3/DelayedStop
 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();
     }
 }