Skip to content

Commit

Permalink
Fix multiple issues with lobby console output.
Browse files Browse the repository at this point in the history
Conflicts:
	src/console.cpp

Fixes ticket:4403.
  • Loading branch information
vexed authored and Cyp committed May 22, 2016
1 parent 73dba8a commit c308051
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 9 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -132,6 +132,7 @@ Makefile.in
/po/remove-potcdate.sed
/po/stamp-po
/po/warzone2100.pot
/po/custom/fromJson.txt
/compile
/test-driver

Expand Down
2 changes: 1 addition & 1 deletion lib/netplay/netplay.cpp
Expand Up @@ -2946,7 +2946,7 @@ bool NETfindGame(void)
SocketSet_DelSocket(socket_set, tcp_socket); // mark it invalid (we are done with it)
socketClose(tcp_socket);
tcp_socket = NULL;
addConsoleMessage(NetPlay.MOTD, DEFAULT_JUSTIFY, SYSTEM_MESSAGE);

return true;
}

Expand Down
24 changes: 18 additions & 6 deletions src/multiint.cpp
Expand Up @@ -919,8 +919,10 @@ bool joinGame(const char *host, uint32_t port)
changeTitleMode(GAMEFIND);

// Shows the lobby error.
addGames();
addConsoleBox();
addGames();
updateConsoleMessages();
displayConsoleMessages();
return false;
}
ingame.localJoiningInProgress = true;
Expand Down Expand Up @@ -1125,6 +1127,14 @@ static void addGames(void)

widgAddButton(psWScreen, &sButInit);
}
if (strlen(NetPlay.MOTD))
{
permitNewConsoleMessages(true);
addConsoleMessage(NetPlay.MOTD, DEFAULT_JUSTIFY, SYSTEM_MESSAGE);
}
setConsolePermanence(false, false);
updateConsoleMessages();
displayConsoleMessages();
}

static void removeGames(void)
Expand All @@ -1149,6 +1159,7 @@ void runGameFind(void)
if (gameTime - lastupdate > 6000 && !EnablePasswordPrompt)
{
lastupdate = gameTime;
addConsoleBox();
if (safeSearch)
{
if (!NETfindGame()) // find games synchronously
Expand All @@ -1157,7 +1168,6 @@ void runGameFind(void)
}
}
addGames(); //redraw list
addConsoleBox();
}

WidgetTriggers const &triggers = widgRunScreen(psWScreen);
Expand All @@ -1180,12 +1190,13 @@ void runGameFind(void)
widgSetButtonState(psWScreen, MULTIOP_FILTER_TOGGLE, 0);
}
ingame.localOptionsReceived = true;
addConsoleBox();
if (!NETfindGame()) // find games synchronously
{
pie_LoadBackDrop(SCREEN_RANDOMBDROP);
}
addConsoleMessage(_("Refreshing..."), DEFAULT_JUSTIFY, NOTIFY_MESSAGE);
addGames(); //redraw list.
addConsoleBox();
}
if (id == CON_PASSWORD)
{
Expand Down Expand Up @@ -1277,12 +1288,13 @@ void startGameFind(void)
widgHide(psWScreen, MULTIOP_FILTER_TOGGLE);
}

addConsoleBox();
if (!NETfindGame())
{
pie_LoadBackDrop(SCREEN_RANDOMBDROP);
}

addGames(); // now add games.
addConsoleBox();
displayConsoleMessages();

// Password stuff. Hidden by default.
Expand Down Expand Up @@ -1344,8 +1356,8 @@ static void hidePasswordForm(void)
widgReveal(psWScreen, MULTIOP_FILTER_TOGGLE);
}
}
addGames();
addConsoleBox();
addGames();
}

static void showPasswordForm(void)
Expand Down Expand Up @@ -2665,7 +2677,7 @@ static void addConsoleBox(void)
setConsolePermanence(true, true);
setConsoleLineInfo(3); // use x lines on chat window

addConsoleMessage(_("Connecting to the lobby server..."), DEFAULT_JUSTIFY, SYSTEM_MESSAGE);
addConsoleMessage(_("Connecting to the lobby server..."), DEFAULT_JUSTIFY, NOTIFY_MESSAGE);
displayConsoleMessages();
return;
}
Expand Down
4 changes: 2 additions & 2 deletions src/multiint.h
Expand Up @@ -255,9 +255,9 @@ void loadMapPreview(bool hideInterface);

#define MULTIOP_CONSOLEBOX 0x1A001 // TODO: these should be enums!
#define MULTIOP_CONSOLEBOXX MULTIOP_OPTIONSX
#define MULTIOP_CONSOLEBOXY 432
#define MULTIOP_CONSOLEBOXY 422
#define MULTIOP_CONSOLEBOXW ((MULTIOP_PLAYERSX + MULTIOP_PLAYERSW) - MULTIOP_OPTIONSX)
#define MULTIOP_CONSOLEBOXH 48
#define MULTIOP_CONSOLEBOXH 54

#define MULTIOP_CHATEDIT 10279
#define MULTIOP_CHATEDITX 4
Expand Down

0 comments on commit c308051

Please sign in to comment.