1
0
mirror of https://github.com/OpenTTD/OpenTTD.git synced 2025-08-16 11:09:11 +00:00

(svn r1052) -Fix: [Network] You can't join a server when revision mismatches.

This commit is contained in:
truelight
2004-12-13 14:57:58 +00:00
parent c0247e66e8
commit 1c4c5ae370
2 changed files with 15 additions and 0 deletions

View File

@@ -1227,6 +1227,7 @@ STR_NETWORK_CURRENT_DATE :{SILVER}Current date: {WHITE}{DATE_SHORT}
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

View File

@@ -87,6 +87,12 @@ static void NetworkGameWindowWndProc(Window *w, WindowEvent *e)
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 @@ static void NetworkGameWindowWndProc(Window *w, WindowEvent *e)
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