mirror of
https://github.com/SantaSpeen/BeamMP-Server.git
synced 2026-04-03 18:16:01 +00:00
implement GetOSName, start working on HttpsPOST
This commit is contained in:
@@ -39,6 +39,7 @@ void THeartbeatThread::operator()() {
|
||||
if (status < 0) {
|
||||
status = 0;
|
||||
}
|
||||
|
||||
auto Lock = Sentry.CreateExclusiveContext();
|
||||
Sentry.SetContext("heartbeat",
|
||||
{ { "response-body", T },
|
||||
@@ -48,6 +49,7 @@ void THeartbeatThread::operator()() {
|
||||
Sentry.Log(SentryLevel::Error, "default", Http::Status::ToString(status) + " (" + std::to_string(status) + ")");
|
||||
};
|
||||
|
||||
|
||||
auto Target = "/heartbeat";
|
||||
int ResponseCode = -1;
|
||||
T = Http::POST(Application::GetBackendHostname(), Target, {}, Body, false, &ResponseCode);
|
||||
@@ -63,6 +65,7 @@ void THeartbeatThread::operator()() {
|
||||
T = Http::POST(Application::GetBackup2Hostname(), Target, {}, Body, false, &ResponseCode);
|
||||
if (T.substr(0, 2) != "20" || ResponseCode != 200) {
|
||||
warn("Backend system refused server! Server will not show in the public server list.");
|
||||
|
||||
isAuth = false;
|
||||
SentryReportError(Application::GetBackup2Hostname() + Target, ResponseCode);
|
||||
}
|
||||
@@ -127,4 +130,4 @@ std::string THeartbeatThread::GetPlayers() {
|
||||
return Return;
|
||||
}
|
||||
/*THeartbeatThread::~THeartbeatThread() {
|
||||
}*/
|
||||
}*/
|
||||
Reference in New Issue
Block a user