diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-10-14 16:57:01 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-10-14 16:57:01 +0300 |
commit | 31a13e296a21a7735e8d217b4d7f13fa32ee4033 (patch) | |
tree | 0e957cb1aaca463a715641e2344ee39f5cc90889 /src | |
parent | d2bde911f0b80515066f100fc4704793255be0ea (diff) | |
download | manaplus-31a13e296a21a7735e8d217b4d7f13fa32ee4033.tar.gz manaplus-31a13e296a21a7735e8d217b4d7f13fa32ee4033.tar.bz2 manaplus-31a13e296a21a7735e8d217b4d7f13fa32ee4033.tar.xz manaplus-31a13e296a21a7735e8d217b4d7f13fa32ee4033.zip |
eathena: add packet SMSG_PARTY_LEADER 0x07fc.
Diffstat (limited to 'src')
-rw-r--r-- | src/net/eathena/packets.h | 2 | ||||
-rw-r--r-- | src/net/eathena/partyhandler.cpp | 16 | ||||
-rw-r--r-- | src/net/eathena/partyhandler.h | 2 | ||||
-rw-r--r-- | src/net/eathena/protocol.h | 1 |
4 files changed, 20 insertions, 1 deletions
diff --git a/src/net/eathena/packets.h b/src/net/eathena/packets.h index e910c2149..6e24477c1 100644 --- a/src/net/eathena/packets.h +++ b/src/net/eathena/packets.h @@ -211,7 +211,7 @@ int16_t packet_lengths[] = 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 268, 0, 0, 0, 0, 0, 0, 0, 15, 8, 0, 6, 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 14, 0, 0, 0, 8, 25, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 14, 0, 0, 0, 8, 25, 10, 0, 0, 0, //0 1 2 3 4 5 6 7 8 9 a b c d e f //0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 // #0x0800 diff --git a/src/net/eathena/partyhandler.cpp b/src/net/eathena/partyhandler.cpp index 8cf57c634..6b132646c 100644 --- a/src/net/eathena/partyhandler.cpp +++ b/src/net/eathena/partyhandler.cpp @@ -63,6 +63,7 @@ PartyHandler::PartyHandler() : SMSG_PARTY_INVITATION_STATS, SMSG_PARTY_MEMBER_INFO, SMSG_PARTY_ITEM_PICKUP, + SMSG_PARTY_LEADER, 0 }; handledMessages = _messages; @@ -116,6 +117,9 @@ void PartyHandler::handleMessage(Net::MessageIn &msg) case SMSG_PARTY_ITEM_PICKUP: processPartyItemPickup(msg); break; + case SMSG_PARTY_LEADER: + processPartyLeader(msg); + break; default: break; @@ -483,4 +487,16 @@ void PartyHandler::processPartyItemPickup(Net::MessageIn &msg) const msg.readUInt8("item type"); } +void PartyHandler::processPartyLeader(Net::MessageIn &msg) const +{ + PartyMember *const oldMember = Ea::taParty->getMember( + msg.readInt32("old leder id")); + PartyMember *const newMember = Ea::taParty->getMember( + msg.readInt32("new leder id")); + if (oldMember) + oldMember->setLeader(false); + if (newMember) + newMember->setLeader(true); +} + } // namespace EAthena diff --git a/src/net/eathena/partyhandler.h b/src/net/eathena/partyhandler.h index db20f7d0e..bc8c550a8 100644 --- a/src/net/eathena/partyhandler.h +++ b/src/net/eathena/partyhandler.h @@ -79,6 +79,8 @@ class PartyHandler final : public MessageHandler, public Ea::PartyHandler void processPartyInviteResponse(Net::MessageIn &msg) const; void processPartyItemPickup(Net::MessageIn &msg) const; + + void processPartyLeader(Net::MessageIn &msg) const; }; } // namespace EAthena diff --git a/src/net/eathena/protocol.h b/src/net/eathena/protocol.h index 716aae6c9..9c9760d7d 100644 --- a/src/net/eathena/protocol.h +++ b/src/net/eathena/protocol.h @@ -183,6 +183,7 @@ #define SMSG_PARTY_INVITATION_STATS 0x02c9 #define SMSG_PARTY_MEMBER_INFO 0x01e9 #define SMSG_PARTY_ITEM_PICKUP 0x02b8 +#define SMSG_PARTY_LEADER 0x07fc #define SMSG_PLAYER_STORAGE_ITEMS 0x0995 /**< Item list for storage */ #define SMSG_PLAYER_STORAGE_EQUIP 0x0996 /**< Equipment list for storage */ |