engine: initialize network buffers used on player connect and after

This commit is contained in:
Alibek Omarov 2023-02-09 17:57:45 +03:00
parent c23396f533
commit fccf044976
4 changed files with 5 additions and 0 deletions

View File

@ -709,6 +709,7 @@ void CL_WritePacket( void )
CL_ComputePacketLoss ();
memset( data, 0, sizeof( data ));
MSG_Init( &buf, "ClientData", data, sizeof( data ));
// Determine number of backup commands to send along

View File

@ -1589,6 +1589,7 @@ void Netchan_TransmitBits( netchan_t *chan, int length, byte *data )
}
}
memset( send_buf, 0, sizeof( send_buf ));
MSG_Init( &send, "NetSend", send_buf, sizeof( send_buf ));
// prepare the packet header

View File

@ -1632,6 +1632,7 @@ static qboolean SV_New_f( sv_client_t *cl )
sizebuf_t msg;
int i;
memset( msg_buf, 0, sizeof( msg_buf ));
MSG_Init( &msg, "New", msg_buf, sizeof( msg_buf ));
if( cl->state != cs_connected )
@ -1982,6 +1983,7 @@ static qboolean SV_SendRes_f( sv_client_t *cl )
if( cl->state != cs_connected )
return false;
memset( buffer, 0, sizeof( buffer ));
MSG_Init( &msg, "SendResources", buffer, sizeof( buffer ));
if( svs.maxclients > 1 && FBitSet( cl->flags, FCL_SEND_RESOURCES ))

View File

@ -711,6 +711,7 @@ void SV_SendClientDatagram( sv_client_t *cl )
byte msg_buf[MAX_DATAGRAM];
sizebuf_t msg;
memset( msg_buf, 0, sizeof( msg_buf ));
MSG_Init( &msg, "Datagram", msg_buf, sizeof( msg_buf ));
// always send servertime at new frame