add some debug print

This commit is contained in:
Li 2022-07-17 22:34:26 +12:00
parent 81589ed20a
commit 6a34745a5f

View file

@ -22,12 +22,15 @@ namespace HISP.Server
public static void ReadGamedata() public static void ReadGamedata()
{ {
dynamic gameData; dynamic gameData;
Logger.DebugPrint("Reading GAMEDATA");
if (Directory.Exists(ConfigReader.GameData)) if (Directory.Exists(ConfigReader.GameData))
{ {
Logger.DebugPrint("Found GAMEDATA DIR ... ");
gameData = new JObject(); gameData = new JObject();
string[] files = Directory.GetFiles(ConfigReader.GameData); string[] files = Directory.GetFiles(ConfigReader.GameData);
foreach(string file in files) foreach(string file in files)
{ {
Logger.DebugPrint("Reading: "+file);
string jsonData = File.ReadAllText(file); string jsonData = File.ReadAllText(file);
JObject thisData = (JObject)JsonConvert.DeserializeObject(jsonData); JObject thisData = (JObject)JsonConvert.DeserializeObject(jsonData);
JObject jData = (JObject)gameData; JObject jData = (JObject)gameData;
@ -37,12 +40,14 @@ namespace HISP.Server
} }
else if (File.Exists(ConfigReader.GameData)) else if (File.Exists(ConfigReader.GameData))
{ {
Logger.DebugPrint("Found GAMEDATA FILE ... ");
string jsonData = File.ReadAllText(ConfigReader.GameData); string jsonData = File.ReadAllText(ConfigReader.GameData);
gameData = JsonConvert.DeserializeObject(jsonData); gameData = JsonConvert.DeserializeObject(jsonData);
} }
else else
{ {
Logger.ErrorPrint("Game Data : " + ConfigReader.GameData + " Does not exist!"); Logger.ErrorPrint("Could not find GAMEDATA, configured as; " + ConfigReader.GameData + " But no file or directory exists!");
GameServer.ShutdownServer(); GameServer.ShutdownServer();
return; return;
} }