public AFK(Main game) : base(game) { Order = 50; AFKConfig = new AFKConfigFile(); Players = new Player[256]; }
public static void SetupConfig() { try { if (File.Exists(AFKConfigPath)) { AFKConfig = AFKConfigFile.Read(AFKConfigPath); // Add all the missing config properties in the json file } AFKConfig.Write(AFKConfigPath); } catch (Exception ex) { Console.ForegroundColor = ConsoleColor.Red; Console.WriteLine("Error in AFK config file"); Console.ForegroundColor = ConsoleColor.Gray; TShock.Log.ConsoleError("AFK Config Exception"); TShock.Log.ConsoleError(ex.ToString()); } }