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 | |
parent | ff86d5fbc7db586c05e51c99f052bbae4ebe44cc (diff) | |
download | mv-5a3e68f8de3479c468b7683373b2c0d70344b9f8.tar.gz mv-5a3e68f8de3479c468b7683373b2c0d70344b9f8.tar.bz2 mv-5a3e68f8de3479c468b7683373b2c0d70344b9f8.tar.xz mv-5a3e68f8de3479c468b7683373b2c0d70344b9f8.zip |
Add missing party leave statuses.
-rw-r--r-- | src/net/ea/partyhandler.cpp | 55 | ||||
-rw-r--r-- | src/resources/notifications.h | 24 | ||||
-rw-r--r-- | src/resources/notifytypes.h | 6 |
3 files changed, 80 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); diff --git a/src/resources/notifications.h b/src/resources/notifications.h index 78d4e00dc..2cfeca286 100644 --- a/src/resources/notifications.h +++ b/src/resources/notifications.h @@ -138,6 +138,18 @@ namespace NotifyManager // TRANSLATORS: notification message N_("You have left the party."), NotifyFlags::EMPTY}, + {"party left deny", + // TRANSLATORS: notification message + N_("You cant left party on this map."), + NotifyFlags::EMPTY}, + {"party kicked", + // TRANSLATORS: notification message + N_("You was kicked from party."), + NotifyFlags::EMPTY}, + {"party kick deny", + // TRANSLATORS: notification message + N_("You cant be kicked kicked from party on this map."), + NotifyFlags::EMPTY}, {"party user joined", // TRANSLATORS: notification message N_("%s has joined your party."), @@ -190,6 +202,18 @@ namespace NotifyManager // TRANSLATORS: notification message N_("%s has left your party."), NotifyFlags::PARTY_STRING}, + {"party user left deny", + // TRANSLATORS: notification message + N_("%s cant be kicked from party on this map."), + NotifyFlags::PARTY_STRING}, + {"party user kicked", + // TRANSLATORS: notification message + N_("%s has kicked from your party."), + NotifyFlags::PARTY_STRING}, + {"party user kick deny", + // TRANSLATORS: notification message + N_("%s cant be kicked from party on this map."), + NotifyFlags::PARTY_STRING}, {"party unknown user msg", // TRANSLATORS: notification message N_("An unknown member tried to say: %s"), diff --git a/src/resources/notifytypes.h b/src/resources/notifytypes.h index eb2c2c776..be3af93b8 100644 --- a/src/resources/notifytypes.h +++ b/src/resources/notifytypes.h @@ -54,6 +54,9 @@ namespace NotifyTypes PARTY_CREATE_FAILED, PARTY_CREATED, PARTY_LEFT, + PARTY_LEFT_DENY, + PARTY_KICKED, + PARTY_KICK_DENY, PARTY_USER_JOINED, PARTY_INVITE_ALREADY_MEMBER, PARTY_INVITE_REFUSED, @@ -67,6 +70,9 @@ namespace NotifyTypes PARTY_ITEM_SHARE_OFF, PARTY_ITEM_SHARE_ERROR, PARTY_USER_LEFT, + PARTY_USER_LEFT_DENY, + PARTY_USER_KICKED, + PARTY_USER_KICK_DENY, PARTY_UNKNOWN_USER_MSG, PARTY_USER_NOT_IN_PARTY, MONEY_GET, |