2
0
mirror of https://github.com/FWGS/xash3d-fwgs synced 2024-12-22 08:52:32 +01:00

engine: add NetAPI flag to send NetAPI requests to old protocol servers

This commit is contained in:
Alibek Omarov 2024-07-07 06:17:15 +03:00
parent 296a7ac11d
commit dabbe09918
2 changed files with 2 additions and 1 deletions

View File

@ -27,6 +27,7 @@
// Set this flag for things like broadcast requests, etc. where the engine should not
// kill the request hook after receiving the first response
#define FNETAPI_MULTIPLE_RESPONSE ( 1<<0 )
#define FNETAPI_LEGACY_PROTOCOL ( 1<<1 ) // xash3d-fwgs extension
struct net_response_s;
typedef void (*net_api_response_func_t) ( struct net_response_s *response );

View File

@ -3467,7 +3467,7 @@ static void GAME_EXPORT NetAPI_SendRequest( int context, int request, int flags,
nr->flags = flags;
// local servers request
Q_snprintf( req, sizeof( req ), "netinfo %i %i %i", PROTOCOL_VERSION, context, request );
Q_snprintf( req, sizeof( req ), "netinfo %i %i %i", FBitSet( flags, FNETAPI_LEGACY_PROTOCOL ) ? PROTOCOL_LEGACY_VERSION : PROTOCOL_VERSION, context, request );
Netchan_OutOfBandPrint( NS_CLIENT, nr->resp.remote_address, "%s", req );
}