From: havoc Date: Wed, 18 Apr 2007 07:51:11 +0000 (+0000) Subject: added reporting of number of bots in getinfo/getstatus replies (they are X-Git-Tag: xonotic-v0.1.0preview~3306 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=bf33577774c92000121c58fd30b4290609e0f03b;p=xonotic%2Fdarkplaces.git added reporting of number of bots in getinfo/getstatus replies (they are counted as clients also, so something parsing the info can deduct them if it wishes) git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@7124 d7cf8633-e32d-0410-b094-e92efae38249 --- diff --git a/netconn.c b/netconn.c index 833c50a5..0860c7ce 100755 --- a/netconn.c +++ b/netconn.c @@ -1731,24 +1731,30 @@ static void NetConn_BuildChallengeString(char *buffer, int bufferlength) static qboolean NetConn_BuildStatusResponse(const char* challenge, char* out_msg, size_t out_size, qboolean fullstatus) { - unsigned int nb_clients = 0, i; + unsigned int nb_clients = 0, nb_bots = 0, i; int length; // How many clients are there? for (i = 0;i < (unsigned int)svs.maxclients;i++) + { if (svs.clients[i].active) + { nb_clients++; + if (!svs.clients[i].netconnection) + nb_bots++; + } + } // TODO: we should add more information for the full status string length = dpsnprintf(out_msg, out_size, "\377\377\377\377%s\x0A" "\\gamename\\%s\\modname\\%s\\gameversion\\%d\\sv_maxclients\\%d" - "\\clients\\%d\\mapname\\%s\\hostname\\%s\\protocol\\%d" + "\\clients\\%d\\bots\\%d\\mapname\\%s\\hostname\\%s\\protocol\\%d" "%s%s" "%s", fullstatus ? "statusResponse" : "infoResponse", gamename, com_modname, gameversion.integer, svs.maxclients, - nb_clients, sv.name, hostname.string, NET_PROTOCOL_VERSION, + nb_clients, nb_bots, sv.name, hostname.string, NET_PROTOCOL_VERSION, challenge ? "\\challenge\\" : "", challenge ? challenge : "", fullstatus ? "\n" : "");