(svn r15157) -Codechange: wrap the hostname/ip and port into a single structure so we can pass either one of them and not convert an ip to a string and then back again.

This commit is contained in:
rubidium
2009-01-20 01:32:06 +00:00
parent 6e1af6a051
commit 5f3772a42c
10 changed files with 155 additions and 56 deletions

View File

@@ -681,7 +681,7 @@ int ttd_main(int argc, char *argv[])
ParseConnectionString(&not_used, &port, debuglog_conn);
if (port != NULL) rport = atoi(port);
NetworkStartDebugLog(debuglog_conn, rport);
NetworkStartDebugLog(NetworkAddress(debuglog_conn, rport));
}
#endif /* ENABLE_NETWORK */
@@ -728,7 +728,7 @@ int ttd_main(int argc, char *argv[])
LoadIntroGame();
_switch_mode = SM_NONE;
NetworkClientConnectGame(network_conn, rport);
NetworkClientConnectGame(NetworkAddress(network_conn, rport));
}
}
#endif /* ENABLE_NETWORK */
@@ -1219,7 +1219,7 @@ void GameLoop()
if (_network_reconnect > 0 && --_network_reconnect == 0) {
/* This means that we want to reconnect to the last host
* We do this here, because it means that the network is really closed */
NetworkClientConnectGame(_settings_client.network.last_host, _settings_client.network.last_port);
NetworkClientConnectGame(NetworkAddress(_settings_client.network.last_host, _settings_client.network.last_port));
}
/* Singleplayer */
StateGameLoop();