1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00:00

Masterserver: report gameid, uptime, cosmetic fixes on server web page

This commit is contained in:
proller 2013-03-30 02:03:24 +04:00
parent df49b93877
commit 16c11eb4a3
5 changed files with 29 additions and 21 deletions

View file

@ -232,7 +232,7 @@ static size_t ServerAnnounceCallback(void *contents, size_t size, size_t nmemb,
//((std::string*)userp)->append((char*)contents, size * nmemb);
//return size * nmemb;
}
void sendAnnounce(std::string action, u16 clients) {
void sendAnnounce(std::string action, u16 clients, double uptime, std::string gameid) {
Json::Value server;
if (action.size())
server["action"] = action;
@ -250,6 +250,9 @@ void sendAnnounce(std::string action, u16 clients) {
server["pvp"] = g_settings->getBool("enable_pvp");
server["clients"] = clients;
server["clients_max"] = g_settings->get("max_users");
if (uptime >=1) server["uptime"] = (int)uptime;
if (gameid!="") server["gameid"] = gameid;
}
if(server["action"] == "start")
actionstream << "announcing to " << g_settings->get("serverlist_url") << std::endl;