Properly mark player as kicked on client side.
This commit is contained in:
@@ -674,6 +674,10 @@ AbstractClientStateReceiving::HandlePacket(boost::shared_ptr<ClientThread> clien
|
|||||||
// A player left the game.
|
// A player left the game.
|
||||||
GamePlayerLeft_t *netLeft = &netGamePlayer->gamePlayerNotification.choice.gamePlayerLeft;
|
GamePlayerLeft_t *netLeft = &netGamePlayer->gamePlayerNotification.choice.gamePlayerLeft;
|
||||||
|
|
||||||
|
boost::shared_ptr<PlayerInterface> tmpPlayer = client->GetGame()->getPlayerByUniqueId(netLeft->playerId);
|
||||||
|
if (tmpPlayer) {
|
||||||
|
tmpPlayer->setIsKicked(netLeft->gamePlayerLeftReason == gamePlayerLeftReason_leftKicked);
|
||||||
|
}
|
||||||
// Signal to GUI and remove from data list.
|
// Signal to GUI and remove from data list.
|
||||||
client->RemovePlayerData(netLeft->playerId, netLeft->gamePlayerLeftReason);
|
client->RemovePlayerData(netLeft->playerId, netLeft->gamePlayerLeftReason);
|
||||||
} else if (netGamePlayer->gamePlayerNotification.present == gamePlayerNotification_PR_gameAdminChanged) {
|
} else if (netGamePlayer->gamePlayerNotification.present == gamePlayerNotification_PR_gameAdminChanged) {
|
||||||
|
|||||||
@@ -1167,7 +1167,9 @@ ClientThread::RemoveDisconnectedPlayers()
|
|||||||
if (tmpPlayer->getMyActiveStatus()) {
|
if (tmpPlayer->getMyActiveStatus()) {
|
||||||
// If a player is not in the player data list, it was disconnected.
|
// If a player is not in the player data list, it was disconnected.
|
||||||
if (!GetPlayerDataByUniqueId(tmpPlayer->getMyUniqueID()).get()) {
|
if (!GetPlayerDataByUniqueId(tmpPlayer->getMyUniqueID()).get()) {
|
||||||
//tmpPlayer->setMyCash(0);
|
if (tmpPlayer->isKicked()) {
|
||||||
|
tmpPlayer->setMyCash(0);
|
||||||
|
}
|
||||||
tmpPlayer->setMyActiveStatus(false);
|
tmpPlayer->setMyActiveStatus(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user