Browse Source

engine: server: remove some totally unused functions

pull/2/head
Alibek Omarov 2 years ago
parent
commit
597027277c
  1. 1
      engine/server/server.h
  2. 4
      engine/server/sv_filter.c
  3. 24
      engine/server/sv_frame.c
  4. 23
      engine/server/sv_phys.c
  5. 5
      engine/server/sv_pmove.c
  6. 40
      engine/server/sv_world.c

1
engine/server/server.h

@ -587,7 +587,6 @@ void SV_InactivateClients( void );
int SV_FindBestBaselineForStatic( int index, entity_state_t **baseline, entity_state_t *to ); int SV_FindBestBaselineForStatic( int index, entity_state_t **baseline, entity_state_t *to );
void SV_WriteFrameToClient( sv_client_t *client, sizebuf_t *msg ); void SV_WriteFrameToClient( sv_client_t *client, sizebuf_t *msg );
void SV_BuildClientFrame( sv_client_t *client ); void SV_BuildClientFrame( sv_client_t *client );
void SV_SendMessagesToAll( void );
void SV_SkipUpdates( void ); void SV_SkipUpdates( void );
// //

4
engine/server/sv_filter.c

@ -383,7 +383,7 @@ qboolean SV_CheckIP( netadr_t *adr )
static void SV_AddIP_PrintUsage( void ) static void SV_AddIP_PrintUsage( void )
{ {
Con_Printf(S_USAGE "addip <minutes> <ipaddress>\n" Con_Printf(S_USAGE "addip <minutes> <ipaddress>\n"
S_USAGE_INDENT "addip <minutes> <ipaddress/CIDR>\n" S_USAGE_INDENT "addip <minutes> <ipaddress/CIDR>\n"
"Use 0 minutes for permanent\n" "Use 0 minutes for permanent\n"
"ipaddress A.B.C.D/24 is equivalent to A.B.C.0 and A.B.C\n" "ipaddress A.B.C.D/24 is equivalent to A.B.C.0 and A.B.C\n"
"NOTE: IPv6 addresses only support prefix format!\n"); "NOTE: IPv6 addresses only support prefix format!\n");
@ -392,7 +392,7 @@ static void SV_AddIP_PrintUsage( void )
static void SV_RemoveIP_PrintUsage( void ) static void SV_RemoveIP_PrintUsage( void )
{ {
Con_Printf(S_USAGE "removeip <ipaddress> [removeAll]\n" Con_Printf(S_USAGE "removeip <ipaddress> [removeAll]\n"
S_USAGE_INDENT "removeip <ipaddress/CIDR> [removeAll]\n" S_USAGE_INDENT "removeip <ipaddress/CIDR> [removeAll]\n"
"Use removeAll to delete all ip filters which ipaddress or ipaddress/CIDR includes\n"); "Use removeAll to delete all ip filters which ipaddress or ipaddress/CIDR includes\n");
} }

24
engine/server/sv_frame.c

@ -927,30 +927,6 @@ void SV_SendClientMessages( void )
sv.current_client = NULL; sv.current_client = NULL;
} }
/*
=======================
SV_SendMessagesToAll
e.g. before changing level
=======================
*/
void SV_SendMessagesToAll( void )
{
sv_client_t *cl;
int i;
if( sv.state == ss_dead )
return;
for( i = 0, cl = svs.clients; i < svs.maxclients; i++, cl++ )
{
if( cl->state >= cs_connected )
SetBits( cl->flags, FCL_SEND_NET_MESSAGE );
}
SV_SendClientMessages();
}
/* /*
======================= =======================
SV_SkipUpdates SV_SkipUpdates

23
engine/server/sv_phys.c

@ -718,29 +718,6 @@ void SV_AddGravity( edict_t *ent )
SV_CheckVelocity( ent ); SV_CheckVelocity( ent );
} }
/*
============
SV_AddHalfGravity
============
*/
void SV_AddHalfGravity( edict_t *ent, float timestep )
{
float ent_gravity;
if( ent->v.gravity )
ent_gravity = ent->v.gravity;
else ent_gravity = 1.0f;
// Add 1/2 of the total gravitational effects over this timestep
ent->v.velocity[2] -= ( 0.5f * ent_gravity * sv_gravity.value * timestep );
ent->v.velocity[2] += ( ent->v.basevelocity[2] * sv.frametime );
ent->v.basevelocity[2] = 0.0f;
// bound velocity
SV_CheckVelocity( ent );
}
/* /*
=============================================================================== ===============================================================================

5
engine/server/sv_pmove.c

@ -354,11 +354,6 @@ static void GAME_EXPORT pfnParticle( const float *origin, int color, float life,
MSG_WriteByte( &sv.reliable_datagram, bound( 0, life * 8, 255 )); MSG_WriteByte( &sv.reliable_datagram, bound( 0, life * 8, 255 ));
} }
int SV_TestLine( const vec3_t start, const vec3_t end, int flags )
{
return PM_TestLineExt( svgame.pmove, svgame.pmove->physents, svgame.pmove->numphysent, start, end, flags );
}
static int GAME_EXPORT pfnTestPlayerPosition( float *pos, pmtrace_t *ptrace ) static int GAME_EXPORT pfnTestPlayerPosition( float *pos, pmtrace_t *ptrace )
{ {
return PM_TestPlayerPosition( svgame.pmove, pos, ptrace, NULL ); return PM_TestPlayerPosition( svgame.pmove, pos, ptrace, NULL );

40
engine/server/sv_world.c

@ -170,46 +170,6 @@ hull_t *SV_HullForBox( const vec3_t mins, const vec3_t maxs )
return &box_hull; return &box_hull;
} }
/*
==================
SV_HullAutoSelect
select the apropriate hull automatically
==================
*/
hull_t *SV_HullAutoSelect( model_t *model, const vec3_t mins, const vec3_t maxs, const vec3_t size, vec3_t offset )
{
float curdiff;
float lastdiff = 999;
int i, hullNumber = 0; // assume we fail
vec3_t clip_size;
hull_t *hull;
// NOTE: this is not matched with hardcoded values in some cases...
for( i = 0; i < MAX_MAP_HULLS; i++ )
{
VectorSubtract( model->hulls[i].clip_maxs, model->hulls[i].clip_mins, clip_size );
curdiff = floor( VectorAvg( size )) - floor( VectorAvg( clip_size ));
curdiff = fabs( curdiff );
if( curdiff < lastdiff )
{
hullNumber = i;
lastdiff = curdiff;
}
}
// TraceHull stuff
hull = &model->hulls[hullNumber];
// calculate an offset value to center the origin
// NOTE: never get offset of drawing hull
if( !hullNumber ) VectorCopy( hull->clip_mins, offset );
else VectorSubtract( hull->clip_mins, mins, offset );
return hull;
}
/* /*
================== ==================
SV_HullForBsp SV_HullForBsp

Loading…
Cancel
Save