diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-09-07 20:49:37 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-09-07 20:49:37 +0300 |
commit | 9ca0103f281a176af021197496fd2bd6f65ba05b (patch) | |
tree | a0377ea5cef505febddbbc7c359651b0dcf695f1 /src/net/tmwa/partyhandler.cpp | |
parent | 4c06de57e1fb092ff320ab933e7651724b757bf3 (diff) | |
download | manaverse-9ca0103f281a176af021197496fd2bd6f65ba05b.tar.gz manaverse-9ca0103f281a176af021197496fd2bd6f65ba05b.tar.bz2 manaverse-9ca0103f281a176af021197496fd2bd6f65ba05b.tar.xz manaverse-9ca0103f281a176af021197496fd2bd6f65ba05b.zip |
Move processPartyMessage from ea namespace into eathena and tmwa.
Diffstat (limited to 'src/net/tmwa/partyhandler.cpp')
-rw-r--r-- | src/net/tmwa/partyhandler.cpp | 24 |
1 files changed, 24 insertions, 0 deletions
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 |