diff options
author | Andrei Karas <akaras@inbox.ru> | 2015-02-25 13:39:42 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2015-02-25 13:39:42 +0300 |
commit | a08416d782bb9296578b2a69e4eb1e33f55523a4 (patch) | |
tree | 467817701e3c35ea6a41e8723d31b652c910db21 /src/net/eathena/mercenaryhandler.cpp | |
parent | c551238526f12f0c28bf44bc131c7e95d675b61d (diff) | |
download | ManaVerse-a08416d782bb9296578b2a69e4eb1e33f55523a4.tar.gz ManaVerse-a08416d782bb9296578b2a69e4eb1e33f55523a4.tar.bz2 ManaVerse-a08416d782bb9296578b2a69e4eb1e33f55523a4.tar.xz ManaVerse-a08416d782bb9296578b2a69e4eb1e33f55523a4.zip |
eathena: add packet CMSG_HOMMERC_TALK 0x0b13.
Diffstat (limited to 'src/net/eathena/mercenaryhandler.cpp')
-rw-r--r-- | src/net/eathena/mercenaryhandler.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/net/eathena/mercenaryhandler.cpp b/src/net/eathena/mercenaryhandler.cpp index 165f0b37a..27c1e361c 100644 --- a/src/net/eathena/mercenaryhandler.cpp +++ b/src/net/eathena/mercenaryhandler.cpp @@ -215,4 +215,19 @@ void MercenaryHandler::attack(const int targetId, const bool keep) const outMsg.writeInt8(static_cast<int8_t>(keep ? 1 : 0), "keep"); } +void MercenaryHandler::talk(const std::string &restrict text) const +{ + if (text.empty()) + return; + std::string msg = text; + if (msg.size() > 500) + msg = msg.substr(0, 500); + const size_t sz = msg.size(); + + createOutPacket(CMSG_HOMMERC_TALK); + outMsg.writeInt16(static_cast<int16_t>(sz + 4 + 1), "len"); + outMsg.writeString(msg, sz, "message"); + outMsg.writeInt8(0, "zero byte"); +} + } // namespace EAthena |