diff options
author | LaG1924 <12997935+LaG1924@users.noreply.github.com> | 2017-10-14 18:40:34 +0200 |
---|---|---|
committer | LaG1924 <12997935+LaG1924@users.noreply.github.com> | 2018-01-13 03:39:32 +0100 |
commit | abba018da3c2c8011b1485ee8e9e5b2690659c76 (patch) | |
tree | 88642b34e91957bbb5e6f05aca4107b512b7b4f2 /src/Packet.hpp | |
parent | 2017-10-09 (diff) | |
download | AltCraft-abba018da3c2c8011b1485ee8e9e5b2690659c76.tar AltCraft-abba018da3c2c8011b1485ee8e9e5b2690659c76.tar.gz AltCraft-abba018da3c2c8011b1485ee8e9e5b2690659c76.tar.bz2 AltCraft-abba018da3c2c8011b1485ee8e9e5b2690659c76.tar.lz AltCraft-abba018da3c2c8011b1485ee8e9e5b2690659c76.tar.xz AltCraft-abba018da3c2c8011b1485ee8e9e5b2690659c76.tar.zst AltCraft-abba018da3c2c8011b1485ee8e9e5b2690659c76.zip |
Diffstat (limited to 'src/Packet.hpp')
-rw-r--r-- | src/Packet.hpp | 42 |
1 files changed, 39 insertions, 3 deletions
diff --git a/src/Packet.hpp b/src/Packet.hpp index 0470015..f31fa59 100644 --- a/src/Packet.hpp +++ b/src/Packet.hpp @@ -241,7 +241,7 @@ struct PacketDisconnectPlay : Packet { } void FromStream(StreamInput *stream) override { - Reason = stream->ReadChat(); + Reason = stream->ReadChat().text; } int GetPacketId() override { @@ -861,7 +861,7 @@ struct PacketOpenWindow : Packet { void FromStream(StreamInput *stream) override { WindowId = stream->ReadUByte(); WindowType = stream->ReadString(); - WindowTitle = stream->ReadChat(); + WindowTitle = stream->ReadChat().text; NumberOfSlots = stream->ReadUByte(); if (WindowType == "EntityHorse") @@ -1032,7 +1032,7 @@ struct PacketDisconnect : Packet { } void FromStream(StreamInput *stream) override { - Reason = stream->ReadChat(); + Reason = stream->ReadChat().text; } int GetPacketId() override { @@ -1056,4 +1056,40 @@ struct PacketSetCompression : Packet { } int Threshold; +}; + +struct PacketChatMessageCB : Packet { + void ToStream(StreamOutput *stream) override { + + } + + void FromStream(StreamInput *stream) override { + JsonData = stream->ReadChat(); + Position = stream->ReadByte(); + } + + int GetPacketId() override { + return PacketNamePlayCB::ChatMessageCB; + } + + Chat JsonData; + unsigned char Position; +}; + +struct PacketChatMessageSB : Packet { + void ToStream(StreamOutput *stream) override { + stream->WriteString(Message); + } + + void FromStream(StreamInput *stream) override { + + } + + int GetPacketId() override { + return PacketNamePlaySB::ChatMessageSB; + } + + std::string Message; + + PacketChatMessageSB(const std::string msg) : Message(msg) {}; };
\ No newline at end of file |