client and server related crash fixes

This commit is contained in:
Max-Wilhelm Bruker 2009-08-06 16:51:11 +02:00
parent a2b30dc86f
commit 33546c6b74
8 changed files with 26 additions and 18 deletions

View file

@ -35,12 +35,15 @@ ServerGame::~ServerGame()
QString ServerGame::getGameListLine() const
{
return QString("list_games|%1|%2|%3|%4|%5|%6").arg(gameId)
.arg(description)
.arg(password.isEmpty() ? 0 : 1)
.arg(players.size())
.arg(maxPlayers)
.arg(creator->getPlayerName());
if (players.isEmpty())
return QString("list_games|%1|||0|%2|").arg(gameId).arg(maxPlayers);
else
return QString("list_games|%1|%2|%3|%4|%5|%6").arg(gameId)
.arg(description)
.arg(password.isEmpty() ? 0 : 1)
.arg(players.size())
.arg(maxPlayers)
.arg(creator->getPlayerName());
}
QStringList ServerGame::getPlayerNames() const