diff options
author | Andrei Karas <akaras@inbox.ru> | 2016-08-20 01:34:13 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2016-08-20 01:34:13 +0300 |
commit | 75c8412edc9030ff86dc80dc4143d873cda9d4d1 (patch) | |
tree | 284975df74a7ae336656bd19ee3cf99a319ef0bf /src/net/eathena/partyrecv.cpp | |
parent | 59bc8a615eb7939474190539fe7848da0132e8f8 (diff) | |
download | manaplus-75c8412edc9030ff86dc80dc4143d873cda9d4d1.tar.gz manaplus-75c8412edc9030ff86dc80dc4143d873cda9d4d1.tar.bz2 manaplus-75c8412edc9030ff86dc80dc4143d873cda9d4d1.tar.xz manaplus-75c8412edc9030ff86dc80dc4143d873cda9d4d1.zip |
Allow get auto item share party option.
Diffstat (limited to 'src/net/eathena/partyrecv.cpp')
-rw-r--r-- | src/net/eathena/partyrecv.cpp | 39 |
1 files changed, 38 insertions, 1 deletions
diff --git a/src/net/eathena/partyrecv.cpp b/src/net/eathena/partyrecv.cpp index f0789cbf2..21edcc3b3 100644 --- a/src/net/eathena/partyrecv.cpp +++ b/src/net/eathena/partyrecv.cpp @@ -42,6 +42,11 @@ namespace EAthena { +namespace PartyRecv +{ + PartyShareT mShareAutoItems = PartyShare::UNKNOWN; +} // namespace PartyRecv + void PartyRecv::processPartyInvitationStats(Net::MessageIn &msg) { // +++ for now server allow only switch this option but not using it. @@ -94,8 +99,10 @@ void PartyRecv::processPartySettings(Net::MessageIn &msg) { const PartyShareT item = static_cast<PartyShareT>( msg.readInt8("pickup item share (&1)")); - msg.readInt8("get item share (&2)"); Ea::PartyRecv::processPartyItemSettingsContinue(msg, item); + const PartyShareT autoItem = static_cast<PartyShareT>( + msg.readInt8("get auto item share (&2)")); + processPartyAutoItemSettingsContinue(msg, autoItem); } } @@ -315,4 +322,34 @@ void PartyRecv::processPartyInvited(Net::MessageIn &msg) socialWindow->showPartyInvite(partyName, std::string(), id); } +void PartyRecv::processPartyAutoItemSettingsContinue(Net::MessageIn &msg, + const PartyShareT item) +{ + switch (item) + { + case PartyShare::YES: + if (mShareAutoItems == PartyShare::YES) + break; + mShareAutoItems = PartyShare::YES; + NotifyManager::notify(NotifyTypes::PARTY_ITEM_SHARE_ON); + break; + case PartyShare::NO: + if (mShareAutoItems == PartyShare::NO) + break; + mShareAutoItems = PartyShare::NO; + NotifyManager::notify(NotifyTypes::PARTY_ITEM_SHARE_OFF); + break; + case PartyShare::NOT_POSSIBLE: + if (mShareAutoItems == PartyShare::NOT_POSSIBLE) + break; + mShareAutoItems = PartyShare::NOT_POSSIBLE; + NotifyManager::notify(NotifyTypes::PARTY_ITEM_SHARE_ERROR); + break; + default: + case PartyShare::UNKNOWN: + UNIMPLIMENTEDPACKETFIELD(CAST_S32(item)); + break; + } +} + } // namespace EAthena |