[Master] Fix REST servers/info

0.6.1
Koncord 8 years ago
parent bca594150c
commit 1f632d8bc9

@ -164,11 +164,11 @@ void RestServer::start()
httpServer.resource["/api/servers/info"]["GET"] = [this](auto response, auto /*request*/) { httpServer.resource["/api/servers/info"]["GET"] = [this](auto response, auto /*request*/) {
stringstream ss; stringstream ss;
ss << '{'; ss << '{';
ss << "servers: " << serverMap->size(); ss << "\"servers\": " << serverMap->size();
unsigned int players = 0; unsigned int players = 0;
for (auto s : *serverMap) for (auto s : *serverMap)
players += s.second.GetPlayers(); players += s.second.GetPlayers();
ss << ", players: " << players; ss << ", \"players\": " << players;
ss << "}"; ss << "}";
ResponseStr(*response, ss.str(), "application/json"); ResponseStr(*response, ss.str(), "application/json");

Loading…
Cancel
Save