From 5da11291a28559d01ba29716edddfa290b065957 Mon Sep 17 00:00:00 2001 From: Alibek Omarov Date: Sat, 26 Jan 2019 18:54:23 +0300 Subject: [PATCH] legacymode: support server scanning --- engine/client/cl_main.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/engine/client/cl_main.c b/engine/client/cl_main.c index 4e35d462..9b44d148 100644 --- a/engine/client/cl_main.c +++ b/engine/client/cl_main.c @@ -1453,7 +1453,7 @@ void CL_LocalServers_f( void ) adr.type = NA_BROADCAST; adr.port = MSG_BigShort( PORT_SERVER ); - Netchan_OutOfBandPrint( NS_CLIENT, adr, "info %i", cls.legacymode?PROTOCOL_LEGACY_VERSION:PROTOCOL_VERSION ); + Netchan_OutOfBandPrint( NS_CLIENT, adr, "info %i", PROTOCOL_VERSION ); } #define MS_SCAN_REQUEST "1\xFF" "0.0.0.0:0\0" @@ -1603,6 +1603,13 @@ void CL_ParseStatusMessage( netadr_t from, sizebuf_t *msg ) CL_FixupColorStringsForInfoString( s, infostring ); + if( cl_legacymode->value && Q_strstr( infostring, "wrong version" ) ) + { + Netchan_OutOfBandPrint( NS_CLIENT, from, "info %i", PROTOCOL_LEGACY_VERSION ); + Con_Printf( "^1Server^7: %s, Info: %s\n", NET_AdrToString( from ), infostring ); + return; + } + if( !COM_CheckString( Info_ValueForKey( infostring, "gamedir" ))) { Con_Printf( "^1Server^7: %s, Info: %s\n", NET_AdrToString( from ), infostring ); @@ -1949,7 +1956,7 @@ void CL_ConnectionlessPacket( netadr_t from, sizebuf_t *msg ) else if( clgame.request_type == NET_REQUEST_GAMEUI ) { NET_Config( true ); // allow remote - Netchan_OutOfBandPrint( NS_CLIENT, servadr, "info %i", cls.legacymode?PROTOCOL_LEGACY_VERSION:PROTOCOL_VERSION ); + Netchan_OutOfBandPrint( NS_CLIENT, servadr, "info %i", PROTOCOL_VERSION ); } }