summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-10-14 16:57:01 +0300
committerAndrei Karas <akaras@inbox.ru>2014-10-14 16:57:01 +0300
commit31a13e296a21a7735e8d217b4d7f13fa32ee4033 (patch)
tree0e957cb1aaca463a715641e2344ee39f5cc90889
parentd2bde911f0b80515066f100fc4704793255be0ea (diff)
downloadplus-31a13e296a21a7735e8d217b4d7f13fa32ee4033.tar.gz
plus-31a13e296a21a7735e8d217b4d7f13fa32ee4033.tar.bz2
plus-31a13e296a21a7735e8d217b4d7f13fa32ee4033.tar.xz
plus-31a13e296a21a7735e8d217b4d7f13fa32ee4033.zip
eathena: add packet SMSG_PARTY_LEADER 0x07fc.
-rw-r--r--src/net/eathena/packets.h2
-rw-r--r--src/net/eathena/partyhandler.cpp16
-rw-r--r--src/net/eathena/partyhandler.h2
-rw-r--r--src/net/eathena/protocol.h1
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 */