diff --git a/HorseIsleData b/HorseIsleData
index 69e6a33..c872d4a 160000
--- a/HorseIsleData
+++ b/HorseIsleData
@@ -1 +1 @@
-Subproject commit 69e6a3393d1fe41986a92c489a43ea6d920786df
+Subproject commit c872d4a508e1514f302c6b3eac98c91db2d125d7
diff --git a/HorseIsleServer/LibHISP/Game/Meta.cs b/HorseIsleServer/LibHISP/Game/Meta.cs
index 7fade56..8907bd8 100644
--- a/HorseIsleServer/LibHISP/Game/Meta.cs
+++ b/HorseIsleServer/LibHISP/Game/Meta.cs
@@ -2559,17 +2559,15 @@ namespace HISP.Game
if (result.GotoChatpoint != -1)
chatpoint = Npc.GetNpcChatpoint(npc, result.GotoChatpoint);
- if (chatpoint.ChatText.Trim() == "")
- if (result.NpcChat != null)
- if(result.NpcChat.Trim() != "")
- chatpoint.ChatText = result.NpcChat;
+ if (result.NpcChat != null && result.NpcChat.Trim() != "")
+ chatpoint.ChatText = result.NpcChat;
}
else
{
if (result.GotoChatpoint != -1)
chatpoint = Npc.GetNpcChatpoint(npc, result.GotoChatpoint);
- if (result.NpcChat != null)
+ if (result.NpcChat != null && result.NpcChat.Trim() != "")
chatpoint.ChatText = result.NpcChat;
if (result.HideRepliesOnFail)
diff --git a/HorseIsleServer/LibHISP/Game/Quest.cs b/HorseIsleServer/LibHISP/Game/Quest.cs
index 66d8d7d..ba8bb24 100644
--- a/HorseIsleServer/LibHISP/Game/Quest.cs
+++ b/HorseIsleServer/LibHISP/Game/Quest.cs
@@ -219,7 +219,7 @@ namespace HISP.Game
res.QuestCompleted = true;
if (npcActivation)
{
- if (quest.SuccessNpcChat != null && quest.SuccessNpcChat != "")
+ if (quest.SuccessNpcChat != null && quest.SuccessNpcChat.Trim() != "")
res.NpcChat = quest.SuccessNpcChat;
if(quest.SetNpcChatpoint != -1)
@@ -241,7 +241,7 @@ namespace HISP.Game
user.LoggedinClient.SendPacket(ChatPacket);
}
- if (quest.SuccessNpcChat != null)
+ if (quest.SuccessNpcChat != null && quest.SuccessNpcChat.Trim() != "")
{
if (!npcActivation)
{
diff --git a/HorseIsleServer/LibHISP/LibHISP.csproj b/HorseIsleServer/LibHISP/LibHISP.csproj
index a1870c8..f4b5408 100644
--- a/HorseIsleServer/LibHISP/LibHISP.csproj
+++ b/HorseIsleServer/LibHISP/LibHISP.csproj
@@ -14,14 +14,16 @@
-
+
PreserveNewest
- gamedata.json
+ PreserveNewest
+ gamedata\%(Filename)%(Extension)
PreserveNewest
+ PreserveNewest
HI1.MAP
diff --git a/HorseIsleServer/LibHISP/Resources/server.properties b/HorseIsleServer/LibHISP/Resources/server.properties
index 58300b7..280ea5e 100644
--- a/HorseIsleServer/LibHISP/Resources/server.properties
+++ b/HorseIsleServer/LibHISP/Resources/server.properties
@@ -30,9 +30,10 @@ sql_lite=false
# the default was downloaded from the original server
map=HI1.MAP
-# This file contains all definitions in the game
+# This folder contains all definitions in the game
# such as items, horses. and quest data.
-gamedata=gamedata.json
+# NOTE: This can be a folder or a file.
+gamedata=gamedata
# =======================
# Security
diff --git a/HorseIsleServer/LibHISP/Server/ConfigReader.cs b/HorseIsleServer/LibHISP/Server/ConfigReader.cs
index 4756a8a..0c22bcb 100644
--- a/HorseIsleServer/LibHISP/Server/ConfigReader.cs
+++ b/HorseIsleServer/LibHISP/Server/ConfigReader.cs
@@ -18,7 +18,7 @@ namespace HISP.Server
public static int IntrestRate = 3333;
public static string Motd = "April 11, 2020. New breed, Camarillo White Horse. Two new quests.";
public static string MapFile = "HI1.MAP";
- public static string GameDataFile = "gamedata.json";
+ public static string GameData = "gamedata.json";
public static string CrossDomainPolicyFile = "CrossDomainPolicy.xml";
public static int LogLevel = 4;
@@ -92,7 +92,7 @@ namespace HISP.Server
Motd = data;
break;
case "gamedata":
- GameDataFile = data;
+ GameData = data;
break;
case "crossdomain":
CrossDomainPolicyFile = data;
diff --git a/HorseIsleServer/LibHISP/Server/GameDataJson.cs b/HorseIsleServer/LibHISP/Server/GameDataJson.cs
index 261515a..04aec38 100644
--- a/HorseIsleServer/LibHISP/Server/GameDataJson.cs
+++ b/HorseIsleServer/LibHISP/Server/GameDataJson.cs
@@ -12,21 +12,41 @@ using System.Globalization;
using HISP.Security;
using System;
using HISP.Game.Events;
-
+using System.Dynamic;
+using Newtonsoft.Json.Linq;
+
namespace HISP.Server
{
public class GameDataJson
{
-
public static void ReadGamedata()
{
- if (!File.Exists(ConfigReader.GameDataFile))
- {
- Logger.ErrorPrint("Game Data JSON File: " + ConfigReader.GameDataFile + " Does not exist!");
- throw new FileNotFoundException(ConfigReader.GameDataFile + " Not found :(");
+ dynamic gameData;
+ if (Directory.Exists(ConfigReader.GameData))
+ {
+ gameData = new JObject();
+ string[] files = Directory.GetFiles(ConfigReader.GameData);
+ foreach(string file in files)
+ {
+ string jsonData = File.ReadAllText(file);
+ JObject thisData = (JObject)JsonConvert.DeserializeObject(jsonData);
+ JObject jData = (JObject)gameData;
+ jData.Merge(thisData);
+
+ }
}
- string jsonData = File.ReadAllText(ConfigReader.GameDataFile);
- dynamic gameData = JsonConvert.DeserializeObject(jsonData);
+ else if (File.Exists(ConfigReader.GameData))
+ {
+ string jsonData = File.ReadAllText(ConfigReader.GameData);
+ gameData = JsonConvert.DeserializeObject(jsonData);
+ }
+ else
+ {
+ Logger.ErrorPrint("Game Data : " + ConfigReader.GameData + " Does not exist!");
+ GameServer.ShutdownServer();
+ return;
+ }
+
// Register Towns
int totalTowns = gameData.places.towns.Count;