engine: server: remove duplicate function

This commit is contained in:
Alibek Omarov 2022-11-16 23:37:26 +03:00
parent 76d0608ee1
commit dd881d3da9
3 changed files with 4 additions and 39 deletions

View File

@ -474,7 +474,6 @@ void SV_SendResource( resource_t *pResource, sizebuf_t *msg );
void SV_SendResourceList( sv_client_t *cl );
void SV_AddToMaster( netadr_t from, sizebuf_t *msg );
qboolean SV_ProcessUserAgent( netadr_t from, const char *useragent );
int SV_GetConnectedClientsCount( int *bots );
void Host_SetServerState( int state );
qboolean SV_IsSimulating( void );
void SV_FreeClients( void );
@ -551,6 +550,7 @@ void SV_InitClientMove( void );
void SV_UpdateServerInfo( void );
void SV_EndRedirect( void );
void SV_RejectConnection( netadr_t from, const char *fmt, ... ) _format( 2 );
void SV_GetPlayerCount( int *clients, int *bots );
//
// sv_cmds.c

View File

@ -48,7 +48,7 @@ SV_GetPlayerCount
=================
*/
static void SV_GetPlayerCount( int *players, int *bots )
void SV_GetPlayerCount( int *players, int *bots )
{
int i;

View File

@ -163,41 +163,6 @@ qboolean SV_HasActivePlayers( void )
return false;
}
/*
================
SV_GetConnectedClientsCount
returns connected clients count (and optionally bots count)
================
*/
int SV_GetConnectedClientsCount(int *bots)
{
int index;
int clients;
clients = 0;
if( svs.clients )
{
if( bots )
*bots = 0;
for( index = 0; index < svs.maxclients; index++ )
{
if( svs.clients[index].state >= cs_connected )
{
if( FBitSet( svs.clients[index].flags, FCL_FAKECLIENT ))
{
if( bots )
(*bots)++;
}
else
clients++;
}
}
}
return clients;
}
/*
===================
SV_UpdateMovevars
@ -777,7 +742,7 @@ void SV_AddToMaster( netadr_t from, sizebuf_t *msg )
{
uint challenge;
char s[MAX_INFO_STRING] = "0\n"; // skip 2 bytes of header
int clients = 0, bots = 0;
int clients, bots;
int len = sizeof( s );
if( !NET_IsMasterAdr( from ))
@ -786,7 +751,7 @@ void SV_AddToMaster( netadr_t from, sizebuf_t *msg )
return;
}
clients = SV_GetConnectedClientsCount( &bots );
SV_GetPlayerCount( &clients, &bots );
challenge = MSG_ReadUBitLong( msg, sizeof( uint ) << 3 );
Info_SetValueForKey( s, "protocol", va( "%d", PROTOCOL_VERSION ), len ); // protocol version