summaryrefslogtreecommitdiff
path: root/src/net/eathena/homunculushandler.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-02-25 13:39:42 +0300
committerAndrei Karas <akaras@inbox.ru>2015-02-25 13:39:42 +0300
commita08416d782bb9296578b2a69e4eb1e33f55523a4 (patch)
tree467817701e3c35ea6a41e8723d31b652c910db21 /src/net/eathena/homunculushandler.cpp
parentc551238526f12f0c28bf44bc131c7e95d675b61d (diff)
downloadmanaplus-a08416d782bb9296578b2a69e4eb1e33f55523a4.tar.gz
manaplus-a08416d782bb9296578b2a69e4eb1e33f55523a4.tar.bz2
manaplus-a08416d782bb9296578b2a69e4eb1e33f55523a4.tar.xz
manaplus-a08416d782bb9296578b2a69e4eb1e33f55523a4.zip
eathena: add packet CMSG_HOMMERC_TALK 0x0b13.
Diffstat (limited to 'src/net/eathena/homunculushandler.cpp')
-rw-r--r--src/net/eathena/homunculushandler.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/net/eathena/homunculushandler.cpp b/src/net/eathena/homunculushandler.cpp
index 6a8c42efa..7eafac3cc 100644
--- a/src/net/eathena/homunculushandler.cpp
+++ b/src/net/eathena/homunculushandler.cpp
@@ -285,4 +285,19 @@ void HomunculusHandler::fire() const
outMsg.writeInt8(2, "command"); // delete
}
+void HomunculusHandler::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