On rejoin, send full seats list, not only active players, so that the seatStatus can be updated properly.

This commit is contained in:
lotodore
2011-12-27 09:05:50 +00:00
parent de7a06da44
commit 4c15195f07
2 changed files with 8 additions and 8 deletions
+7 -7
View File
@@ -1371,15 +1371,15 @@ ServerGameStateHand::PerformRejoin(boost::shared_ptr<ServerGame> server, boost::
netStartModeRejoin->handNum = curGame.getCurrentHandID(); netStartModeRejoin->handNum = curGame.getCurrentHandID();
PlayerListIterator player_i = curGame.getSeatsList()->begin(); PlayerListIterator player_i = curGame.getSeatsList()->begin();
PlayerListIterator player_end = curGame.getSeatsList()->end(); PlayerListIterator player_end = curGame.getSeatsList()->end();
while (player_i != player_end) { int player_count = 0;
while (player_i != player_end && player_count < server->GetStartData().numberOfPlayers) {
boost::shared_ptr<PlayerInterface> tmpPlayer = *player_i; boost::shared_ptr<PlayerInterface> tmpPlayer = *player_i;
if (tmpPlayer->getMyActiveStatus()) { RejoinPlayerData_t *playerSlot = (RejoinPlayerData_t *)calloc(1, sizeof(RejoinPlayerData_t));
RejoinPlayerData_t *playerSlot = (RejoinPlayerData_t *)calloc(1, sizeof(RejoinPlayerData_t)); playerSlot->playerId = tmpPlayer->getMyUniqueID();
playerSlot->playerId = tmpPlayer->getMyUniqueID(); playerSlot->playerMoney = tmpPlayer->getMyCash();
playerSlot->playerMoney = tmpPlayer->getMyCash(); ASN_SEQUENCE_ADD(&netStartModeRejoin->rejoinPlayerData.list, playerSlot);
ASN_SEQUENCE_ADD(&netStartModeRejoin->rejoinPlayerData.list, playerSlot);
}
++player_i; ++player_i;
++player_count;
} }
server->GetLobbyThread().GetSender().Send(session, packet); server->GetLobbyThread().GetSender().Send(session, packet);
+1 -1
View File
@@ -21,7 +21,7 @@
using namespace std; using namespace std;
PlayerData::PlayerData(unsigned uniqueId, int number, PlayerType type, PlayerRights rights, bool isGameAdmin) PlayerData::PlayerData(unsigned uniqueId, int number, PlayerType type, PlayerRights rights, bool isGameAdmin)
: m_uniqueId(uniqueId), m_dbId(DB_ID_INVALID), m_number(number), m_startCash(0), m_type(type), m_rights(rights), m_isGameAdmin(isGameAdmin) : m_uniqueId(uniqueId), m_dbId(DB_ID_INVALID), m_number(number), m_startCash(-1), m_type(type), m_rights(rights), m_isGameAdmin(isGameAdmin)
{ {
} }