(svn r1042) -Fix: [Network] Hopefully enabled revision-check for windows (somehow
authortruelight
Mon, 13 Dec 2004 09:01:24 +0000
changeset 618 b14421f6b2ee
parent 617 659c105f1d48
child 619 2a8675eeeb3f
(svn r1042) -Fix: [Network] Hopefully enabled revision-check for windows (somehow
windows uses WITH_REV_HACK instead of WITH_REV :s)
console.c
network.c
network_client.c
network_gui.c
network_server.c
--- a/console.c	Mon Dec 13 07:41:04 2004 +0000
+++ b/console.c	Mon Dec 13 09:01:24 2004 +0000
@@ -231,9 +231,14 @@
 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 @@
 	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)
--- a/network.c	Mon Dec 13 07:41:04 2004 +0000
+++ b/network.c	Mon Dec 13 09:01:24 2004 +0000
@@ -785,10 +785,15 @@
 
 void NetworkInitGameInfo(void)
 {
-#if defined(WITH_REV)
+#ifdef WITH_REV_HACK
+	#define WITH_REV
+	const char _openttd_revision[] = WITH_REV_HACK;
+#else
+	#if defined(WITH_REV)
 		extern char _openttd_revision[];
-#else
+	#else
 		const char _openttd_revision[] = "norev000";
+	#endif
 #endif
 	NetworkClientInfo *ci;
 
--- a/network_client.c	Mon Dec 13 07:41:04 2004 +0000
+++ b/network_client.c	Mon Dec 13 09:01:24 2004 +0000
@@ -56,10 +56,15 @@
 	//    String: Unique id to find the player back in server-listing
 	//
 
-#if defined(WITH_REV)
+#ifdef WITH_REV_HACK
+	#define WITH_REV
+	const char _openttd_revision[] = WITH_REV_HACK;
+#else
+	#if defined(WITH_REV)
 		extern char _openttd_revision[];
-#else
+	#else
 		const char _openttd_revision[] = "norev000";
+	#endif
 #endif
 	Packet *p;
 	_network_join_status = NETWORK_JOIN_STATUS_AUTHORIZING;
--- a/network_gui.c	Mon Dec 13 07:41:04 2004 +0000
+++ b/network_gui.c	Mon Dec 13 09:01:24 2004 +0000
@@ -47,8 +47,13 @@
 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
--- a/network_server.c	Mon Dec 13 07:41:04 2004 +0000
+++ b/network_server.c	Mon Dec 13 09:01:24 2004 +0000
@@ -577,7 +577,7 @@
 	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) {