Add g_humansplayers (found by server) and g_needpass (cvar) to serverinfo (#4702)

This commit is contained in:
Thilo Schulz 2011-03-07 23:12:16 +00:00
parent 97ed3650d7
commit 0a6f873999
4 changed files with 15 additions and 2 deletions

View file

@ -606,7 +606,7 @@ if a user is interested in a server to do a full status
================
*/
void SVC_Info( netadr_t from ) {
int i, count;
int i, count, humans;
char *gamedir;
char infostring[MAX_INFO_STRING];
@ -625,10 +625,13 @@ void SVC_Info( netadr_t from ) {
return;
// don't count privateclients
count = 0;
count = humans = 0;
for ( i = sv_privateClients->integer ; i < sv_maxclients->integer ; i++ ) {
if ( svs.clients[i].state >= CS_CONNECTED ) {
count++;
if (svs.clients[i].netchan.remoteAddress.type != NA_BOT) {
humans++;
}
}
}
@ -642,10 +645,12 @@ void SVC_Info( netadr_t from ) {
Info_SetValueForKey( infostring, "hostname", sv_hostname->string );
Info_SetValueForKey( infostring, "mapname", sv_mapname->string );
Info_SetValueForKey( infostring, "clients", va("%i", count) );
Info_SetValueForKey( infostring, "g_humanplayers", va("%i", humans ) );
Info_SetValueForKey( infostring, "sv_maxclients",
va("%i", sv_maxclients->integer - sv_privateClients->integer ) );
Info_SetValueForKey( infostring, "gametype", va("%i", sv_gametype->integer ) );
Info_SetValueForKey( infostring, "pure", va("%i", sv_pure->integer ) );
Info_SetValueForKey( infostring, "g_needpass", Cvar_VariableIntegerValue( "g_needpass" ));
#ifdef USE_VOIP
if (sv_voip->integer) {