diff options
author | signde <signde@openttd.org> | 2004-09-11 19:34:11 +0000 |
---|---|---|
committer | signde <signde@openttd.org> | 2004-09-11 19:34:11 +0000 |
commit | 1fb915df69aaa77ec8be39bb96650e5ec568e245 (patch) | |
tree | a7f24d905e8470f6331b816f08ef922fb43b8532 /network_gui.c | |
parent | d03afadad23fced4bbb11df12a01f26cdbaf6844 (diff) | |
download | openttd-1fb915df69aaa77ec8be39bb96650e5ec568e245.tar.xz |
(svn r207) -Codechange: randomizer handling
-Fix: desync problem fixes
-Fix: server doesnt hang anymore when a client timed out
-Feature: low latency connection enhancements [*net_sync_freq, *net_ready_ahead]
Diffstat (limited to 'network_gui.c')
-rw-r--r-- | network_gui.c | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/network_gui.c b/network_gui.c index 31e26dd6d..200c924b1 100644 --- a/network_gui.c +++ b/network_gui.c @@ -31,10 +31,17 @@ static byte _players_max; * we'll just use some dummy here */ static byte _network_connection; +static uint16 _network_game_count_last; static void NetworkGameWindowWndProc(Window *w, WindowEvent *e) { switch(e->event) { + case WE_TICK: { + if (_network_game_count_last != _network_game_count) { + SetWindowDirty(w); + } + } + break; case WE_PAINT: { SET_DPARAM16(0, 0x00); @@ -86,8 +93,18 @@ static void NetworkGameWindowWndProc(Window *w, WindowEvent *e) case WE_DROPDOWN_SELECT: /* we have selected a dropdown item in the list */ _network_connection = e->dropdown.index; - - SetWindowDirty(w); + switch (_network_connection) { + case 0: + NetworkGameListFromLAN(); + _network_game_count_last = _network_game_count; + SetWindowDirty(w); + break; + case 1: + NetworkGameListFromInternet(); + _network_game_count_last = _network_game_count; + SetWindowDirty(w); + break; + } break; case WE_MOUSELOOP: @@ -164,6 +181,7 @@ void ShowNetworkGameWindow() w = AllocateWindowDesc(&_network_game_window_desc); strcpy(_edit_str_buf, "Your name"); + _network_game_count_last = _network_game_count; WP(w,querystr_d).caret = 1; WP(w,querystr_d).maxlen = MAX_QUERYSTR_LEN; |