From c8d5cc16c92a7e77f19d8a0eebddf92537d1715e Mon Sep 17 00:00:00 2001 From: lotodore Date: Tue, 4 Aug 2009 22:24:31 +0000 Subject: [PATCH] Fixed kicking someone from the game in the lobby. Vote kick still seems to be broken, could not find the bug yet. --- src/net/common/clientstate.cpp | 24 +++++++++++++++++++++++- src/net/common/serverlobbythread.cpp | 1 + 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/src/net/common/clientstate.cpp b/src/net/common/clientstate.cpp index f17df4c8..48af75d4 100644 --- a/src/net/common/clientstate.cpp +++ b/src/net/common/clientstate.cpp @@ -756,7 +756,29 @@ AbstractClientStateReceiving::HandlePacket(boost::shared_ptr clien client->ResubscribeLobbyMsg(); // Show Lobby. client->GetCallback().SignalNetClientWaitDialog(); - client->GetCallback().SignalNetClientRemovedFromGame(netRemoved->removedFromGameReason); + int removeReason; + switch (netRemoved->removedFromGameReason) + { + case removedFromGameReason_kickedFromGame : + removeReason = NTF_NET_REMOVED_KICKED; + break; + case removedFromGameReason_gameIsFull : + removeReason = NTF_NET_REMOVED_GAME_FULL; + break; + case removedFromGameReason_gameIsRunning : + removeReason = NTF_NET_REMOVED_ALREADY_RUNNING; + break; + case removedFromGameReason_gameTimeout : + removeReason = NTF_NET_REMOVED_TIMEOUT; + break; + case removedFromGameReason_removedStartFailed : + removeReason = NTF_NET_REMOVED_START_FAILED; + break; + default : + removeReason = NTF_NET_REMOVED_ON_REQUEST; + break; + } + client->GetCallback().SignalNetClientRemovedFromGame(removeReason); client->SetState(ClientStateWaitJoin::Instance()); } else if (netGamePlayer->gamePlayerNotification.present == gamePlayerNotification_PR_gamePlayerLeft) diff --git a/src/net/common/serverlobbythread.cpp b/src/net/common/serverlobbythread.cpp index 12276a59..858eae9d 100644 --- a/src/net/common/serverlobbythread.cpp +++ b/src/net/common/serverlobbythread.cpp @@ -195,6 +195,7 @@ ServerLobbyThread::ReAddSession(SessionWrapper session, int reason) boost::shared_ptr packet(new NetPacket(NetPacket::Alloc)); packet->GetMsg()->present = PokerTHMessage_PR_gamePlayerMessage; GamePlayerMessage_t *netPlayerMsg = &packet->GetMsg()->choice.gamePlayerMessage; + netPlayerMsg->gameId = session.sessionData->GetGameId(); netPlayerMsg->gamePlayerNotification.present = gamePlayerNotification_PR_removedFromGame; RemovedFromGame_t *removed = &netPlayerMsg->gamePlayerNotification.choice.removedFromGame;