diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/net/ea/partyhandler.cpp | 24 | ||||
-rw-r--r-- | src/net/ea/partyhandler.h | 2 | ||||
-rw-r--r-- | src/net/eathena/partyhandler.cpp | 24 | ||||
-rw-r--r-- | src/net/eathena/partyhandler.h | 2 | ||||
-rw-r--r-- | src/net/tmwa/partyhandler.cpp | 24 | ||||
-rw-r--r-- | src/net/tmwa/partyhandler.h | 2 |
6 files changed, 52 insertions, 26 deletions
diff --git a/src/net/ea/partyhandler.cpp b/src/net/ea/partyhandler.cpp index 60356cf61..4e2fd8e52 100644 --- a/src/net/ea/partyhandler.cpp +++ b/src/net/ea/partyhandler.cpp @@ -295,30 +295,6 @@ void PartyHandler::processPartyUpdateCoords(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); - } - } -} - ChatTab *PartyHandler::getTab() const { return partyTab; diff --git a/src/net/ea/partyhandler.h b/src/net/ea/partyhandler.h index c5cf606b4..7cc5c10bf 100644 --- a/src/net/ea/partyhandler.h +++ b/src/net/ea/partyhandler.h @@ -74,8 +74,6 @@ class PartyHandler notfinal : public Net::PartyHandler virtual void processPartyUpdateCoords(Net::MessageIn &msg) const; - virtual void processPartyMessage(Net::MessageIn &msg) const; - void processPartySettingsContinue(const int16_t exp, const int16_t item); 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 diff --git a/src/net/tmwa/partyhandler.cpp b/src/net/tmwa/partyhandler.cpp index c5564c94b..813726b6d 100644 --- a/src/net/tmwa/partyhandler.cpp +++ b/src/net/tmwa/partyhandler.cpp @@ -332,4 +332,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 TmwAthena diff --git a/src/net/tmwa/partyhandler.h b/src/net/tmwa/partyhandler.h index f731fa32a..9ee694775 100644 --- a/src/net/tmwa/partyhandler.h +++ b/src/net/tmwa/partyhandler.h @@ -67,6 +67,8 @@ class PartyHandler final : public MessageHandler, public Ea::PartyHandler void processPartySettings(Net::MessageIn &msg); void processPartyInfo(Net::MessageIn &msg) const; + + void processPartyMessage(Net::MessageIn &msg) const; }; } // namespace TmwAthena |