More work on rejoin. This is still broken because the player id is not yet updated on client side, and the server still does not activate the rejoining player.

This commit is contained in:
lotodore
2011-09-11 20:38:18 +00:00
parent 945a8f4588
commit 2488ea43cd
6 changed files with 177 additions and 48 deletions
+1 -7
View File
@@ -1314,13 +1314,7 @@ ServerLobbyThread::HandleNetPacketRejoinGame(boost::shared_ptr<SessionData> sess
if (pos != m_gameMap.end()) {
boost::shared_ptr<ServerGame> game = pos->second;
// Verify that the user is allowed to rejoin.
boost::shared_ptr<PlayerInterface> tmpPlayer = game->GetPlayerInterfaceFromGame(session->GetPlayerData()->GetName());
if (tmpPlayer && tmpPlayer->getMyGuid() == session->GetPlayerData()->GetOldGuid()) {
MoveSessionToGame(game, session, autoLeave);
} else {
SendJoinGameFailed(session, rejoinGame.gameId, NTF_NET_JOIN_REJOIN_FAILED);
}
MoveSessionToGame(game, session, autoLeave);
} else {
SendJoinGameFailed(session, rejoinGame.gameId, NTF_NET_JOIN_GAME_INVALID);
}