summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortruelight <truelight@openttd.org>2004-12-13 09:01:24 +0000
committertruelight <truelight@openttd.org>2004-12-13 09:01:24 +0000
commitc0603e476872ce76838d81f46c2e75e6636d1e65 (patch)
tree9c58fdb7dda39adeac5768302cd817ff1dcdb45d
parent523b37a3e9156d6ea2ca8f1bfdfdf9b95b4c4f1f (diff)
downloadopenttd-c0603e476872ce76838d81f46c2e75e6636d1e65.tar.xz
(svn r1042) -Fix: [Network] Hopefully enabled revision-check for windows (somehow
windows uses WITH_REV_HACK instead of WITH_REV :s)
-rw-r--r--console.c7
-rw-r--r--network.c9
-rw-r--r--network_client.c9
-rw-r--r--network_gui.c9
-rw-r--r--network_server.c2
5 files changed, 28 insertions, 8 deletions
diff --git a/console.c b/console.c
index ce2b654ed..22256d5c2 100644
--- a/console.c
+++ b/console.c
@@ -231,9 +231,14 @@ static void IConsoleWndProc(Window* w, WindowEvent* e)
void IConsoleInit(void)
{
uint i;
+#ifdef WITH_REV_HACK
+ #define WITH_REV
+ const char _openttd_revision[] = WITH_REV_HACK;
+#else
#if defined(WITH_REV)
extern char _openttd_revision[];
#endif
+#endif
_iconsole_output_file = NULL;
_iconsole_color_default = 1;
_iconsole_color_error = 3;
@@ -588,7 +593,7 @@ void IConsoleVarRegister(const char* name, void* addr, _iconsole_var_types type)
item_new->hook_access = NULL;
item_new->hook_after_change = NULL;
item_new->hook_before_change = NULL;
-
+
}
void IConsoleVarMemRegister(const char* name, _iconsole_var_types type)
diff --git a/network.c b/network.c
index 3456355cf..b9fef269d 100644
--- a/network.c
+++ b/network.c
@@ -785,10 +785,15 @@ bool NetworkClientConnectGame(const byte* host, unsigned short port)
void NetworkInitGameInfo(void)
{
-#if defined(WITH_REV)
- extern char _openttd_revision[];
+#ifdef WITH_REV_HACK
+ #define WITH_REV
+ const char _openttd_revision[] = WITH_REV_HACK;
#else
+ #if defined(WITH_REV)
+ extern char _openttd_revision[];
+ #else
const char _openttd_revision[] = "norev000";
+ #endif
#endif
NetworkClientInfo *ci;
diff --git a/network_client.c b/network_client.c
index a40b7d708..dc512c545 100644
--- a/network_client.c
+++ b/network_client.c
@@ -56,10 +56,15 @@ DEF_CLIENT_SEND_COMMAND(PACKET_CLIENT_JOIN)
// String: Unique id to find the player back in server-listing
//
-#if defined(WITH_REV)
- extern char _openttd_revision[];
+#ifdef WITH_REV_HACK
+ #define WITH_REV
+ const char _openttd_revision[] = WITH_REV_HACK;
#else
+ #if defined(WITH_REV)
+ extern char _openttd_revision[];
+ #else
const char _openttd_revision[] = "norev000";
+ #endif
#endif
Packet *p;
_network_join_status = NETWORK_JOIN_STATUS_AUTHORIZING;
diff --git a/network_gui.c b/network_gui.c
index 774ba9a7a..db50a7964 100644
--- a/network_gui.c
+++ b/network_gui.c
@@ -47,8 +47,13 @@ enum {
static NetworkGameList *_selected_item = NULL;
static int8 _selected_company_item = -1;
-#ifdef WITH_REV
-extern char _openttd_revision[];
+#ifdef WITH_REV_HACK
+ #define WITH_REV
+ const char _openttd_revision[] = WITH_REV_HACK;
+#else
+ #ifdef WITH_REV
+ extern char _openttd_revision[];
+ #endif
#endif
// Truncates a string to max_width (via GetStringWidth) and adds 3 dots
diff --git a/network_server.c b/network_server.c
index fdb888689..3842960d5 100644
--- a/network_server.c
+++ b/network_server.c
@@ -577,7 +577,7 @@ DEF_SERVER_RECEIVE_COMMAND(PACKET_CLIENT_JOIN)
NetworkRecv_string(p, client_revision, sizeof(client_revision));
// Too bad, when WITH_REV is disabled, we can not compare the version.
-#if defined(WITH_REV)
+#if defined(WITH_REV) || defined (WITH_REV_HACK)
// Check if the client has WITH_REV enabled
if (strncmp("norev000", client_revision, sizeof(client_revision)) != 0) {
if (strncmp(_network_game_info.server_revision, client_revision, sizeof(_network_game_info.server_revision)) != 0) {