First parts of implementation of invite system in server.

This commit is contained in:
lotodore
2010-03-30 12:07:48 +00:00
parent f8d68d30c7
commit 499c2b72e6
6 changed files with 54 additions and 2 deletions
+11
View File
@@ -1390,6 +1390,9 @@ ClientStateWaitJoin::InternalHandlePacket(boost::shared_ptr<ClientThread> client
case joinGameFailureReason_notAllowedAsGuest :
failureCode = NTF_NET_JOIN_GUEST_FORBIDDEN;
break;
case joinGameFailureReason_notInvited :
failureCode = NTF_NET_JOIN_NOT_INVITED;
break;
default :
failureCode = NTF_NET_INTERNAL;
break;
@@ -1398,6 +1401,14 @@ ClientStateWaitJoin::InternalHandlePacket(boost::shared_ptr<ClientThread> client
client->GetCallback().SignalNetClientNotification(failureCode);
}
}
else if (tmpPacket->GetMsg()->present == PokerTHMessage_PR_inviteNotifyMessage)
{
InviteNotifyMessage_t *netInvNotify = &tmpPacket->GetMsg()->choice.inviteNotifyMessage;
if (netInvNotify->playerIdWho == client->GetGuiPlayerId())
{
client->GetCallback().SignalSelfGameInvitation(netInvNotify->gameId, netInvNotify->playerIdByWhom);
}
}
}
//-----------------------------------------------------------------------------