added support for protocol version check as first protocol command
authorHolger Schemel <info@artsoft.org>
Mon, 20 Aug 2018 09:13:46 +0000 (11:13 +0200)
committerHolger Schemel <info@artsoft.org>
Mon, 20 Aug 2018 09:13:46 +0000 (11:13 +0200)
src/netserv.c

index 963a862b229b345067ca0e64b2ec3a5e3f4d475c..4b846f9da413425db5e86999fd149111f34ea77c 100644 (file)
@@ -589,10 +589,12 @@ void NetworkServer(int port, int serveronly)
          memmove(player->readbuffer, player->readbuffer + 4 + len, player->nread);
 
          buffer[0] = player->number;
-         if (!player->introduced && buffer[1] != OP_PLAYER_NAME)
+         if (!player->introduced &&
+             buffer[1] != OP_PLAYER_NAME &&
+             buffer[1] != OP_PROTOCOL_VERSION)
          {
            if (options.verbose)
-             Error(ERR_NETWORK_SERVER, "!(client %d)->introduced && buffer[1]==%d (expected OP_PLAYER_NAME)", buffer[0], buffer[1]);
+             Error(ERR_NETWORK_SERVER, "!(client %d)->introduced && buffer[1]==%d (expected OP_PLAYER_NAME or OP_PROTOCOL_VERSION)", buffer[0], buffer[1]);
 
            RemovePlayer(player);
            interrupt = 1;