engine: server: check for master servers addresses in connectionless packet handler, and it it matches, only reply to M2S messages

This commit is contained in:
Alibek Omarov
2025-05-25 20:29:16 +05:00
parent 71040c7ed5
commit 6a318d5000

View File

@@ -3183,6 +3183,20 @@ void SV_ConnectionlessPacket( netadr_t from, sizebuf_t *msg )
return;
}
if( NET_IsMasterAdr( from ))
{
if( !Q_strcmp( pcmd, M2S_CHALLENGE ))
{
SV_AddToMaster( from, msg );
}
else if( !Q_strcmp( pcmd, M2S_NAT_CONNECT ))
{
SV_ConnectNatClient( from );
}
return;
}
if( !Q_strcmp( pcmd, A2S_GOLDSRC_INFO ) || pcmd[0] == A2S_GOLDSRC_PLAYERS || pcmd[0] == A2S_GOLDSRC_RULES )
{
SV_SourceQuery_HandleConnnectionlessPacket( pcmd, from );
@@ -3195,14 +3209,6 @@ void SV_ConnectionlessPacket( netadr_t from, sizebuf_t *msg )
{
SV_Info( from, Q_atoi( Cmd_Argv( 1 )));
}
else if( !Q_strcmp( pcmd, M2S_CHALLENGE ))
{
SV_AddToMaster( from, msg );
}
else if( !Q_strcmp( pcmd, M2S_NAT_CONNECT ))
{
SV_ConnectNatClient( from );
}
else if( !Q_strcmp( pcmd, C2S_BANDWIDTHTEST ))
{
SV_TestBandWidth( from );