boost timer: total_seconds instead of just seconds. Fixed bug where an invalid hand object was accessed. Only set action to "fold" for leaving players if they are active and are not fold.

This commit is contained in:
lotodore
2007-06-14 20:29:59 +00:00
parent 322dc3460b
commit 7345630c0d
6 changed files with 27 additions and 27 deletions
+9 -4
View File
@@ -162,7 +162,7 @@ ServerRecvThread::CloseSessionLoop()
{
CloseSessionList::iterator cur = i++;
if (cur->first.elapsed().seconds() >= SERVER_CLOSE_SESSION_DELAY_SEC)
if (cur->first.elapsed().total_seconds() >= SERVER_CLOSE_SESSION_DELAY_SEC)
m_closeSessionList.erase(cur);
}
}
@@ -396,9 +396,14 @@ ServerRecvThread::CloseSessionDelayed(SessionWrapper session)
PlayerInterface *player = GetGame().getPlayerByUniqueId(tmpPlayerData->GetUniqueId());
if (player)
{
player->setMyAction(PLAYER_ACTION_FOLD);
player->setMyCash(0);
player->setMyActiveStatus(false);
// Deactivate player (if active).
if (player->getMyActiveStatus())
{
if (player->getMyAction() != PLAYER_ACTION_FOLD)
player->setMyAction(PLAYER_ACTION_FOLD);
player->setMyCash(0);
player->setMyActiveStatus(false);
}
}
}