case SLIF_PROTOCOL:
mask->info.protocol = number;
break;
+ case SLIF_FREESLOTS:
+ mask->info.freeslots = number;
+ break;
default:
VM_Warning( "VM_M_setserverlistmasknumber: Bad field number %i passed!\n", field );
return;
case SLIF_NUMHUMANS:
PRVM_G_FLOAT( OFS_RETURN ) = cache->info.numhumans;
break;
+ case SLIF_FREESLOTS:
+ PRVM_G_FLOAT( OFS_RETURN ) = cache->info.freeslots;
+ break;
case SLIF_PING:
PRVM_G_FLOAT( OFS_RETURN ) = cache->info.ping;
break;
PRVM_G_FLOAT( OFS_RETURN ) = SLIF_NUMBOTS;
else if( !strcmp( key, "numhumans" ) )
PRVM_G_FLOAT( OFS_RETURN ) = SLIF_NUMHUMANS;
+ else if( !strcmp( key, "freeslots" ) )
+ PRVM_G_FLOAT( OFS_RETURN ) = SLIF_FREESLOTS;
else if( !strcmp( key, "protocol" ) )
PRVM_G_FLOAT( OFS_RETURN ) = SLIF_PROTOCOL;
else
case SLIF_NUMHUMANS:
result = A->info.numhumans - B->info.numhumans;
break;
+ case SLIF_FREESLOTS:
+ result = A->info.freeslots - B->info.freeslots;
+ break;
case SLIF_PROTOCOL:
result = A->info.protocol - B->info.protocol;
break;
return false;
if( !_ServerList_CompareInt( info->numhumans, mask->tests[SLIF_NUMHUMANS], mask->info.numhumans ) )
return false;
+ if( !_ServerList_CompareInt( info->freeslots, mask->tests[SLIF_FREESLOTS], mask->info.freeslots ) )
+ return false;
if( !_ServerList_CompareInt( info->protocol, mask->tests[SLIF_PROTOCOL], mask->info.protocol ))
return false;
if( *mask->info.cname
if ((s = SearchInfostring(string, "sv_maxclients")) != NULL) info->maxplayers = atoi(s);
if ((s = SearchInfostring(string, "gameversion" )) != NULL) info->gameversion = atoi(s);
info->numhumans = info->numplayers - max(0, info->numbots);
+ info->freeslots = info->maxplayers - info->numplayers;
NetConn_ClientParsePacket_ServerList_UpdateCache(n);
int numbots;
// number of currently connected players that are not bots
int numhumans;
+ // number of free slots
+ int freeslots;
// protocol version
int protocol;
// game data version
SLIF_PROTOCOL,
SLIF_NUMBOTS,
SLIF_NUMHUMANS,
- SLIF_COUNT
+ SLIF_COUNT,
+ SLIF_FREESLOTS
} serverlist_infofield_t;
typedef enum