mirror of
https://github.com/YGGverse/xash3d-fwgs.git
synced 2025-01-29 16:24:16 +00:00
In-game fragment size setting
This commit is contained in:
parent
097974bde2
commit
23af5dcaf1
@ -97,6 +97,7 @@ int SV_GetFragmentSize( void *pcl, fragsize_t mode )
|
|||||||
|
|
||||||
if( mode == FRAGSIZE_UNRELIABLE )
|
if( mode == FRAGSIZE_UNRELIABLE )
|
||||||
{
|
{
|
||||||
|
// allow setting unreliable limit with "setinfo cl_urmax"
|
||||||
cl_frag_size = Q_atoi( Info_ValueForKey( cl->userinfo, "cl_urmax" ));
|
cl_frag_size = Q_atoi( Info_ValueForKey( cl->userinfo, "cl_urmax" ));
|
||||||
if( cl_frag_size == 0 )
|
if( cl_frag_size == 0 )
|
||||||
return NET_MAX_MESSAGE;
|
return NET_MAX_MESSAGE;
|
||||||
@ -109,9 +110,17 @@ int SV_GetFragmentSize( void *pcl, fragsize_t mode )
|
|||||||
if( mode != FRAGSIZE_FRAG )
|
if( mode != FRAGSIZE_FRAG )
|
||||||
return cl_frag_size;
|
return cl_frag_size;
|
||||||
|
|
||||||
// add window for unreliable
|
// get in-game fragmentation size
|
||||||
if( cl->state == cs_spawned )
|
if( cl->state == cs_spawned )
|
||||||
cl_frag_size /= 2;
|
{
|
||||||
|
// allow setting in-game fragsize with "setinfo cl_frmax"
|
||||||
|
int frmax = Q_atoi( Info_ValueForKey( cl->userinfo, "cl_frmax" ));
|
||||||
|
|
||||||
|
if( frmax < FRAGMENT_MIN_SIZE || frmax > FRAGMENT_MAX_SIZE )
|
||||||
|
cl_frag_size = frmax;
|
||||||
|
else
|
||||||
|
cl_frag_size /= 2;// add window for unreliable
|
||||||
|
}
|
||||||
|
|
||||||
return cl_frag_size - HEADER_BYTES;
|
return cl_frag_size - HEADER_BYTES;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user