Beispiel #1
0
 public static void ReloadConfig(CommandArgs args)
 {
     try
     {
         if (File.Exists(C3ConfigPath))
         {
             C3Mod.C3Config = C3ConfigFile.Read(C3ConfigPath);
             // Add all the missing config properties in the json file
         }
         C3Mod.C3Config.Write(C3ConfigPath);
         args.Player.SendSuccessMessage("C3Mod Config reloaded successfully!");
     }
     catch (Exception ex)
     {
         args.Player.SendSuccessMessage("C3Mod config file reload failed! Check logs for more details!");
         Log.Error(string.Concat("C3Mod Config Exception:\n", ex.ToString()));
     }
 }
Beispiel #2
0
 internal static void SetupConfig()
 {
     try
     {
         if (!File.Exists(C3ConfigPath))
         {
             C3Mod.C3Config.Write(C3ConfigPath);
             // Add all the missing config properties in the json file
         }
         C3Mod.C3Config = C3ConfigFile.Read(C3ConfigPath);
     }
     catch (Exception ex)
     {
         Console.ForegroundColor = ConsoleColor.Red;
         Console.WriteLine("Error in config file");
         Console.ForegroundColor = ConsoleColor.Gray;
         TShock.Log.Error("Config Exception");
         TShock.Log.Error(ex.ToString());
     }
 }
Beispiel #3
0
 public C3Mod(Main game)
     : base(game)
 {
     C3Config = new C3ConfigFile();
     Order    = -1;
 }
Beispiel #4
0
 public C3Mod(Main game)
     : base(game)
 {
     C3Config = new C3ConfigFile();
     Order = -1;
 }