diff options
author | madmaxoft <github@xoft.cz> | 2014-09-25 21:33:20 +0200 |
---|---|---|
committer | madmaxoft <github@xoft.cz> | 2014-09-25 21:33:20 +0200 |
commit | 976c6bd32bd81e26fed392a55dc25f2090f18735 (patch) | |
tree | 6503b95cc6041d17fb8089980747afafcff52f7a /src/Protocol | |
parent | cByteBuffer: Fixed position reading. (diff) | |
download | cuberite-976c6bd32bd81e26fed392a55dc25f2090f18735.tar cuberite-976c6bd32bd81e26fed392a55dc25f2090f18735.tar.gz cuberite-976c6bd32bd81e26fed392a55dc25f2090f18735.tar.bz2 cuberite-976c6bd32bd81e26fed392a55dc25f2090f18735.tar.lz cuberite-976c6bd32bd81e26fed392a55dc25f2090f18735.tar.xz cuberite-976c6bd32bd81e26fed392a55dc25f2090f18735.tar.zst cuberite-976c6bd32bd81e26fed392a55dc25f2090f18735.zip |
Diffstat (limited to '')
-rw-r--r-- | src/Protocol/Protocol18x.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/Protocol/Protocol18x.cpp b/src/Protocol/Protocol18x.cpp index 3e1863f97..896947d03 100644 --- a/src/Protocol/Protocol18x.cpp +++ b/src/Protocol/Protocol18x.cpp @@ -1000,6 +1000,7 @@ void cProtocol180::SendPluginMessage(const AString & a_Channel, const AString & cPacketizer Pkt(*this, 0x3f); Pkt.WriteString(a_Channel); + Pkt.WriteVarInt((UInt32)a_Message.size()); Pkt.WriteBuf(a_Message.data(), a_Message.size()); } @@ -2326,8 +2327,9 @@ void cProtocol180::HandlePacketPlayerPosLook(cByteBuffer & a_ByteBuffer) void cProtocol180::HandlePacketPluginMessage(cByteBuffer & a_ByteBuffer) { HANDLE_READ(a_ByteBuffer, ReadVarUTF8String, AString, Channel); + HANDLE_READ(a_ByteBuffer, ReadVarInt, UInt32, DataLen); AString Data; - a_ByteBuffer.ReadString(Data, a_ByteBuffer.GetReadableSpace() - 1); + a_ByteBuffer.ReadString(Data, DataLen); m_Client->HandlePluginMessage(Channel, Data); } |