diff options
author | Stefan Dombrowski <stefan@uni-bonn.de> | 2011-05-15 15:15:48 +0200 |
---|---|---|
committer | Stefan Dombrowski <stefan@uni-bonn.de> | 2011-05-15 15:15:48 +0200 |
commit | dbfee8acae48ee1eec46d049656e83e952686ece (patch) | |
tree | ba39bbfd9851c32d1d32ead544a88a245c8bf434 /src/net/manaserv/partyhandler.cpp | |
parent | 15beafcf8c2c489187a1233d03937b0e1eeb130a (diff) | |
download | mana-client-dbfee8acae48ee1eec46d049656e83e952686ece.tar.gz mana-client-dbfee8acae48ee1eec46d049656e83e952686ece.tar.bz2 mana-client-dbfee8acae48ee1eec46d049656e83e952686ece.tar.xz mana-client-dbfee8acae48ee1eec46d049656e83e952686ece.zip |
Starting to fix party invite
Diffstat (limited to 'src/net/manaserv/partyhandler.cpp')
-rw-r--r-- | src/net/manaserv/partyhandler.cpp | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/src/net/manaserv/partyhandler.cpp b/src/net/manaserv/partyhandler.cpp index b30d5391..3af54f26 100644 --- a/src/net/manaserv/partyhandler.cpp +++ b/src/net/manaserv/partyhandler.cpp @@ -60,6 +60,8 @@ PartyHandler::PartyHandler(): }; handledMessages = _messages; partyHandler = this; + + mParty->setName("Party"); } void PartyHandler::handleMessage(Net::MessageIn &msg) @@ -83,10 +85,16 @@ void PartyHandler::handleMessage(Net::MessageIn &msg) { if (msg.readInt8() == ERRMSG_OK) { - // - SERVER_NOTICE(_("Joined party.")); + player_node->setParty(mParty); + while (msg.getUnreadLength()) + { + std::string name = msg.readString(); + mParty->addMember(0, name); + } } - } + else + SERVER_NOTICE(_("Joining party failed.")); + } break; case CPMSG_PARTY_QUIT_RESPONSE: { @@ -99,13 +107,13 @@ void PartyHandler::handleMessage(Net::MessageIn &msg) case CPMSG_PARTY_NEW_MEMBER: { - int id = msg.readInt16(); // being id + int id = msg.readInt32(); std::string name = msg.readString(); SERVER_NOTICE(strprintf(_("%s joined the party."), name.c_str())); - if (id == player_node->getId()) + if (name == player_node->getName()) player_node->setParty(mParty); mParty->addMember(id, name); @@ -113,7 +121,7 @@ void PartyHandler::handleMessage(Net::MessageIn &msg) case CPMSG_PARTY_MEMBER_LEFT: { - mParty->removeMember(msg.readString()); + // mParty->removeMember(msg.readString()); } break; case CPMSG_PARTY_REJECTED: |