Try to update the player name after rejoin, if another player was not active during rejoin.
This commit is contained in:
@@ -1725,6 +1725,11 @@ ClientStateWaitHand::InternalHandlePacket(boost::shared_ptr<ClientThread> client
|
|||||||
tmpPlayer->setMyStayOnTableStatus(true);
|
tmpPlayer->setMyStayOnTableStatus(true);
|
||||||
// Also update the dealer, if necessary.
|
// Also update the dealer, if necessary.
|
||||||
curGame->replaceDealer(idChanged->oldPlayerId, idChanged->newPlayerId);
|
curGame->replaceDealer(idChanged->oldPlayerId, idChanged->newPlayerId);
|
||||||
|
// Update the player name, if necessary.
|
||||||
|
PlayerInfo info;
|
||||||
|
if (client->GetCachedPlayerInfo(idChanged->newPlayerId, info)) {
|
||||||
|
tmpPlayer->setMyName(info.playerName);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -703,8 +703,8 @@ ClientThread::SetPlayerInfo(unsigned id, const PlayerInfo &info)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Update player data for current game.
|
// Update player data for current game.
|
||||||
boost::shared_ptr<PlayerData> playerData = GetPlayerDataByUniqueId(id);
|
boost::shared_ptr<PlayerData> playerData(GetPlayerDataByUniqueId(id));
|
||||||
if (playerData.get()) {
|
if (playerData) {
|
||||||
playerData->SetName(info.playerName);
|
playerData->SetName(info.playerName);
|
||||||
playerData->SetType(info.ptype);
|
playerData->SetType(info.ptype);
|
||||||
if (info.hasAvatar) {
|
if (info.hasAvatar) {
|
||||||
@@ -714,6 +714,12 @@ ClientThread::SetPlayerInfo(unsigned id, const PlayerInfo &info)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (GetGame()) {
|
||||||
|
boost::shared_ptr<PlayerInterface> clientPlayer(GetGame()->getPlayerByUniqueId(id));
|
||||||
|
if (clientPlayer)
|
||||||
|
clientPlayer->setMyName(info.playerName);
|
||||||
|
// Skip avatar here, the game is already running.
|
||||||
|
}
|
||||||
|
|
||||||
if (find(m_avatarShouldRequestList.begin(), m_avatarShouldRequestList.end(), id) != m_avatarShouldRequestList.end()) {
|
if (find(m_avatarShouldRequestList.begin(), m_avatarShouldRequestList.end(), id) != m_avatarShouldRequestList.end()) {
|
||||||
m_avatarShouldRequestList.remove(id);
|
m_avatarShouldRequestList.remove(id);
|
||||||
|
|||||||
Reference in New Issue
Block a user