summaryrefslogtreecommitdiff
path: root/main_gui.c
diff options
context:
space:
mode:
authortruelight <truelight@openttd.org>2004-12-15 21:13:52 +0000
committertruelight <truelight@openttd.org>2004-12-15 21:13:52 +0000
commitfa1f026367aeb862b0cecd5c29cf680e37b45b3d (patch)
tree7dad5cae0e7fb3089a2b3e52a45d1b9e3a90e1f0 /main_gui.c
parent9595ee80e3014ea90d2680e1c9135fb01532e0c0 (diff)
downloadopenttd-fa1f026367aeb862b0cecd5c29cf680e37b45b3d.tar.xz
(svn r1108) -Fix: [Network] Fixed problem around slow clients:
They joined, they got the map, but it took some time before the new player was created. In this time a player could do stuff, causing a player-id-mismatch, and the player was kicked out. Now a player get's a nice GUI which says: registering.. When that is gone, the player is joined and can play safely. Tnx to Moriarty for bugging me with this bug ;)
Diffstat (limited to 'main_gui.c')
-rw-r--r--main_gui.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/main_gui.c b/main_gui.c
index ce5f3cb1e..765ef1935 100644
--- a/main_gui.c
+++ b/main_gui.c
@@ -2229,7 +2229,7 @@ static void MainWindowWndProc(Window *w, WindowEvent *e) {
DrawSprite(SPR_OTTD_T, off_x + 34, 50);
DrawSprite(SPR_OTTD_T, off_x + 65, 50);
DrawSprite(SPR_OTTD_D, off_x + 96, 50);
-
+
/*
DrawSprite(SPR_OTTD_R, off_x + 119, 50);
DrawSprite(SPR_OTTD_A, off_x + 148, 50);
@@ -2323,8 +2323,8 @@ static void MainWindowWndProc(Window *w, WindowEvent *e) {
ShowBuildRailToolbar(_last_built_railtype, 4);
break;
- case 'L':
- ShowTerraformToolbar();
+ case 'L':
+ ShowTerraformToolbar();
break;
case 'X':
@@ -2332,9 +2332,9 @@ static void MainWindowWndProc(Window *w, WindowEvent *e) {
MarkWholeScreenDirty();
break;
- case WKC_BACKQUOTE:
- IConsoleSwitch();
- e->keypress.cont=false;
+ case WKC_BACKQUOTE:
+ IConsoleSwitch();
+ e->keypress.cont=false;
break;
#ifdef ENABLE_NETWORK
@@ -2356,6 +2356,7 @@ static void MainWindowWndProc(Window *w, WindowEvent *e) {
void ShowSelectGameWindow();
+extern void ShowJoinStatusWindowAfterJoin();
void SetupColorsAndInitialWindow()
{
@@ -2405,6 +2406,10 @@ void SetupColorsAndInitialWindow()
WP(w,def_d).data_1 = -1280;
+ /* Bring joining GUI to front till the client is really joined */
+ if (_networking && !_network_server)
+ ShowJoinStatusWindowAfterJoin();
+
break;
case GM_EDITOR:
w = AllocateWindow(0, 0, width, height, MainWindowWndProc, 0, NULL);