1.8: Fixed plugin messages.

master
Howaner 2014-09-27 23:22:26 +02:00
parent 576d088f38
commit 04ee8c43dd
1 changed files with 4 additions and 3 deletions

View File

@ -989,7 +989,6 @@ 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());
}
@ -2316,9 +2315,11 @@ 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, DataLen);
if (!a_ByteBuffer.ReadString(Data, a_ByteBuffer.GetReadableSpace() - 1))
{
return;
}
m_Client->HandlePluginMessage(Channel, Data);
}