Network extensions

This commit is contained in:
mittorn
2019-01-30 16:06:32 +07:00
parent 7bb8124b69
commit 40574d9be0
7 changed files with 58 additions and 8 deletions

View File

@@ -1230,10 +1230,7 @@ qboolean NET_QueuePacket( netsrc_t sock, netadr_t *from, byte *data, size_t *len
// check for split message
if( sock == NS_CLIENT && *(int *)data == NET_HEADER_SPLITPACKET )
{
int splitsize = Cvar_VariableInteger("cl_dlmax");
if( splitsize < SPLITPACKET_MIN_SIZE || splitsize > SPLITPACKET_MAX_SIZE )
Cvar_SetValue( "cl_dlmax", MAX_ROUTEABLE_PACKET );
return NET_GetLong( data, ret, length, Cvar_VariableInteger("cl_dlmax") );
return NET_GetLong( data, ret, length, CL_GetSplitSize() );
}
#endif
// lag the packet, if needed

View File

@@ -66,6 +66,7 @@ void NET_ClearLagData( qboolean bClient, qboolean bServer );
#ifndef XASH_DEDICATED
qboolean CL_LegacyMode( void );
int CL_GetSplitSize( void );
#endif
#endif//NET_WS_H

View File

@@ -243,6 +243,9 @@ GNU General Public License for more details.
extern const char *svc_strings[svc_lastmsg+1];
extern const char *clc_strings[clc_lastmsg+1];
// FWGS extensions
#define NET_EXT_SPLITSIZE (1U<<0) // set splitsize by cl_dlmax
// legacy protocol definitons
#define PROTOCOL_LEGACY_VERSION 48
#define svc_legacy_modelindex 31 // [index][modelpath]