mirror of
https://github.com/YGGverse/xash3d-fwgs.git
synced 2025-01-17 18:40:02 +00:00
Revert "engine: get rid of MSG_BigShort, use htons instead, since network headers are always included"
This reverts commit a6475f530baac26456f5be7143661586d521b04a.
This commit is contained in:
parent
5313dc9475
commit
500ca54550
@ -3377,7 +3377,7 @@ void GAME_EXPORT NetAPI_SendRequest( int context, int request, int flags, double
|
|||||||
|
|
||||||
// make sure that port is specified
|
// make sure that port is specified
|
||||||
if( !nr->resp.remote_address.port )
|
if( !nr->resp.remote_address.port )
|
||||||
nr->resp.remote_address.port = htons( PORT_MASTER );
|
nr->resp.remote_address.port = MSG_BigShort( PORT_MASTER );
|
||||||
|
|
||||||
// grab the list from the master server
|
// grab the list from the master server
|
||||||
Q_strcpy( &fullquery[22], GI->gamefolder );
|
Q_strcpy( &fullquery[22], GI->gamefolder );
|
||||||
|
@ -1006,7 +1006,7 @@ void CL_SendConnectPacket( void )
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if( adr.port == 0 ) adr.port = htons( PORT_SERVER );
|
if( adr.port == 0 ) adr.port = MSG_BigShort( PORT_SERVER );
|
||||||
qport = Cvar_VariableString( "net_qport" );
|
qport = Cvar_VariableString( "net_qport" );
|
||||||
key = ID_GetMD5();
|
key = ID_GetMD5();
|
||||||
|
|
||||||
@ -1134,7 +1134,7 @@ void CL_CheckForResend( void )
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if( adr.port == 0 ) adr.port = htons( PORT_SERVER );
|
if( adr.port == 0 ) adr.port = MSG_BigShort( PORT_SERVER );
|
||||||
|
|
||||||
if( cls.connect_retry == CL_TEST_RETRIES_NORESPONCE )
|
if( cls.connect_retry == CL_TEST_RETRIES_NORESPONCE )
|
||||||
{
|
{
|
||||||
@ -1321,7 +1321,7 @@ void CL_Rcon_f( void )
|
|||||||
}
|
}
|
||||||
|
|
||||||
NET_StringToAdr( rcon_address->string, &to );
|
NET_StringToAdr( rcon_address->string, &to );
|
||||||
if( to.port == 0 ) to.port = htons( PORT_SERVER );
|
if( to.port == 0 ) to.port = MSG_BigShort( PORT_SERVER );
|
||||||
}
|
}
|
||||||
|
|
||||||
NET_SendPacket( NS_CLIENT, Q_strlen( message ) + 1, message, to );
|
NET_SendPacket( NS_CLIENT, Q_strlen( message ) + 1, message, to );
|
||||||
@ -1563,7 +1563,7 @@ void CL_LocalServers_f( void )
|
|||||||
|
|
||||||
// send a broadcast packet
|
// send a broadcast packet
|
||||||
adr.type = NA_BROADCAST;
|
adr.type = NA_BROADCAST;
|
||||||
adr.port = htons( PORT_SERVER );
|
adr.port = MSG_BigShort( PORT_SERVER );
|
||||||
Netchan_OutOfBandPrint( NS_CLIENT, adr, "info %i", PROTOCOL_VERSION );
|
Netchan_OutOfBandPrint( NS_CLIENT, adr, "info %i", PROTOCOL_VERSION );
|
||||||
|
|
||||||
adr.type = NA_MULTICAST_IP6;
|
adr.type = NA_MULTICAST_IP6;
|
||||||
|
@ -89,6 +89,11 @@ const char *svc_strings[svc_lastmsg+1] =
|
|||||||
"svc_exec",
|
"svc_exec",
|
||||||
};
|
};
|
||||||
|
|
||||||
|
unsigned short MSG_BigShort( unsigned short swap )
|
||||||
|
{
|
||||||
|
return (swap >> 8)|(swap << 8);
|
||||||
|
}
|
||||||
|
|
||||||
void MSG_InitMasks( void )
|
void MSG_InitMasks( void )
|
||||||
{
|
{
|
||||||
uint startbit, endbit;
|
uint startbit, endbit;
|
||||||
|
@ -63,6 +63,7 @@ void MSG_ExciseBits( sizebuf_t *sb, int startbit, int bitstoremove );
|
|||||||
_inline int MSG_TellBit( sizebuf_t *sb ) { return sb->iCurBit; }
|
_inline int MSG_TellBit( sizebuf_t *sb ) { return sb->iCurBit; }
|
||||||
_inline const char *MSG_GetName( sizebuf_t *sb ) { return sb->pDebugName; }
|
_inline const char *MSG_GetName( sizebuf_t *sb ) { return sb->pDebugName; }
|
||||||
qboolean MSG_CheckOverflow( sizebuf_t *sb );
|
qboolean MSG_CheckOverflow( sizebuf_t *sb );
|
||||||
|
unsigned short MSG_BigShort( unsigned short swap );
|
||||||
|
|
||||||
// init writing
|
// init writing
|
||||||
void MSG_StartWriting( sizebuf_t *sb, void *pData, int nBytes, int iStartBit, int nBits );
|
void MSG_StartWriting( sizebuf_t *sb, void *pData, int nBytes, int iStartBit, int nBits );
|
||||||
|
Loading…
x
Reference in New Issue
Block a user