2
0
mirror of https://github.com/FWGS/xash3d-fwgs synced 2024-11-22 01:45:19 +01:00

engine: server: make SV_IsPlayerIndex and SV_HavePassword inline

This commit is contained in:
Alibek Omarov 2024-11-17 13:36:40 +03:00
parent 046b1da8a8
commit c5471fe6fd
2 changed files with 13 additions and 29 deletions

View File

@ -542,13 +542,24 @@ void SV_ExecuteClientMessage( sv_client_t *cl, sizebuf_t *msg );
void SV_ConnectionlessPacket( netadr_t from, sizebuf_t *msg ); void SV_ConnectionlessPacket( netadr_t from, sizebuf_t *msg );
edict_t *SV_FakeConnect( const char *netname ); edict_t *SV_FakeConnect( const char *netname );
void SV_BuildReconnect( sizebuf_t *msg ); void SV_BuildReconnect( sizebuf_t *msg );
qboolean SV_IsPlayerIndex( int idx );
int SV_CalcPing( sv_client_t *cl ); int SV_CalcPing( sv_client_t *cl );
void SV_UpdateServerInfo( void ); void SV_UpdateServerInfo( void );
void SV_EndRedirect( host_redirect_t *rd ); void SV_EndRedirect( host_redirect_t *rd );
void SV_RejectConnection( netadr_t from, const char *fmt, ... ) FORMAT_CHECK( 2 ); void SV_RejectConnection( netadr_t from, const char *fmt, ... ) FORMAT_CHECK( 2 );
void SV_GetPlayerCount( int *clients, int *bots ); void SV_GetPlayerCount( int *clients, int *bots );
qboolean SV_HavePassword( void );
static inline qboolean SV_HavePassword( void )
{
if( COM_CheckStringEmpty( sv_password.string ) && Q_stricmp( sv_password.string, "none" ))
return true;
return false;
}
static inline qboolean SV_IsPlayerIndex( int idx )
{
return idx > 0 && idx <= svs.maxclients ? true : false;
}
// //
// sv_cmds.c // sv_cmds.c

View File

@ -46,20 +46,6 @@ static int g_userid = 1;
static void SV_UserinfoChanged( sv_client_t *cl ); static void SV_UserinfoChanged( sv_client_t *cl );
static void SV_ExecuteClientCommand( sv_client_t *cl, const char *s ); static void SV_ExecuteClientCommand( sv_client_t *cl, const char *s );
/*
=================
SV_HavePassword
=================
*/
qboolean SV_HavePassword( void )
{
if( COM_CheckStringEmpty( sv_password.string ) && Q_stricmp( sv_password.string, "none" ))
return true;
return false;
}
/* /*
================= =================
SV_GetPlayerCount SV_GetPlayerCount
@ -1373,19 +1359,6 @@ qboolean SV_ShouldUpdatePing( sv_client_t *cl )
return FBitSet( cl->lastcmd.buttons, IN_SCORE ) ? true : false; return FBitSet( cl->lastcmd.buttons, IN_SCORE ) ? true : false;
} }
/*
===================
SV_IsPlayerIndex
===================
*/
qboolean SV_IsPlayerIndex( int idx )
{
if( idx > 0 && idx <= svs.maxclients )
return true;
return false;
}
/* /*
=================== ===================
SV_GetPlayerStats SV_GetPlayerStats