From 5fc9a0e689d09005050d1032839a9f6a7aacfa7e Mon Sep 17 00:00:00 2001 From: DarthArgus Date: Sun, 24 Apr 2016 18:14:31 +0000 Subject: [PATCH] TEMP FIX HACK TODO - for whatever reason spaced strings seem to return as arrays when using the json parser's .get function --- .../application/LoginServer/src/shared/ClientConnection.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/engine/server/application/LoginServer/src/shared/ClientConnection.cpp b/engine/server/application/LoginServer/src/shared/ClientConnection.cpp index f9d8be62..c6610318 100755 --- a/engine/server/application/LoginServer/src/shared/ClientConnection.cpp +++ b/engine/server/application/LoginServer/src/shared/ClientConnection.cpp @@ -231,7 +231,11 @@ void ClientConnection::validateClient(const std::string & id, const std::string if (j.count("message")) { - errMsg = j["message"].get(); + // fuuuu hack here - .get() is returning an array and not a string, wtf? + errMsg = j["message"].dump(); + errMsg.erase(std::remove(errMsg.begin(), errMsg.end(), '"'), errMsg.end()); + errMsg.erase(std::remove(errMsg.begin(), errMsg.end(), ']'), errMsg.end()); + errMsg.erase(std::remove(errMsg.begin(), errMsg.end(), '['), errMsg.end()); } else {