diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-09-07 18:02:45 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-09-07 18:02:45 +0300 |
commit | b5aa7b91572aad7aea5ec9b5b109e03a26934b6c (patch) | |
tree | 0c0e168726b82394e2d1c6b33f48c09049089670 | |
parent | f899460658ad3abc8d02e7ca129b790b1c8c9736 (diff) | |
download | mv-b5aa7b91572aad7aea5ec9b5b109e03a26934b6c.tar.gz mv-b5aa7b91572aad7aea5ec9b5b109e03a26934b6c.tar.bz2 mv-b5aa7b91572aad7aea5ec9b5b109e03a26934b6c.tar.xz mv-b5aa7b91572aad7aea5ec9b5b109e03a26934b6c.zip |
eathena: add packet SMSG_PARTY_MEMBER_INFO 0x01e9.
-rw-r--r-- | src/net/eathena/partyhandler.cpp | 35 | ||||
-rw-r--r-- | src/net/eathena/partyhandler.h | 2 | ||||
-rw-r--r-- | src/net/eathena/protocol.h | 1 |
3 files changed, 38 insertions, 0 deletions
diff --git a/src/net/eathena/partyhandler.cpp b/src/net/eathena/partyhandler.cpp index e2256f5eb..0cc927ab5 100644 --- a/src/net/eathena/partyhandler.cpp +++ b/src/net/eathena/partyhandler.cpp @@ -30,6 +30,8 @@ #include "net/eathena/messageout.h" #include "net/eathena/protocol.h" +#include "net/eathena/gui/partytab.h" + #include "resources/notifytypes.h" #include "debug.h" @@ -56,6 +58,7 @@ PartyHandler::PartyHandler() : SMSG_PARTY_UPDATE_COORDS, SMSG_PARTY_MESSAGE, SMSG_PARTY_INVITATION_STATS, + SMSG_PARTY_MEMBER_INFO, 0 }; handledMessages = _messages; @@ -103,6 +106,9 @@ void PartyHandler::handleMessage(Net::MessageIn &msg) case SMSG_PARTY_INVITATION_STATS: processPartyInvitationStats(msg); break; + case SMSG_PARTY_MEMBER_INFO: + processPartyMemberInfo(msg); + break; default: break; @@ -213,4 +219,33 @@ void PartyHandler::processPartyInvitationStats(Net::MessageIn &msg) msg.readUInt8("allow party"); } +void PartyHandler::processPartyMemberInfo(Net::MessageIn &msg) +{ + const int id = msg.readInt32("account id"); + const bool leader = msg.readInt32("leader") == 0U; + const int x = msg.readInt16("x"); + const int y = msg.readInt16("y"); + const bool online = msg.readInt8("online") == 0U; + msg.readString(24, "party name"); + const std::string nick = msg.readString(24, "player name"); + const std::string map = msg.readString(16, "map name"); + msg.readInt8("party.item&1"); + msg.readInt8("party.item&2"); + + if (!Ea::taParty) + return; + + PartyMember *const member = Ea::taParty->addMember(id, nick); + if (member) + { + if (Ea::partyTab && member->getOnline() != online) + Ea::partyTab->showOnline(nick, online); + member->setLeader(leader); + member->setOnline(online); + member->setMap(map); + member->setX(x); + member->setY(y); + } +} + } // namespace EAthena diff --git a/src/net/eathena/partyhandler.h b/src/net/eathena/partyhandler.h index 47de4a73a..d7655cba3 100644 --- a/src/net/eathena/partyhandler.h +++ b/src/net/eathena/partyhandler.h @@ -65,6 +65,8 @@ class PartyHandler final : public MessageHandler, public Ea::PartyHandler protected: void processPartyInvitationStats(Net::MessageIn &msg); + + void processPartyMemberInfo(Net::MessageIn &msg); }; } // namespace EAthena diff --git a/src/net/eathena/protocol.h b/src/net/eathena/protocol.h index 5a80fce68..b487584b0 100644 --- a/src/net/eathena/protocol.h +++ b/src/net/eathena/protocol.h @@ -149,6 +149,7 @@ #define SMSG_PARTY_UPDATE_COORDS 0x0107 #define SMSG_PARTY_MESSAGE 0x0109 #define SMSG_PARTY_INVITATION_STATS 0x02c9 +#define SMSG_PARTY_MEMBER_INFO 0x01e9 #define SMSG_PLAYER_STORAGE_ITEMS 0x0995 /**< Item list for storage */ #define SMSG_PLAYER_STORAGE_EQUIP 0x0996 /**< Equipment list for storage */ |