mirror of
https://github.com/FWGS/xash3d-fwgs.git
synced 2026-08-05 03:24:56 +08:00
engine: server: set flag that we are expecting resource list to come from the client to not apply resource list rate limit
This commit is contained in:
@@ -73,6 +73,7 @@ extern int SV_UPDATE_BACKUP;
|
||||
#define FCL_HLTV_PROXY BIT( 8 ) // this is a proxy for a HLTV client (spectator)
|
||||
#define FCL_SEND_RESOURCES BIT( 9 )
|
||||
#define FCL_FORCE_UNMODIFIED BIT( 10 )
|
||||
#define FCL_EXPECT_RESOURCELIST BIT( 11 ) // engine sent svc_resourcerequest, expect one clc_resourcelist in response
|
||||
|
||||
typedef enum
|
||||
{
|
||||
|
||||
@@ -3485,15 +3485,22 @@ static void SV_ParseResourceList( sv_client_t *cl, sizebuf_t *msg )
|
||||
SV_AddToResourceList( resource, &cl->resourcesneeded );
|
||||
}
|
||||
|
||||
if( host.realtime < cl->resourcelist_next_changetime )
|
||||
if( FBitSet( cl->flags, FCL_EXPECT_RESOURCELIST ))
|
||||
{
|
||||
Con_Reportf( "%s: ignoring resource list update from %s: too soon\n", __func__, cl->name );
|
||||
SV_ClearResourceList( &cl->resourcesneeded );
|
||||
SV_ClearResourceList( &cl->resourcesonhand );
|
||||
return;
|
||||
ClearBits( cl->flags, FCL_EXPECT_RESOURCELIST );
|
||||
}
|
||||
else
|
||||
{
|
||||
if( host.realtime < cl->resourcelist_next_changetime )
|
||||
{
|
||||
Con_Reportf( "%s: ignoring resource list update from %s: too soon\n", __func__, cl->name );
|
||||
SV_ClearResourceList( &cl->resourcesneeded );
|
||||
SV_ClearResourceList( &cl->resourcesonhand );
|
||||
return;
|
||||
}
|
||||
|
||||
cl->resourcelist_next_changetime = host.realtime + sv_upload_penalty_time.value;
|
||||
cl->resourcelist_next_changetime = host.realtime + sv_upload_penalty_time.value;
|
||||
}
|
||||
|
||||
totalsize = COM_SizeofResourceList( &cl->resourcesneeded, &ri );
|
||||
|
||||
|
||||
@@ -543,6 +543,8 @@ void SV_SendResource( resource_t *pResource, sizebuf_t *msg )
|
||||
|
||||
void SV_SendResources( sv_client_t *cl, sizebuf_t *msg )
|
||||
{
|
||||
SetBits( cl->flags, FCL_EXPECT_RESOURCELIST );
|
||||
|
||||
MSG_BeginServerCmd( msg, svc_resourcerequest );
|
||||
MSG_WriteLong( msg, svs.spawncount );
|
||||
MSG_WriteLong( msg, 0 );
|
||||
|
||||
Reference in New Issue
Block a user