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

@ -3382,6 +3382,8 @@ static void CL_SetServerInfo(serverInfo_t *server, const char *info, int ping) {
server->minPing = atoi(Info_ValueForKey(info, "minping"));
server->maxPing = atoi(Info_ValueForKey(info, "maxping"));
server->punkbuster = atoi(Info_ValueForKey(info, "punkbuster"));
server->g_humanplayers = atoi(Info_ValueForKey(info, "g_humanplayers"));
server->g_needpass = atoi(Info_ValueForKey(info, "g_needpass"));
}
server->ping = ping;
}
@ -3500,6 +3502,8 @@ void CL_ServerInfoPacket( netadr_t from, msg_t *msg ) {
cls.localServers[i].gameType = 0;
cls.localServers[i].netType = from.type;
cls.localServers[i].punkbuster = 0;
cls.localServers[i].g_humanplayers = 0;
cls.localServers[i].g_needpass = 0;
Q_strncpyz( info, MSG_ReadString( msg ), MAX_INFO_STRING );
if (strlen(info)) {

View file

@ -298,6 +298,8 @@ static void LAN_GetServerInfo( int source, int n, char *buf, int buflen ) {
Info_SetValueForKey( info, "nettype", va("%i",server->netType));
Info_SetValueForKey( info, "addr", NET_AdrToStringwPort(server->adr));
Info_SetValueForKey( info, "punkbuster", va("%i", server->punkbuster));
Info_SetValueForKey( info, "g_needpass", va("%i", server->g_needpass));
Info_SetValueForKey( info, "g_humanplayers", va("%i", server->g_humanplayers));
Q_strncpyz(buf, info, buflen);
} else {
if (buf) {

View file

@ -296,6 +296,8 @@ typedef struct {
int ping;
qboolean visible;
int punkbuster;
int g_humanplayers;
int g_needpass;
} serverInfo_t;
typedef struct {