diff options
author | truelight <truelight@openttd.org> | 2004-12-13 16:15:21 +0000 |
---|---|---|
committer | truelight <truelight@openttd.org> | 2004-12-13 16:15:21 +0000 |
commit | a477d3655c79f0702c11a325e1ae54a0f86ef925 (patch) | |
tree | 555eaf553005479b3ee4c4b51f8d6fca2e9668f5 | |
parent | 5f83ee4554dafc7ec24ef6e56696a4e63525e2bc (diff) | |
download | openttd-a477d3655c79f0702c11a325e1ae54a0f86ef925.tar.xz |
(svn r1054) -Fix: [Network] Redid revision 1024, only a bit more nice this time
(revision length is back to 10, and checking is now done correctly)
-rw-r--r-- | network.h | 2 | ||||
-rw-r--r-- | network_gui.c | 6 | ||||
-rw-r--r-- | network_server.c | 2 |
3 files changed, 5 insertions, 5 deletions
@@ -39,7 +39,7 @@ #define NETWORK_NAME_LENGTH 80 #define NETWORK_HOSTNAME_LENGTH 80 -#define NETWORK_REVISION_LENGTH 20 +#define NETWORK_REVISION_LENGTH 10 #define NETWORK_PASSWORD_LENGTH 20 #define NETWORK_PLAYERS_LENGTH 200 diff --git a/network_gui.c b/network_gui.c index c6cf153a6..6a80a3fd8 100644 --- a/network_gui.c +++ b/network_gui.c @@ -88,7 +88,7 @@ static void NetworkGameWindowWndProc(Window *w, WindowEvent *e) 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) { + else if (strncmp(_selected_item->info.server_revision, _openttd_revision, NETWORK_REVISION_LENGTH - 1) != 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 } @@ -115,7 +115,7 @@ static void NetworkGameWindowWndProc(Window *w, WindowEvent *e) const NetworkGameList *cur_item = _network_game_list; while (cur_item != NULL) { #ifdef WITH_REV - bool compatible = (strncmp(cur_item->info.server_revision, _openttd_revision, 10) == 0); + bool compatible = (strncmp(cur_item->info.server_revision, _openttd_revision, NETWORK_REVISION_LENGTH - 1) == 0); #else bool compatible = true; // We have no idea if we are compatible... #endif @@ -210,7 +210,7 @@ static void NetworkGameWindowWndProc(Window *w, WindowEvent *e) y+=2; #ifdef WITH_REV - if (strncmp(_selected_item->info.server_revision, _openttd_revision, 10) != 0) { + if (strncmp(_selected_item->info.server_revision, _openttd_revision, NETWORK_REVISION_LENGTH - 1) != 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 diff --git a/network_server.c b/network_server.c index 3842960d5..35abd9ae1 100644 --- a/network_server.c +++ b/network_server.c @@ -580,7 +580,7 @@ DEF_SERVER_RECEIVE_COMMAND(PACKET_CLIENT_JOIN) #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) { + if (strncmp(_network_game_info.server_revision, client_revision, sizeof(_network_game_info.server_revision) - 1) != 0) { // Different revisions!! SEND_COMMAND(PACKET_SERVER_ERROR)(cs, NETWORK_ERROR_WRONG_REVISION); |