summaryrefslogtreecommitdiff
path: root/network_udp.c
diff options
context:
space:
mode:
authorDarkvater <darkvater@openttd.org>2006-01-25 19:03:50 +0000
committerDarkvater <darkvater@openttd.org>2006-01-25 19:03:50 +0000
commit2b287a9e72c0b717f9d39915441a0d681611124b (patch)
tree75d7c397982c18c2480f8bf3c9c44629f76776f3 /network_udp.c
parent0d80c70b5f1d29ac2fc2145ec5720dfb001e8eba (diff)
downloadopenttd-2b287a9e72c0b717f9d39915441a0d681611124b.tar.xz
(svn r3429) - Feature (Followup): Change the gamelist window to accomodate for the new information.
Diffstat (limited to 'network_udp.c')
-rw-r--r--network_udp.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/network_udp.c b/network_udp.c
index 3248b98a1..154214621 100644
--- a/network_udp.c
+++ b/network_udp.c
@@ -93,6 +93,7 @@ DEF_UDP_RECEIVE_COMMAND(PACKET_UDP_CLIENT_FIND_SERVER)
DEF_UDP_RECEIVE_COMMAND(PACKET_UDP_SERVER_RESPONSE)
{
+ extern const char _openttd_revision[];
NetworkGameList *item;
byte game_info_version;
@@ -102,15 +103,14 @@ DEF_UDP_RECEIVE_COMMAND(PACKET_UDP_SERVER_RESPONSE)
game_info_version = NetworkRecv_uint8(&_udp_cs, p);
- if (_udp_cs.quited)
- return;
+ if (_udp_cs.quited) return;
DEBUG(net, 6)("[NET][UDP] Server response from %s:%d", inet_ntoa(client_addr->sin_addr),ntohs(client_addr->sin_port));
// Find next item
item = NetworkGameListAddItem(inet_addr(inet_ntoa(client_addr->sin_addr)), ntohs(client_addr->sin_port));
- /* Please observe the order. In the order in which packets are sent
+ /* Please observer the order. In the order in which packets are sent
* they are to be received */
switch (game_info_version) {
case 2:
@@ -142,6 +142,12 @@ DEF_UDP_RECEIVE_COMMAND(PACKET_UDP_SERVER_RESPONSE)
if (item->info.hostname[0] == '\0')
snprintf(item->info.hostname, sizeof(item->info.hostname), "%s", inet_ntoa(client_addr->sin_addr));
+
+ /* Check if we are allowed on this server based on the revision-match */
+ item->info.compatible = (
+ strncmp(item->info.server_revision, _openttd_revision, NETWORK_REVISION_LENGTH) == 0 ||
+ strncmp(item->info.server_revision, NOREV_STRING, NETWORK_REVISION_LENGTH) == 0) ? true : false;
+
break;
}