|
|
@ -108,7 +108,12 @@ int SV_GetFragmentSize( void *pcl, fragsize_t mode ) |
|
|
|
cl_frag_size = bound( FRAGMENT_MIN_SIZE, cl_frag_size, FRAGMENT_MAX_SIZE ); |
|
|
|
cl_frag_size = bound( FRAGMENT_MIN_SIZE, cl_frag_size, FRAGMENT_MAX_SIZE ); |
|
|
|
|
|
|
|
|
|
|
|
if( mode != FRAGSIZE_FRAG ) |
|
|
|
if( mode != FRAGSIZE_FRAG ) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
if( cl->extensions & NET_EXT_SPLITSIZE ) |
|
|
|
return cl_frag_size; |
|
|
|
return cl_frag_size; |
|
|
|
|
|
|
|
else |
|
|
|
|
|
|
|
return 0; // original engine behaviour
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// get in-game fragmentation size
|
|
|
|
// get in-game fragmentation size
|
|
|
|
if( cl->state == cs_spawned ) |
|
|
|
if( cl->state == cs_spawned ) |
|
|
@ -266,6 +271,7 @@ void SV_ConnectClient( netadr_t from ) |
|
|
|
int i, count = 0; |
|
|
|
int i, count = 0; |
|
|
|
int challenge; |
|
|
|
int challenge; |
|
|
|
const char *s; |
|
|
|
const char *s; |
|
|
|
|
|
|
|
int extensions; |
|
|
|
|
|
|
|
|
|
|
|
if( Cmd_Argc() < 5 ) |
|
|
|
if( Cmd_Argc() < 5 ) |
|
|
|
{ |
|
|
|
{ |
|
|
@ -307,6 +313,9 @@ void SV_ConnectClient( netadr_t from ) |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
extensions = Q_atoi( Info_ValueForKey( protinfo, "ext" ) ); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// LAN servers restrict to class b IP addresses
|
|
|
|
// LAN servers restrict to class b IP addresses
|
|
|
|
if( !SV_CheckIPRestrictions( from )) |
|
|
|
if( !SV_CheckIPRestrictions( from )) |
|
|
|
{ |
|
|
|
{ |
|
|
@ -369,6 +378,7 @@ void SV_ConnectClient( netadr_t from ) |
|
|
|
newcl->frames = (client_frame_t *)Z_Calloc( sizeof( client_frame_t ) * SV_UPDATE_BACKUP ); |
|
|
|
newcl->frames = (client_frame_t *)Z_Calloc( sizeof( client_frame_t ) * SV_UPDATE_BACKUP ); |
|
|
|
newcl->userid = g_userid++; // create unique userid
|
|
|
|
newcl->userid = g_userid++; // create unique userid
|
|
|
|
newcl->state = cs_connected; |
|
|
|
newcl->state = cs_connected; |
|
|
|
|
|
|
|
newcl->extensions = extensions & (NET_EXT_SPLITSIZE); |
|
|
|
|
|
|
|
|
|
|
|
// reset viewentities (from previous level)
|
|
|
|
// reset viewentities (from previous level)
|
|
|
|
memset( newcl->viewentity, 0, sizeof( newcl->viewentity )); |
|
|
|
memset( newcl->viewentity, 0, sizeof( newcl->viewentity )); |
|
|
@ -379,8 +389,15 @@ void SV_ConnectClient( netadr_t from ) |
|
|
|
Netchan_Setup( NS_SERVER, &newcl->netchan, from, qport, newcl, SV_GetFragmentSize ); |
|
|
|
Netchan_Setup( NS_SERVER, &newcl->netchan, from, qport, newcl, SV_GetFragmentSize ); |
|
|
|
MSG_Init( &newcl->datagram, "Datagram", newcl->datagram_buf, sizeof( newcl->datagram_buf )); // datagram buf
|
|
|
|
MSG_Init( &newcl->datagram, "Datagram", newcl->datagram_buf, sizeof( newcl->datagram_buf )); // datagram buf
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Q_strncpy( newcl->hashedcdkey, Info_ValueForKey( protinfo, "uuid" ), 32 ); |
|
|
|
|
|
|
|
newcl->hashedcdkey[32] = '\0'; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// build protinfo answer
|
|
|
|
|
|
|
|
protinfo[0] = '\0'; |
|
|
|
|
|
|
|
Info_SetValueForKey( protinfo, "ext", va( "%d",newcl->extensions ), sizeof( protinfo ) ); |
|
|
|
|
|
|
|
|
|
|
|
// send the connect packet to the client
|
|
|
|
// send the connect packet to the client
|
|
|
|
Netchan_OutOfBandPrint( NS_SERVER, from, "client_connect" ); |
|
|
|
Netchan_OutOfBandPrint( NS_SERVER, from, "client_connect %s", protinfo ); |
|
|
|
|
|
|
|
|
|
|
|
newcl->upstate = us_inactive; |
|
|
|
newcl->upstate = us_inactive; |
|
|
|
newcl->connection_started = host.realtime; |
|
|
|
newcl->connection_started = host.realtime; |
|
|
@ -388,8 +405,7 @@ void SV_ConnectClient( netadr_t from ) |
|
|
|
newcl->delta_sequence = -1; |
|
|
|
newcl->delta_sequence = -1; |
|
|
|
newcl->flags = 0; |
|
|
|
newcl->flags = 0; |
|
|
|
|
|
|
|
|
|
|
|
Q_strncpy( newcl->hashedcdkey, Info_ValueForKey( protinfo, "uuid" ), 32 ); |
|
|
|
|
|
|
|
newcl->hashedcdkey[32] = '\0'; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// reset any remaining events
|
|
|
|
// reset any remaining events
|
|
|
|
memset( &newcl->events, 0, sizeof( newcl->events )); |
|
|
|
memset( &newcl->events, 0, sizeof( newcl->events )); |
|
|
|