(svn r1052) -Fix: [Network] You can't join a server when revision mismatches.
--- a/lang/english.txt Mon Dec 13 14:49:31 2004 +0000
+++ b/lang/english.txt Mon Dec 13 14:57:58 2004 +0000
@@ -1227,6 +1227,7 @@
STR_NETWORK_PASSWORD :{SILVER}Password protected!
STR_NETWORK_SERVER_OFFLINE :{SILVER}SERVER OFFLINE
STR_NETWORK_SERVER_FULL :{SILVER}SERVER FULL
+STR_NETWORK_VERSION_MISMATCH :{SILVER}VERSION MISMATCH
STR_NETWORK_JOIN_GAME :{BLACK}Join game
--- a/network_gui.c Mon Dec 13 14:49:31 2004 +0000
+++ b/network_gui.c Mon Dec 13 14:57:58 2004 +0000
@@ -87,6 +87,12 @@
w->disabled_state = (1<<17); // Server offline, join button disabled
else if (_selected_item->info.clients_on == _selected_item->info.clients_max)
w->disabled_state = (1<<17); // Server full, join button disabled
+#ifdef WITH_REV
+ else if (strncmp(_selected_item->info.server_revision, _openttd_revision, 10) != 0) {
+ if (strncmp(_selected_item->info.server_revision, "norev000", sizeof(_selected_item->info.server_revision)) != 0)
+ w->disabled_state = (1<<17); // Revision mismatch, join button disabled
+ }
+#endif
else
w->disabled_state = 0;
@@ -201,6 +207,14 @@
DrawString(260, y, STR_NETWORK_CURRENT_DATE, 2); // current date
y+=10;
+ y+=2;
+
+#ifdef WITH_REV
+ if (strncmp(_selected_item->info.server_revision, _openttd_revision, 10) != 0) {
+ if (strncmp(_selected_item->info.server_revision, "norev000", sizeof(_selected_item->info.server_revision)) != 0)
+ DrawStringMultiCenter(360, y, STR_NETWORK_VERSION_MISMATCH, 2); // server mismatch
+ } else
+#endif
if (_selected_item->info.clients_on == _selected_item->info.clients_max)
// Show: server full, when clients_on == clients_max
DrawStringMultiCenter(360, y, STR_NETWORK_SERVER_FULL, 2); // server full