Skip to content

Commit

Permalink
feat: add structures to new packet
Browse files Browse the repository at this point in the history
  • Loading branch information
OEOTYAN committed Feb 12, 2024
1 parent a21b7a5 commit a7a61b5
Show file tree
Hide file tree
Showing 10 changed files with 43 additions and 10 deletions.
14 changes: 13 additions & 1 deletion src/mc/enums/HudElement.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,16 @@

#include "mc/_HeaderOutputPredefine.h"

enum class HudElement {};
enum class HudElement {
PaperDoll = 0x0,
Armor = 0x1,
ToolTips = 0x2,
TouchControls = 0x3,
Crosshair = 0x4,
Hosd = 0x5,
Health = 0x6,
ProgressBar = 0x7,
FoodBar = 0x8,
AirBubblesBar = 0x9,
VehicleHealth = 0xA,
};
5 changes: 4 additions & 1 deletion src/mc/enums/HudVisibility.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,7 @@

#include "mc/_HeaderOutputPredefine.h"

enum class HudVisibility {};
enum class HudVisibility {
Hide = 0x0,
Reset = 0x1,
};
6 changes: 5 additions & 1 deletion src/mc/network/NetworkSettingOptions.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,9 @@

struct NetworkSettingOptions {
public:
uchar filler[24];
ushort mCompressionThreshold;
PacketCompressionAlgorithm mCompressionAlgorithm;
bool mClientThrottleEnabled;
schar mClientThrottleThreshold;
float mClientThrottleScalar;
};
2 changes: 1 addition & 1 deletion src/mc/network/packet/AddVolumeEntityPacket.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class AddVolumeEntityPacket : public ::Packet {
NetworkBlockPosition mMaxBounds; // this+0xb4
DimensionType mDimensionType; // this+0xc0
SemVersion mEngineVersion; // this+0xc8
EntityNetId mEntityNetId; /// this+0x118
EntityNetId mEntityNetId; // this+0x118

// prevent constructor by default
AddVolumeEntityPacket& operator=(AddVolumeEntityPacket const&);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

class CompressedBiomeDefinitionListPacket : public ::BiomeDefinitionListPacket {
public:
uchar filler[32];
std::string definitions;

// prevent constructor by default
CompressedBiomeDefinitionListPacket& operator=(CompressedBiomeDefinitionListPacket const&);
Expand Down
1 change: 1 addition & 0 deletions src/mc/network/packet/NetworkSettingsPacket.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
class NetworkSettingsPacket : public ::Packet {
public:
NetworkSettingOptions mNetworkSettings; // this+0x30
bool mUnknown; // this+0x40

// prevent constructor by default
NetworkSettingsPacket& operator=(NetworkSettingsPacket const&);
Expand Down
2 changes: 1 addition & 1 deletion src/mc/network/packet/PlayerAuthInputPacket.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ class PlayerAuthInputPacket : public ::Packet {
std::unique_ptr<PackedItemUseLegacyInventoryTransaction> mItemUseTransaction;
std::unique_ptr<ItemStackRequestData> mItemStackRequest;
PlayerBlockActions mPlayerBlockActions;
uint64 mUnknown{~0ui64};
int64 predictedVehicle;


// prevent constructor by default
Expand Down
5 changes: 4 additions & 1 deletion src/mc/network/packet/SetHudPacket.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#pragma once

#include "mc/_HeaderOutputPredefine.h"
#include "mc/enums/HudElement.h"
#include "mc/enums/HudVisibility.h"

// auto generated inclusion list
#include "mc/deps/core/common/bedrock/Result.h"
Expand All @@ -9,7 +11,8 @@

class SetHudPacket : public ::Packet {
public:
uchar filler[32];
std::vector<HudElement> elements;
HudVisibility visibility;

// prevent constructor by default
SetHudPacket& operator=(SetHudPacket const&);
Expand Down
12 changes: 11 additions & 1 deletion src/mc/world/level/EducationLevelSettings.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,17 @@

struct EducationLevelSettings {
public:
uchar filler[936 - 616]; // LevelSettings::LevelSettings
std::string mCodeBuilderDefaultUri;
std::string mCodeBuilderTitle;
bool mCanResizeCodeBuilder;
bool mDisableLegacyTitleBar;
std::string mPostProcessFilter;
std::string mScreenshotBorderResourcePath;
std::unordered_map<std::string, uint> mHiddenCommands;
EducationLocalLevelSettings mLocalSettings;
std::optional<AgentCapabilities> mAgentCapabilities;
std::optional<ExternalLinkSettings> mExternalLinkSettings;


// NOLINTBEGIN
// symbol: ??0EducationLevelSettings@@QEAA@XZ
Expand Down
4 changes: 2 additions & 2 deletions src/mc/world/level/EducationLocalLevelSettings.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

class EducationLocalLevelSettings {
public:
std::optional<std::string> mCodeBuilderOverrideUri;
bool mHasQuiz;
std::string mCodeBuilderOverrideUri;
bool mHasQuiz;

// prevent constructor by default
EducationLocalLevelSettings& operator=(EducationLocalLevelSettings const&);
Expand Down

0 comments on commit a7a61b5

Please sign in to comment.