1
0
mirror of https://github.com/Mauler125/r5sdk.git synced 2025-02-09 19:15:03 +01:00

Add server response to pylon debug info for GetServer and PostServer ()

This commit is contained in:
Michael Poutre 2022-12-20 15:55:31 -08:00 committed by GitHub
parent 5f7436f8bd
commit 0077320bb7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -140,7 +140,16 @@ bool CPylon::GetServerByToken(NetGameServer_t& slOutServer, string& svOutMessage
if (pylon_showdebuginfo->GetBool())
{
DevMsg(eDLL_T::ENGINE, "%s - Comp-server replied with '%d'\n", __FUNCTION__, htResult->status);
DevMsg(eDLL_T::ENGINE, "%s - Comp-server replied with status: '%d'\n", __FUNCTION__, htResult->status);
try
{
string jsResultBody = nlohmann::json::parse(htResult->body).dump(4);
DevMsg(eDLL_T::ENGINE, "%s - Comp-Server response body:\n'%s'\n", __FUNCTION__, jsResultBody.c_str());
}
catch (const std::exception& ex)
{
DevMsg(eDLL_T::ENGINE, "%s - Encountered error parsing Comp-server response body: '%s'\n", __FUNCTION__, ex.what());
}
}
try
@ -263,7 +272,16 @@ bool CPylon::PostServerHost(string& svOutMessage, string& svOutToken, const NetG
if (htResult && pylon_showdebuginfo->GetBool())
{
DevMsg(eDLL_T::ENGINE, "%s - Comp-server replied with '%d'\n", __FUNCTION__, htResult->status);
DevMsg(eDLL_T::ENGINE, "%s - Comp-server replied with status: '%d'\n", __FUNCTION__, htResult->status);
try
{
string jsResultBody = nlohmann::json::parse(htResult->body).dump(4);
DevMsg(eDLL_T::ENGINE, "%s - Comp-Server response body:\n'%s'\n", __FUNCTION__, jsResultBody.c_str());
}
catch (const std::exception& ex)
{
DevMsg(eDLL_T::ENGINE, "%s - Encountered error parsing Comp-server response body: '%s'\n", __FUNCTION__, ex.what());
}
}
try