mirror of
https://github.com/FWGS/xash3d-fwgs
synced 2024-11-24 18:59:50 +01:00
engine: server: make SV_IsPlayerIndex and SV_HavePassword inline
This commit is contained in:
parent
046b1da8a8
commit
c5471fe6fd
@ -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
|
||||||
|
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user