Send notification to clients when a game in the lobby was started. Mark games as running in lobby dialog.

This commit is contained in:
lotodore
2007-09-29 20:20:01 +00:00
parent 43103d6fea
commit aaf4106c20
15 changed files with 72 additions and 18 deletions
+7 -8
View File
@@ -158,6 +158,8 @@ ServerGameThread::Main()
void
ServerGameThread::InternalStartGame()
{
GetLobbyThread().NotifyStartingGame(GetId());
// Set order of players.
AssignPlayerNumbers();
@@ -180,19 +182,16 @@ ServerGameThread::InternalStartGame()
PlayerDataList::const_iterator player_i = playerData.begin();
PlayerDataList::const_iterator player_end = playerData.end();
bool randDealerFound = false;
int tmpPos = 0;
while (player_i != player_end)
{
if ((*player_i)->GetNumber() == tmpDealerPos)
{
// Get ID of the dealer.
startData.startDealerPlayerId = static_cast<unsigned>((*player_i)->GetUniqueId());
randDealerFound = true;
startData.startDealerPlayerId = static_cast<unsigned>((*player_i)->GetUniqueId());
if (tmpPos == tmpDealerPos)
break;
}
++tmpPos;
++player_i;
}
assert(randDealerFound); // TODO: Throw exception.
assert(player_i != player_end);
SetStartData(startData);