summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2009-04-24 10:52:51 +0000
committerrubidium <rubidium@openttd.org>2009-04-24 10:52:51 +0000
commit169a003e9a66dc23ea42b22c11b0f1f0b23fcd1f (patch)
tree8c1e329196864a413f9714e35bd38cc891e581e9 /src
parent5db32d1dc599fad0f688d6e1f73cdae5ba660922 (diff)
downloadopenttd-169a003e9a66dc23ea42b22c11b0f1f0b23fcd1f.tar.xz
(svn r16135) -Fix [FS#2856]: always give the server an already resolved 'client address' so we can be sure the client address is always resolved
Diffstat (limited to 'src')
-rw-r--r--src/network/network.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/network/network.cpp b/src/network/network.cpp
index d2d276495..cb49c1ea0 100644
--- a/src/network/network.cpp
+++ b/src/network/network.cpp
@@ -748,6 +748,11 @@ static void NetworkInitGameInfo()
NetworkClientInfo *ci = new NetworkClientInfo(CLIENT_ID_SERVER);
ci->client_playas = _network_dedicated ? COMPANY_SPECTATOR : _local_company;
+ /* Give the server a valid IP; banning it is pointless anyways */
+ sockaddr_in sock;
+ memset(&sock, 0, sizeof(sock));
+ sock.sin_family = AF_INET;
+ ci->client_address = NetworkAddress((sockaddr*)&sock, sizeof(sock));
strecpy(ci->client_name, _settings_client.network.client_name, lastof(ci->client_name));
strecpy(ci->unique_id, _settings_client.network.network_id, lastof(ci->unique_id));