diff options
author | Zack Middleton <zturtleman@gmail.com> | 2011-09-07 19:38:19 +0000 |
---|---|---|
committer | Tim Angus <tim@ngus.net> | 2013-01-10 23:37:49 +0000 |
commit | a5802640d1ecf2b7b87f1dd861b0563665bd0df3 (patch) | |
tree | 9ba86610df90c2cfebd0f1374aaeae0a3bb3c87f /src/server | |
parent | 9833bc56325e943fbdef9e736b786135d3ea8189 (diff) |
Require gamename if not supporting legacy protocol.
Diffstat (limited to 'src/server')
-rw-r--r-- | src/server/sv_client.c | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/src/server/sv_client.c b/src/server/sv_client.c index f3d190de..93519177 100644 --- a/src/server/sv_client.c +++ b/src/server/sv_client.c @@ -61,17 +61,24 @@ void SV_GetChallenge(netadr_t from) challenge_t *challenge; qboolean wasfound = qfalse; char *gameName; + qboolean gameMismatch; gameName = Cmd_Argv(2); - if(gameName && *gameName) + +#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; + + // reject client if the gamename string sent by the client doesn't match ours + if (gameMismatch) { - // reject client if the heartbeat string sent by the client doesn't match ours - if(strcmp(gameName, com_gamename->string)) - { - NET_OutOfBandPrint(NS_SERVER, from, "print\nGame mismatch: This is a %s server\n", - com_gamename->string); - return; - } + NET_OutOfBandPrint(NS_SERVER, from, "print\nGame mismatch: This is a %s server\n", + com_gamename->string); + return; } oldest = 0; |