If a player rejects an invitation, he is no longer on the invite list.

This commit is contained in:
lotodore
2010-03-31 13:00:41 +00:00
parent 2e76454af7
commit aa8f673563
+6 -2
View File
@@ -1381,13 +1381,17 @@ ServerLobbyThread::HandleNetPacketRejectGameInvitation(SessionWrapper session, c
if (pos != m_gameMap.end() && session.playerData)
{
ServerGame &game = *pos->second;
if (game.IsPlayerInvited(session.playerData->GetUniqueId()))
unsigned tmpPlayerId = session.playerData->GetUniqueId();
if (game.IsPlayerInvited(tmpPlayerId))
{
// If he rejects, he is no longer invited.
game.RemovePlayerInvitation(tmpPlayerId);
// Send reject notification.
boost::shared_ptr<NetPacket> packet(new NetPacket(NetPacket::Alloc));
packet->GetMsg()->present = PokerTHMessage_PR_rejectInvNotifyMessage;
RejectInvNotifyMessage_t *netReject = &packet->GetMsg()->choice.rejectInvNotifyMessage;
netReject->gameId = reject.gameId;
netReject->playerId = session.playerData->GetUniqueId();
netReject->playerId = tmpPlayerId;
netReject->playerRejectReason = reject.myRejectReason;
game.SendToAllPlayers(packet, SessionData::Game);