summaryrefslogtreecommitdiff
path: root/src/net/partyhandler.cpp
diff options
context:
space:
mode:
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)