summaryrefslogtreecommitdiff
path: root/src/client/cl_main.c
diff options
context:
space:
mode:
authorZack Middleton <zturtleman@gmail.com>2011-09-07 19:38:19 +0000
committerTim Angus <tim@ngus.net>2013-01-10 23:37:49 +0000
commita5802640d1ecf2b7b87f1dd861b0563665bd0df3 (patch)
tree9ba86610df90c2cfebd0f1374aaeae0a3bb3c87f /src/client/cl_main.c
parent9833bc56325e943fbdef9e736b786135d3ea8189 (diff)
Require gamename if not supporting legacy protocol.
Diffstat (limited to 'src/client/cl_main.c')
-rw-r--r--src/client/cl_main.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/client/cl_main.c b/src/client/cl_main.c
index aee69445..58618f19 100644
--- a/src/client/cl_main.c
+++ b/src/client/cl_main.c
@@ -3819,13 +3819,22 @@ void CL_ServerInfoPacket( netadr_t from, msg_t *msg ) {
char *infoString;
int prot;
char *gamename;
+ qboolean gameMismatch;
infoString = MSG_ReadString( msg );
// if this isn't the correct gamename, ignore it
gamename = Info_ValueForKey( infoString, "gamename" );
- if (gamename && *gamename && strcmp(gamename, com_gamename->string))
+#ifdef LEGACY_PROTOCOL
+ // gamename is optional for legacy protocol
+ if (com_legacyprotocol->integer && !*gamename)
+ gameMismatch = qfalse;
+ else
+#endif
+ gameMismatch = !*gamename || strcmp(gamename, com_gamename->string) != 0;
+
+ if (gameMismatch)
{
Com_DPrintf( "Game mismatch in info packet: %s\n", infoString );
return;