Fixing ticket #86: Change player id in ranking map on rejoin.
This commit is contained in:
@@ -358,6 +358,17 @@ ServerGame::SetPlayerPlace(unsigned playerId, int place)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
ServerGame::ReplaceRankingPlayer(unsigned oldPlayerId, unsigned newPlayerId)
|
||||||
|
{
|
||||||
|
RankingMap::iterator pos = m_rankingMap.find(oldPlayerId);
|
||||||
|
if (pos != m_rankingMap.end()) {
|
||||||
|
RankingData tmpData((*pos).second);
|
||||||
|
m_rankingMap[newPlayerId] = tmpData;
|
||||||
|
m_rankingMap.erase(pos);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
ServerGame::StoreAndResetRanking()
|
ServerGame::StoreAndResetRanking()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1360,6 +1360,8 @@ ServerGameStateHand::PerformRejoin(boost::shared_ptr<ServerGame> server, boost::
|
|||||||
|
|
||||||
// Update the dealer, if necessary.
|
// Update the dealer, if necessary.
|
||||||
curGame.replaceDealer(rejoinPlayer->getMyUniqueID(), session->GetPlayerData()->GetUniqueId());
|
curGame.replaceDealer(rejoinPlayer->getMyUniqueID(), session->GetPlayerData()->GetUniqueId());
|
||||||
|
// Update the ranking map.
|
||||||
|
server->ReplaceRankingPlayer(rejoinPlayer->getMyUniqueID(), session->GetPlayerData()->GetUniqueId());
|
||||||
// Change the Id in the poker engine.
|
// Change the Id in the poker engine.
|
||||||
rejoinPlayer->setMyUniqueID(session->GetPlayerData()->GetUniqueId());
|
rejoinPlayer->setMyUniqueID(session->GetPlayerData()->GetUniqueId());
|
||||||
rejoinPlayer->setMyGuid(session->GetPlayerData()->GetGuid());
|
rejoinPlayer->setMyGuid(session->GetPlayerData()->GetGuid());
|
||||||
|
|||||||
@@ -118,6 +118,7 @@ protected:
|
|||||||
void InitRankingMap(const PlayerDataList &playerDataList);
|
void InitRankingMap(const PlayerDataList &playerDataList);
|
||||||
void UpdateRankingMap();
|
void UpdateRankingMap();
|
||||||
void SetPlayerPlace(unsigned playerId, int place);
|
void SetPlayerPlace(unsigned playerId, int place);
|
||||||
|
void ReplaceRankingPlayer(unsigned oldPlayerId, unsigned newPlayerId);
|
||||||
void StoreAndResetRanking();
|
void StoreAndResetRanking();
|
||||||
void RemoveAutoLeavePlayers();
|
void RemoveAutoLeavePlayers();
|
||||||
void InternalEndGame();
|
void InternalEndGame();
|
||||||
|
|||||||
Reference in New Issue
Block a user