From f1b6b1711bc2ab0f0de7ca1015904cb0189a4016 Mon Sep 17 00:00:00 2001 From: darkvater Date: Wed, 15 Dec 2004 16:51:55 +0000 Subject: (svn r1098) -Fix: server without revision build doesn't care about the client's version. Also moved all revision things where it belongs (network.c) --- network.c | 10 ++++++++++ network.h | 1 + network_server.c | 2 ++ strings.c | 8 +------- ttd.h | 1 - 5 files changed, 14 insertions(+), 8 deletions(-) diff --git a/network.c b/network.c index 06ee8b9ac..4c1019339 100644 --- a/network.c +++ b/network.c @@ -1,6 +1,16 @@ #include "stdafx.h" #include "network_data.h" +#if defined(WITH_REV) + extern const char _openttd_revision[]; +#elif defined(WITH_REV_HACK) + #define WITH_REV + const char _openttd_revision[] = WITH_REV_HACK; +#else + const char _openttd_revision[] = NOREV_STRING; +#endif + + #ifdef ENABLE_NETWORK #include "table/strings.h" diff --git a/network.h b/network.h index 8088e545e..c8c25ef3f 100644 --- a/network.h +++ b/network.h @@ -2,6 +2,7 @@ #define NETWORK_H #include "network_core.h" +#define NOREV_STRING "norev000" #ifdef ENABLE_NETWORK diff --git a/network_server.c b/network_server.c index 3dc001f5f..f0a8c916f 100644 --- a/network_server.c +++ b/network_server.c @@ -578,6 +578,7 @@ DEF_SERVER_RECEIVE_COMMAND(PACKET_CLIENT_JOIN) NetworkRecv_string(p, client_revision, sizeof(client_revision)); +#ifdef WITH_REV // Check if the client has revision control enabled if (strncmp(NOREV_STRING, client_revision, sizeof(client_revision)) != 0) { if (strncmp(_network_game_info.server_revision, client_revision, sizeof(_network_game_info.server_revision) - 1) != 0) { @@ -587,6 +588,7 @@ DEF_SERVER_RECEIVE_COMMAND(PACKET_CLIENT_JOIN) return; } } +#endif NetworkRecv_string(p, name, sizeof(name)); playas = NetworkRecv_uint8(p); diff --git a/strings.c b/strings.c index 24a9391a1..5a738aac3 100644 --- a/strings.c +++ b/strings.c @@ -20,13 +20,7 @@ static byte *_langpack; static uint _langtab_num[32]; // Offset into langpack offs static uint _langtab_start[32]; // Offset into langpack offs -#if defined(WITH_REV) - extern const char _openttd_revision[]; -#elif defined(WITH_REV_HACK) - const char _openttd_revision[] = WITH_REV_HACK; -#else - const char _openttd_revision[] = NOREV_STRING; -#endif +extern const char _openttd_revision[]; typedef byte *PlayerNameGeneratorProc(byte *buffr); diff --git a/ttd.h b/ttd.h index 478bce30e..0265d21f1 100644 --- a/ttd.h +++ b/ttd.h @@ -1,7 +1,6 @@ #ifndef TTD_H #define TTD_H -#define NOREV_STRING "norev000" // FIXME: Include only where really needed. // include sprites #include "table/sprites.h" -- cgit v1.2.3-70-g09d2