(svn r1162) The server list can now be automatically filled from the config file. Add a section [servers] with the addresses each in a new line. Those will be checked upon OpenTTD startup.

This commit is contained in:
dominik
2004-12-18 18:58:03 +00:00
parent b9779176d5
commit 853c11d301
4 changed files with 41 additions and 26 deletions

View File

@@ -317,22 +317,7 @@ static void NetworkGameWindowWndProc(Window *w, WindowEvent *e)
break;
case WE_ON_EDIT_TEXT: {
byte *b = e->edittext.str;
if (*b != 0) {
const byte *port = NULL;
const byte *player = NULL;
uint16 rport;
ttd_strlcpy(_network_default_ip, b, lengthof(_network_default_ip));
rport = NETWORK_DEFAULT_PORT;
ParseConnectionString(&player, &port, b);
if (player != NULL) _network_playas = atoi(player);
if (port != NULL) rport = atoi(port);
NetworkQueryServer(b, rport, true);
}
AddServer(e->edittext.str);
} break;
case WE_CREATE: {
@@ -387,7 +372,6 @@ void ShowNetworkGameWindow()
Window *w;
DeleteWindowById(WC_NETWORK_WINDOW, 0);
// NetworkLobbyInit();
w = AllocateWindowDesc(&_network_game_window_desc);
ttd_strlcpy(_edit_str_buf, _network_player_name, MAX_QUERYSTR_LEN);
w->vscroll.cap = 8;