Changed network code for new player lists.

This commit is contained in:
lotodore
2007-09-27 14:17:07 +00:00
parent c469eb5848
commit 78bf4820af
11 changed files with 160 additions and 220 deletions
+6 -3
View File
@@ -302,15 +302,18 @@ ServerGameThread::RemoveDisconnectedPlayers()
// This should only be called between hands.
if (m_game.get())
{
for (int i = 0; i < m_game->getStartQuantityPlayers(); i++)
PlayerListIterator i = m_game->getSeatsList()->begin();
PlayerListIterator end = m_game->getSeatsList()->end();
while (i != end)
{
boost::shared_ptr<PlayerInterface> tmpPlayer = m_game->getPlayerArray()[i];
boost::shared_ptr<PlayerInterface> tmpPlayer = *i;
if (!GetSessionManager().IsPlayerConnected(tmpPlayer->getMyUniqueID()) && tmpPlayer->getMyType() == PLAYER_TYPE_HUMAN)
{
// Setting player cash to 0 will deactivate the player.
tmpPlayer->setMyCash(0);
tmpPlayer->setMyActiveStatus(false);
tmpPlayer->setNetSessionData(boost::shared_ptr<SessionData>());
}
++i;
}
}
}