summaryrefslogtreecommitdiff
path: root/src/net/partyhandler.cpp
diff options
context:
space:
mode:
authorDavid Athay <ko2fan@gmail.com>2008-04-22 15:19:03 +0000
committerDavid Athay <ko2fan@gmail.com>2008-04-22 15:19:03 +0000
commitee6cd05382e4933bac8a6d6c007f112ac37a9f36 (patch)
tree2610454f1be16dc9a5e5531d68c3deab2503705f /src/net/partyhandler.cpp
parentb8b4a6346a5fe4a8e1719fc476ab6c6f714446a6 (diff)
downloadmana-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.cpp23
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)