diff --git a/NorthstarDLL/masterserver/masterserver.cpp b/NorthstarDLL/masterserver/masterserver.cpp index 373018863..f0cfc6a4e 100644 --- a/NorthstarDLL/masterserver/masterserver.cpp +++ b/NorthstarDLL/masterserver/masterserver.cpp @@ -449,6 +449,7 @@ void MasterServerManager::AuthenticateWithOwnServer(const char* uid, const char* m_bAuthenticatingWithGameServer = true; m_bScriptAuthenticatingWithGameServer = true; m_bSuccessfullyAuthenticatedWithGameServer = false; + m_sAuthFailureReason = "Authentication Failed"; std::string uidStr(uid); std::string tokenStr(playerToken); @@ -497,7 +498,9 @@ void MasterServerManager::AuthenticateWithOwnServer(const char* uid, const char* spdlog::error("Failed reading masterserver response: got fastify error response"); spdlog::error(readBuffer); - if (authInfoJson["error"].HasMember("enum")) + if (authInfoJson["error"].HasMember("msg")) + m_sAuthFailureReason = authInfoJson["error"]["msg"].GetString(); + else if (authInfoJson["error"].HasMember("enum")) m_sAuthFailureReason = authInfoJson["error"]["enum"].GetString(); else m_sAuthFailureReason = "No error message provided"; @@ -581,6 +584,7 @@ void MasterServerManager::AuthenticateWithServer(const char* uid, const char* pl m_bAuthenticatingWithGameServer = true; m_bScriptAuthenticatingWithGameServer = true; m_bSuccessfullyAuthenticatedWithGameServer = false; + m_sAuthFailureReason = "Authentication Failed"; std::string uidStr(uid); std::string tokenStr(playerToken); @@ -650,7 +654,9 @@ void MasterServerManager::AuthenticateWithServer(const char* uid, const char* pl spdlog::error("Failed reading masterserver response: got fastify error response"); spdlog::error(readBuffer); - if (connectionInfoJson["error"].HasMember("enum")) + if (connectionInfoJson["error"].HasMember("msg")) + m_sAuthFailureReason = connectionInfoJson["error"]["msg"].GetString(); + else if (connectionInfoJson["error"].HasMember("enum")) m_sAuthFailureReason = connectionInfoJson["error"]["enum"].GetString(); else m_sAuthFailureReason = "No error message provided";