diff options
Diffstat (limited to 'src/net/eathena')
-rw-r--r-- | src/net/eathena/partyhandler.cpp | 24 | ||||
-rw-r--r-- | src/net/eathena/partyhandler.h | 2 |
2 files changed, 26 insertions, 0 deletions
diff --git a/src/net/eathena/partyhandler.cpp b/src/net/eathena/partyhandler.cpp index 83dae97f5..265f4cc0e 100644 --- a/src/net/eathena/partyhandler.cpp +++ b/src/net/eathena/partyhandler.cpp @@ -381,4 +381,28 @@ void PartyHandler::processPartyInfo(Net::MessageIn &msg) const } } +void PartyHandler::processPartyMessage(Net::MessageIn &msg) const +{ + const int msgLength = msg.readInt16() - 8; + if (msgLength <= 0) + return; + + const int id = msg.readInt32(); + const std::string chatMsg = msg.readString(msgLength); + + if (Ea::taParty && Ea::partyTab) + { + const PartyMember *const member = Ea::taParty->getMember(id); + if (member) + { + Ea::partyTab->chatLog(member->getName(), chatMsg); + } + else + { + NotifyManager::notify(NotifyTypes::PARTY_UNKNOWN_USER_MSG, + chatMsg); + } + } +} + } // namespace EAthena diff --git a/src/net/eathena/partyhandler.h b/src/net/eathena/partyhandler.h index 2b7df42b1..35693af89 100644 --- a/src/net/eathena/partyhandler.h +++ b/src/net/eathena/partyhandler.h @@ -71,6 +71,8 @@ class PartyHandler final : public MessageHandler, public Ea::PartyHandler void processPartyMemberInfo(Net::MessageIn &msg); void processPartyInfo(Net::MessageIn &msg) const; + + void processPartyMessage(Net::MessageIn &msg) const; }; } // namespace EAthena |