summaryrefslogtreecommitdiffstats
path: root/src/Packet.hpp
diff options
context:
space:
mode:
authorLaG1924 <12997935+LaG1924@users.noreply.github.com>2020-07-31 07:05:46 +0200
committerGitHub <noreply@github.com>2020-07-31 07:05:46 +0200
commit28caa598e29b7eaa36d0877dd57947d29fe92e06 (patch)
tree14ce54f1349966ce3482d270c1b104bdac6cc86d /src/Packet.hpp
parentMerge pull request #42 from LaG1924/ftr/chat_component_parse (diff)
parentCorrected Game Start conditions (diff)
downloadAltCraft-28caa598e29b7eaa36d0877dd57947d29fe92e06.tar
AltCraft-28caa598e29b7eaa36d0877dd57947d29fe92e06.tar.gz
AltCraft-28caa598e29b7eaa36d0877dd57947d29fe92e06.tar.bz2
AltCraft-28caa598e29b7eaa36d0877dd57947d29fe92e06.tar.lz
AltCraft-28caa598e29b7eaa36d0877dd57947d29fe92e06.tar.xz
AltCraft-28caa598e29b7eaa36d0877dd57947d29fe92e06.tar.zst
AltCraft-28caa598e29b7eaa36d0877dd57947d29fe92e06.zip
Diffstat (limited to 'src/Packet.hpp')
-rw-r--r--src/Packet.hpp61
1 files changed, 61 insertions, 0 deletions
diff --git a/src/Packet.hpp b/src/Packet.hpp
index cca01ec..ccc486f 100644
--- a/src/Packet.hpp
+++ b/src/Packet.hpp
@@ -1169,3 +1169,64 @@ struct PacketRespawn : Packet {
unsigned char Gamemode;
std::string LevelType;
};
+
+struct PacketPluginMessageSB : Packet {
+ void ToStream(StreamOutput* stream) override {
+ stream->WriteString(Channel);
+ stream->WriteByteArray(Data);
+ }
+
+ void FromStream(StreamInput* stream) override {
+
+ }
+
+ int GetPacketId() override {
+ return PacketNamePlaySB::PluginMessageSB;
+ }
+
+ PacketPluginMessageSB(const std::string& channel, const std::vector<unsigned char> data) : Channel(channel), Data(data) {}
+
+ std::string Channel;
+ std::vector<unsigned char> Data;
+};
+
+struct PacketClientSettings : Packet {
+ void ToStream(StreamOutput* stream) override {
+ stream->WriteString(Locale);
+ stream->WriteByte(ViewDistance);
+ stream->WriteVarInt(ChatMode);
+ stream->WriteBool(ChatColors);
+ stream->WriteUByte(DisplayedSkinParts);
+ stream->WriteVarInt(MainHand);
+ }
+
+ void FromStream(StreamInput* stream) override {
+
+ }
+
+ int GetPacketId() override {
+ return PacketNamePlaySB::ClientSettings;
+ }
+
+ PacketClientSettings(
+ const std::string locale,
+ unsigned char viewDistance,
+ int chatMode,
+ bool chatColors,
+ unsigned char displayedSkinParts,
+ int mainHand) :
+ Locale(locale),
+ ViewDistance(viewDistance),
+ ChatMode(chatMode),
+ ChatColors(chatColors),
+ DisplayedSkinParts(displayedSkinParts),
+ MainHand(mainHand) {}
+
+ std::string Locale;
+ unsigned char ViewDistance;
+ int ChatMode;
+ bool ChatColors;
+ unsigned char DisplayedSkinParts;
+ int MainHand;
+};
+