diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-10-06 16:02:21 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-10-06 16:02:21 +0300 |
commit | 5a3e68f8de3479c468b7683373b2c0d70344b9f8 (patch) | |
tree | 3b5a13554d7e6883ec63ef8969d86e28641958fd /src/net | |
parent | ff86d5fbc7db586c05e51c99f052bbae4ebe44cc (diff) | |
download | plus-5a3e68f8de3479c468b7683373b2c0d70344b9f8.tar.gz plus-5a3e68f8de3479c468b7683373b2c0d70344b9f8.tar.bz2 plus-5a3e68f8de3479c468b7683373b2c0d70344b9f8.tar.xz plus-5a3e68f8de3479c468b7683373b2c0d70344b9f8.zip |
Add missing party leave statuses.
Diffstat (limited to 'src/net')
-rw-r--r-- | src/net/ea/partyhandler.cpp | 55 |
1 files changed, 50 insertions, 5 deletions
diff --git a/src/net/ea/partyhandler.cpp b/src/net/ea/partyhandler.cpp index b1d6845f5..0258bd2c6 100644 --- a/src/net/ea/partyhandler.cpp +++ b/src/net/ea/partyhandler.cpp @@ -188,20 +188,43 @@ void PartyHandler::processPartyMove(Net::MessageIn &msg) const void PartyHandler::processPartyLeave(Net::MessageIn &msg) const { - const int id = msg.readInt32(); - const std::string nick = msg.readString(24); - msg.readUInt8(); // fail + const int id = msg.readInt32("account id"); + const std::string nick = msg.readString(24, "nick"); + const int reason = msg.readUInt8("flag"); if (!localPlayer) return; if (id == localPlayer->getId()) { + switch (reason) + { + case 0: + default: + NotifyManager::notify(NotifyTypes::PARTY_LEFT); + break; + + case 1: + NotifyManager::notify(NotifyTypes::PARTY_KICKED); + break; + + case 2: + NotifyManager::notify(NotifyTypes::PARTY_LEFT_DENY); + break; + + case 3: + NotifyManager::notify(NotifyTypes::PARTY_KICK_DENY); + break; + } + + if (reason >= 2) + return; + if (Ea::taParty) { Ea::taParty->removeFromMembers(); Ea::taParty->clearMembers(); } - NotifyManager::notify(NotifyTypes::PARTY_LEFT); + delete2(Ea::partyTab) if (socialWindow && Ea::taParty) @@ -210,7 +233,29 @@ void PartyHandler::processPartyLeave(Net::MessageIn &msg) const } else { - NotifyManager::notify(NotifyTypes::PARTY_USER_LEFT, nick); + switch (reason) + { + case 0: + default: + NotifyManager::notify(NotifyTypes::PARTY_USER_LEFT, nick); + break; + + case 1: + NotifyManager::notify(NotifyTypes::PARTY_USER_KICKED, nick); + break; + + case 2: + NotifyManager::notify(NotifyTypes::PARTY_USER_LEFT_DENY, nick); + break; + + case 3: + NotifyManager::notify(NotifyTypes::PARTY_USER_KICK_DENY, nick); + break; + } + + if (reason >= 2) + return; + if (actorManager) { Being *const b = actorManager->findBeing(id); |