mirror of
https://github.com/SWG-Source/src.git
synced 2026-08-01 01:16:03 -04:00
did i say simpler? i'm not sure if this is more or less simple...but it is secure and operates how we need... @apathy audit please?
This commit is contained in:
@@ -2871,8 +2871,8 @@ void CentralServer::sendMetricsToWebAPI(std::string updateURL)
|
||||
|
||||
postBuf << "totalPlayerCount=" << m_totalPlayerCount << "&totalGameServers=" << m_gameServers.size() - 1 << "&totalPlanetServers=" << m_planetServers.size() << "&isPublic=" << getIsClusterPublic() << "&isLocked=" << getIsClusterLocked() << "&isSecret=" << getIsClusterSecret() << "&preloadFinished=" << getClusterStartupTime() << "&databasebacklogged=" << isDatabaseBacklogged() << "&totalTutorialSceneCount=" << m_totalTutorialSceneCount << "&totalFalconSceneCount=" << m_totalFalconSceneCount;
|
||||
|
||||
std::string response = webAPI::simplePost(updateURL, std::string(postBuf.str()), "status", "message");
|
||||
WARNING((response != "success"), ("Error sending stats: %s", response.c_str()));
|
||||
webAPI::statusMessage response = webAPI::simplePost(updateURL, std::string(postBuf.str()), "status", "message", "status", "success");
|
||||
WARNING(response.status, ("Error sending stats: %s", response.message.c_str()));
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------
|
||||
|
||||
@@ -182,16 +182,16 @@ void ClientConnection::validateClient(const std::string & id, const std::string
|
||||
std::ostringstream postBuf;
|
||||
postBuf << "user_name=" << id << "&user_password=" << key << "&ip=" << getRemoteAddress();
|
||||
|
||||
const std::string response = webAPI::simplePost(authURL, std::string(postBuf.str()), "username", "message");
|
||||
const webAPI::statusMessage response = webAPI::simplePost(authURL, std::string(postBuf.str()), "username", "message", "status", "success");
|
||||
|
||||
if (!response.empty())
|
||||
if (response.status && !response.message.empty())
|
||||
{
|
||||
authOK = 1;
|
||||
uname = response;
|
||||
uname = response.message;
|
||||
}
|
||||
else
|
||||
{
|
||||
ErrorMessage err("Login Failed", response);
|
||||
ErrorMessage err("Login Failed", response.message);
|
||||
this->send(err, true);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user