diff options
author | David Athay <ko2fan@gmail.com> | 2008-04-22 15:19:03 +0000 |
---|---|---|
committer | David Athay <ko2fan@gmail.com> | 2008-04-22 15:19:03 +0000 |
commit | ee6cd05382e4933bac8a6d6c007f112ac37a9f36 (patch) | |
tree | 2610454f1be16dc9a5e5531d68c3deab2503705f /src/net/partyhandler.cpp | |
parent | b8b4a6346a5fe4a8e1719fc476ab6c6f714446a6 (diff) | |
download | mana-ee6cd05382e4933bac8a6d6c007f112ac37a9f36.tar.gz mana-ee6cd05382e4933bac8a6d6c007f112ac37a9f36.tar.bz2 mana-ee6cd05382e4933bac8a6d6c007f112ac37a9f36.tar.xz mana-ee6cd05382e4933bac8a6d6c007f112ac37a9f36.zip |
Added more support for parties
Diffstat (limited to 'src/net/partyhandler.cpp')
-rw-r--r-- | src/net/partyhandler.cpp | 23 |
1 files changed, 20 insertions, 3 deletions
diff --git a/src/net/partyhandler.cpp b/src/net/partyhandler.cpp index 91f0014e..527797e3 100644 --- a/src/net/partyhandler.cpp +++ b/src/net/partyhandler.cpp @@ -40,7 +40,9 @@ PartyHandler::PartyHandler() { static const Uint16 _messages[] = { - CPMSG_PARTY_CREATE_RESPONSE, + CPMSG_PARTY_INVITE_RESPONSE, + CPMSG_PARTY_INVITED, + CPMSG_PARTY_ACCEPT_INVITE_RESPONSE, CPMSG_PARTY_QUIT_RESPONSE, 0 }; @@ -52,14 +54,29 @@ void PartyHandler::handleMessage(MessageIn &msg) { switch (msg.getId()) { - case CPMSG_PARTY_CREATE_RESPONSE: + case CPMSG_PARTY_INVITE_RESPONSE: { if (msg.readInt8() == ERRMSG_OK) { - player_node->setInParty(true); + if (!player_node->getInParty()) + player_node->setInParty(true); } } break; + case CPMSG_PARTY_INVITED: + { + //TODO: Show dialog to player asking to join party + std::string inviter = msg.readString(); + } break; + + case CPMSG_PARTY_ACCEPT_INVITE_RESPONSE: + { + if (msg.readInt8() == ERRMSG_OK) + { + player_node->setInParty(true); + } + } + case CPMSG_PARTY_QUIT_RESPONSE: { if (msg.readInt8() == ERRMSG_OK) |