summaryrefslogtreecommitdiff
path: root/src/net/eathena/chathandler.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-09-16 11:11:46 +0300
committerAndrei Karas <akaras@inbox.ru>2014-09-16 11:11:46 +0300
commitf1d3e3325d28a43f838052385ad798527dff9c2d (patch)
treec7f86a2af1d4e7c206db583e632b999d5c57fd90 /src/net/eathena/chathandler.cpp
parent7c701ca5041fbd7430c478f0c709c12eda664c89 (diff)
downloadplus-f1d3e3325d28a43f838052385ad798527dff9c2d.tar.gz
plus-f1d3e3325d28a43f838052385ad798527dff9c2d.tar.bz2
plus-f1d3e3325d28a43f838052385ad798527dff9c2d.tar.xz
plus-f1d3e3325d28a43f838052385ad798527dff9c2d.zip
eathena: add packet CMSG_BATTLE_CHAT_MESSAGE 0x02db.
Diffstat (limited to 'src/net/eathena/chathandler.cpp')
-rw-r--r--src/net/eathena/chathandler.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/net/eathena/chathandler.cpp b/src/net/eathena/chathandler.cpp
index 3b5df895e..5eec14491 100644
--- a/src/net/eathena/chathandler.cpp
+++ b/src/net/eathena/chathandler.cpp
@@ -281,6 +281,20 @@ void ChatHandler::createChatRoom(const std::string &title,
outMsg.writeString(title, 36, "title");
}
+void ChatHandler::battleTalk(const std::string &text) const
+{
+ if (!localPlayer)
+ return;
+
+ const std::string mes = std::string(localPlayer->getName()).append(
+ " : ").append(text);
+
+ MessageOut outMsg(CMSG_BATTLE_CHAT_MESSAGE);
+ // Added + 1 in order to let eAthena parse admin commands correctly
+ outMsg.writeInt16(static_cast<int16_t>(mes.length() + 4 + 1), "len");
+ outMsg.writeString(mes, static_cast<int>(mes.length() + 1), "message");
+}
+
void ChatHandler::processChat(Net::MessageIn &msg)
{
BLOCK_START("ChatHandler::processChat")