mirror of
https://github.com/BeamMP/BeamMP-Server.git
synced 2025-07-01 07:15:49 +00:00
Debug log responses from auth and backend (#403)
Logs the reponses from authentication and backend. --- By creating this pull request, I understand that code that is AI generated or otherwise automatically generated may be rejected without further discussion. I declare that I fully understand all code I pushed into this PR, and wrote all this code myself and own the rights to this code.
This commit is contained in:
commit
7dd6b41642
@ -67,11 +67,15 @@ void THeartbeatThread::operator()() {
|
||||
bool Ok = false;
|
||||
for (const auto& Url : Application::GetBackendUrlsInOrder()) {
|
||||
T = Http::POST(Url, 443, Target, Body, "application/json", &ResponseCode, { { "api-v", "2" } });
|
||||
|
||||
if (!Application::Settings.getAsBool(Settings::Key::General_Private)) {
|
||||
beammp_debug("Backend response was: `" + T + "`");
|
||||
}
|
||||
|
||||
Doc.Parse(T.data(), T.size());
|
||||
if (Doc.HasParseError() || !Doc.IsObject()) {
|
||||
if (!Application::Settings.getAsBool(Settings::Key::General_Private)) {
|
||||
beammp_trace("Backend response failed to parse as valid json");
|
||||
beammp_trace("Response was: `" + T + "`");
|
||||
}
|
||||
} else if (ResponseCode != 200) {
|
||||
beammp_errorf("Response code from the heartbeat: {}", ResponseCode);
|
||||
|
@ -354,6 +354,8 @@ std::shared_ptr<TClient> TNetwork::Authentication(TConnection&& RawConnection) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
beammp_debug("Response from authentication backend: " + AuthResStr);
|
||||
|
||||
try {
|
||||
nlohmann::json AuthRes = nlohmann::json::parse(AuthResStr);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user