mirror of
https://github.com/Garux/netradiant-custom.git
synced 2026-09-28 00:00:03 +02:00
improve 343cf73d29, force net send via dedicated thread loop
replace Sys_Sleep()
This commit is contained in:
+8
-4
@@ -378,13 +378,17 @@ void NMSG_WriteFloat( netmessage_t *msg, float c ){
|
||||
// Returns: -
|
||||
// Changes Globals: -
|
||||
//===========================================================================
|
||||
void NMSG_WriteString( netmessage_t *msg, char *string ){
|
||||
if ( msg->size + strlen( string ) + 1 >= MAX_NETMESSAGE ) {
|
||||
void NMSG_WriteString_n( netmessage_t *msg, const char *string, int n ){
|
||||
if ( msg->size + n >= MAX_NETMESSAGE ) {
|
||||
WinPrint( "NMSG_WriteString: overflow\n" );
|
||||
return;
|
||||
} //end if
|
||||
memcpy( &msg->data[msg->size], string, strlen( string ) + 1 );
|
||||
msg->size += strlen( string ) + 1;
|
||||
memcpy( &msg->data[msg->size], string, n );
|
||||
msg->size += n;
|
||||
}
|
||||
|
||||
void NMSG_WriteString( netmessage_t *msg, const char *string ){
|
||||
NMSG_WriteString_n( msg, string, strlen( string ) );
|
||||
} //end of the function NMSG_WriteString
|
||||
//===========================================================================
|
||||
//
|
||||
|
||||
+2
-1
@@ -90,7 +90,8 @@ void NMSG_WriteByte( netmessage_t *msg, int c );
|
||||
void NMSG_WriteShort( netmessage_t *msg, int c );
|
||||
void NMSG_WriteLong( netmessage_t *msg, int c );
|
||||
void NMSG_WriteFloat( netmessage_t *msg, float c );
|
||||
void NMSG_WriteString( netmessage_t *msg, char *string );
|
||||
void NMSG_WriteString_n( netmessage_t *msg, const char *string, int n );
|
||||
void NMSG_WriteString( netmessage_t *msg, const char *string );
|
||||
void NMSG_ReadStart( netmessage_t *msg );
|
||||
int NMSG_ReadChar( netmessage_t *msg );
|
||||
int NMSG_ReadByte( netmessage_t *msg );
|
||||
|
||||
Reference in New Issue
Block a user