summaryrefslogtreecommitdiff
path: root/src/net/eathena
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-09-07 17:00:08 +0300
committerAndrei Karas <akaras@inbox.ru>2014-09-07 17:00:08 +0300
commitf50f6794a7e22ef496185cc874d14813236cdca0 (patch)
treed0357abfc7173ceb5dec662a52bf32e86caa6dda /src/net/eathena
parent201d66ca502db6602911ce69288d2adb975bba2d (diff)
downloadplus-f50f6794a7e22ef496185cc874d14813236cdca0.tar.gz
plus-f50f6794a7e22ef496185cc874d14813236cdca0.tar.bz2
plus-f50f6794a7e22ef496185cc874d14813236cdca0.tar.xz
plus-f50f6794a7e22ef496185cc874d14813236cdca0.zip
eathena: fix packet SMSG_WHISPER 0x0097.
Diffstat (limited to 'src/net/eathena')
-rw-r--r--src/net/eathena/chathandler.cpp6
1 files changed, 4 insertions, 2 deletions
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<int16_t>(text.length() + 28), "len");
+ outMsg.writeInt16(static_cast<int16_t>(text.length() + 28 + 1), "len");
outMsg.writeString(recipient, 24, "recipient nick");
outMsg.writeString(text, static_cast<int>(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)
{