From f50f6794a7e22ef496185cc874d14813236cdca0 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sun, 7 Sep 2014 17:00:08 +0300 Subject: eathena: fix packet SMSG_WHISPER 0x0097. --- src/net/eathena/chathandler.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/net/eathena/chathandler.cpp') diff --git a/src/net/eathena/chathandler.cpp b/src/net/eathena/chathandler.cpp index f10f8fcfb..69e6eae9a 100644 --- a/src/net/eathena/chathandler.cpp +++ b/src/net/eathena/chathandler.cpp @@ -127,9 +127,10 @@ void ChatHandler::privateMessage(const std::string &restrict recipient, const std::string &restrict text) { MessageOut outMsg(CMSG_CHAT_WHISPER); - outMsg.writeInt16(static_cast(text.length() + 28), "len"); + outMsg.writeInt16(static_cast(text.length() + 28 + 1), "len"); outMsg.writeString(recipient, 24, "recipient nick"); outMsg.writeString(text, static_cast(text.length()), "message"); + outMsg.writeInt8(0, "null char"); mSentWhispers.push(recipient); } @@ -315,8 +316,9 @@ void ChatHandler::processChat(Net::MessageIn &msg) void ChatHandler::processWhisper(Net::MessageIn &msg) const { BLOCK_START("ChatHandler::processWhisper") - const int chatMsgLength = msg.readInt16("len") - 28; + const int chatMsgLength = msg.readInt16("len") - 32; std::string nick = msg.readString(24, "nick"); + msg.readInt32("admin flag"); if (chatMsgLength <= 0) { -- cgit v1.2.3-60-g2f50