Skip to content

Commit d24e5f1

Browse files
authored
[feature] add 1.21.130 support
* refactor: remove unused `std::string` parameter from `requestServerShutdown` * refactor: remove unused methods and members from `ConnectionRequest` * feat: add `onOutgoingPacket` callback to `NetEventCallback` interface * refactor: update packet identifiers in `packet.h` * refactor: replace unused `setInactivityTimeout` with `setDisableTrickleIce` in `RemoteConnector` interface * refactor: add `PlayerAuthenticationInfo` support and clean up unused members in `ServerNetworkHandler` * refactor: remove unused members and methods from `SubClientConnectionRequest` and `ConnectionRequest` * refactor: add `revision_` member to `Pack` and `ResourcePackStack` * refactor: update `ServerInstance` to replace unused members and improve callback types * refactor: add `ActorSwingSource` enum and update `swing` method to use it * refactor: bump version numbers and network protocol constants * refactor: remove unused members and methods from `minecraft.h` and `game_callbacks.h` * refactor: rename `SerializedSkin` to `SerializedSkinRef` * refactor: comment out unused virtual methods in `mob.h` * refactor: add `LevelTickingAreaFinishedLoadingEvent`, new enchantment values, and `ActorSwingSource` updates * refactor: comment out unused virtual methods and clean up parameter names in `block_type.h` * refactor: comment out unused member `base_light_texture_image_builder_` in `dimension.h` * refactor: comment out unused methods and add new virtual function in `level_interface.h` * refactor: remove unused member `addon_ids_and_versions` from `resource_pack_stack_packet.h` * refactor: add actor types to `actor_types.h` * refactor: add new actor flags `CAN_USE_VERTICAL_MOVEMENT_ACTION` and `ROTATION_LOCKED_TO_VEHICLE` to `actor_flags.h` * refactor: encapsulate `TextPacket` fields into `TextPacketPayload` * refactor: encapsulate `AvailableCommandsPacket` fields into `AvailableCommandsPacketPayload` * refactor: add `Dehydration` damage cause to `actor_damage_cause.h` * refactor: add fields to `AvailableCommandsPacketPayload` * refactor: update `EndstonePlayer` methods to use `TextPacketPayload` and adjust iteration for `AvailableCommandsPacketPayload` * refactor: comment out unused `ADDON` stack-related code in `resource_pack_manager.cpp` * refactor: update `TextPacket` methods to use `TextPacketPayload` and add new helper methods * refactor: clean up includes * refactor: remove unused methods `getAuthenticationInfo`, `isVerified`, and `getData` from connection request classes * refactor: encapsulate DevTools thread logic in `DevToolsCommand` class * refactor: update `symobls.toml` * refactor: add `PlayerAuthenticationInfo` parameter to `trytLoadPlayer` and `_createNewPlayer` methods * refactor: update `ItemStackBase::setUserData` to use `ItemInstance::fromTag` method * refactor: update `EndstonePlayer` and `Actor` teleport methods implementation * refactor: remove `UnverifiedCertificate::fromString` hook * feat: update symbols for Linux * feat: add `_getRawRequest` method * feat: update vtable for `Item` class * refactor: deprecate `getVisualLiquidHeight` and add `checkBlockDestroyPermissions` to `IBlockSource` * feat: add container registry-related methods and interfaces in level interface * refactor: update symbols for Windows * feat: move IP and player ban checks to `ServerNetworkHandler::_validateLoginPacket` * feat: re-implement `TextPacket::write` * fix: resolve a crash caused by incorrect symbols * refactor: update symbol for `CommandOriginLoader::load` * refactor: comment out unused block component members and update type alias * fix: update `Minecraft::requestServerShutdown` implementation * refactor: update symbol for `ItemRegistry::lookupByName` * refactor: replace `std::unordered_map` with `brstd::flat_map` in `BaseAttributeMap` * refactor: implement `iterator_impl` and `iterator_impl_base` in `associative_adapter` * style: update `.clang-format` to allow inline short functions * feat: add `associative_adapter::find` * refactor: use pointers for `AttributeInstance` in `BaseAttributeMap` * refactor: move DevTools thread management to DedicatedServer startup * fix: resolve a crash when using `/reload` * refactor: simplify `DeathInfoPacket` struct * fix: correct `TextPacket` serialization logic it works, but it doesn't look right - mojang did you mess it up? * fix: resolve compilation errors on Linux * fix: correct symbol address for `Player::completeUsingItem`
1 parent 6e4b448 commit d24e5f1

77 files changed

Lines changed: 849 additions & 617 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.clang-format

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ AccessModifierOffset: -4
33
AlignConsecutiveMacros: Consecutive
44
AlignEscapedNewlines: Left
55
AlignOperands: AlignAfterOperator
6-
AllowShortFunctionsOnASingleLine: Empty
6+
AllowShortFunctionsOnASingleLine: Inline
77
AllowShortLambdasOnASingleLine: Inline
88
AlwaysBreakTemplateDeclarations: Yes
99
BreakBeforeBraces: Stroustrup

endstone/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
)
1313
from endstone._internal.version import __version__
1414

15-
__minecraft_version__ = "1.21.124"
15+
__minecraft_version__ = "1.21.130"
1616

1717
__all__ = [
1818
"__version__",

include/endstone/detail/common.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@
1919

2020
#define ENDSTONE_VERSION_MAJOR 0
2121
#define ENDSTONE_VERSION_MINOR 10
22-
#define ENDSTONE_VERSION_PATCH 15
22+
#define ENDSTONE_VERSION_PATCH 16
2323

24-
#define NETWORK_PROTOCOL_VERSION 860
24+
#define NETWORK_PROTOCOL_VERSION 898
2525

2626
#define ENDSTONE_API_VERSION ENDSTONE_TOSTRING(ENDSTONE_VERSION_MAJOR) "." ENDSTONE_TOSTRING(ENDSTONE_VERSION_MINOR)
2727

src/bedrock/certificates/certificate.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
class UnverifiedCertificate {
2323
public:
24-
ENDSTONE_HOOK static UnverifiedCertificate fromString(const std::string &input);
24+
static UnverifiedCertificate fromString(const std::string &input);
2525
friend class Certificate;
2626

2727
private:

src/bedrock/forward.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,9 @@ class HudContainerManagerModel;
112112
class I18nObserver;
113113
class IAddActorEntityProxy;
114114
class IContainerRegistryAccess;
115+
class IContainerRegistryTracker;
115116
class IContentTierManager;
117+
class IDynamicContainerSerialization;
116118
class IFileAccess;
117119
class IFoodItemComponent;
118120
class IGameModuleShared;
@@ -132,6 +134,7 @@ class ItemComponentPacket;
132134
class ItemData;
133135
class ItemStackNetManagerBase;
134136
class ItemStackRequestData {};
137+
class ITickingSystem;
135138
class IWorldRegistriesProvider;
136139
class JigsawStructureRegistry;
137140
class LevelChunkBuilderData;
@@ -201,6 +204,7 @@ class ScreenSetupCleanupHelper;
201204
class ScreenshotOptions;
202205
class SearchQuery;
203206
class Seasons {};
207+
class ServerConnectionAuthValidator;
204208
class ServerInstanceEventHandler;
205209
class ServerLocator;
206210
class ServerMetrics;
@@ -249,6 +253,7 @@ enum class DeviceMemoryTier : int;
249253
enum class FertilizerType;
250254
enum class InHandUpdateType : std::int8_t;
251255
enum class ItemColor : std::int8_t;
256+
enum class ItemCooldownType : unsigned char;
252257
enum class JsonBetaState;
253258
enum class LevelChunkFormat : std::int8_t;
254259
enum class LevelEvent;

src/bedrock/minecraft_app_interface.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,5 +29,5 @@ class IMinecraftApp {
2929
[[nodiscard]] virtual bool isDedicatedServer() const = 0;
3030
virtual void onNetworkMaxPlayersChanged(std::uint32_t) = 0;
3131
[[nodiscard]] virtual IGameModuleShared &getGameModuleShared() const = 0;
32-
virtual void requestServerShutdown(std::string const &) = 0;
32+
virtual void requestServerShutdown() = 0;
3333
};

src/bedrock/network/connection_request.cpp

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,6 @@
1616

1717
#include "bedrock/crypto/encoding/base64.h"
1818

19-
const PlayerAuthenticationInfo &ConnectionRequest::getAuthenticationInfo() const
20-
{
21-
return authentication_info_;
22-
}
23-
2419
std::string ConnectionRequest::getClientThirdPartyName() const
2520
{
2621
return getData("ThirdPartyName").asString();
@@ -88,9 +83,9 @@ std::string ConnectionRequest::getDeviceId() const
8883
return getData("DeviceId").asString();
8984
}
9085

91-
bool ConnectionRequest::isVerified() const
86+
const WebToken &ConnectionRequest::_getRawRequest() const
9287
{
93-
return is_verified_ && raw_token_ != nullptr;
88+
return *raw_token_;
9489
}
9590

9691
std::string ConnectionRequest::getLanguageCode() const
@@ -100,8 +95,5 @@ std::string ConnectionRequest::getLanguageCode() const
10095

10196
Json::Value ConnectionRequest::getData(const std::string &key) const
10297
{
103-
if (isVerified()) {
104-
return raw_token_->getData().get(key, Json::nullValue);
105-
}
106-
return Json::nullValue;
98+
return raw_token_->getData().get(key, Json::nullValue);
10799
}

src/bedrock/network/connection_request.h

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@
3131

3232
class ConnectionRequest {
3333
public:
34-
[[nodiscard]] const PlayerAuthenticationInfo &getAuthenticationInfo() const;
3534
[[nodiscard]] PlayerAuthenticationType getAuthenticationType() const;
3635
[[nodiscard]] std::string getSelfSignedId() const;
3736
[[nodiscard]] std::string getServerAddress() const;
@@ -41,7 +40,6 @@ class ConnectionRequest {
4140
[[nodiscard]] std::string getClientPlatformOnlineId() const;
4241
[[nodiscard]] std::string getClientPlatformOfflineId() const;
4342
[[nodiscard]] std::string getSkinId() const;
44-
[[nodiscard]] std::string getPlayFabId() const;
4543
[[nodiscard]] std::string getCapeId() const;
4644
[[nodiscard]] std::vector<unsigned char> getSkinData() const;
4745
[[nodiscard]] std::string getSkinDataAsString() const;
@@ -77,24 +75,21 @@ class ConnectionRequest {
7775
[[nodiscard]] bool isTrustedSkin() const;
7876
[[nodiscard]] bool isOverrideSkin() const;
7977
[[nodiscard]] bool isCapeOnClassicSkin() const;
80-
[[nodiscard]] bool isVerified() const;
81-
bool verifySelfSigned(bool);
8278
[[nodiscard]] bool isCompatibleWithClientSideChunkGen() const;
8379
[[nodiscard]] PlatformType getPlatformType() const;
8480
[[nodiscard]] SyncedClientOptionsComponent getClientOptions() const;
85-
[[nodiscard]] bool isValid() const;
81+
[[nodiscard]] bool isWellFormed() const;
82+
[[nodiscard]] const UnverifiedCertificate *_getLegacyCertificate() const;
83+
[[nodiscard]] const RawGameServerToken &_getGameServerToken() const;
84+
[[nodiscard]] const WebToken &_getRawRequest() const;
8685

8786
[[nodiscard]] std::string getLanguageCode() const; // Endstone
8887

8988
private:
9089
[[nodiscard]] Json::Value getData(const std::string &key) const;
9190

92-
bool is_verified_;
9391
std::unique_ptr<WebToken> raw_token_;
9492
std::unique_ptr<UnverifiedCertificate> certificate_data_;
95-
LegacyMultiplayerToken legacy_multiplayer_token_;
9693
RawGameServerToken unverified_game_server_token_;
97-
GameServerToken verified_game_server_token_;
9894
PlayerAuthenticationType authentication_type_;
99-
PlayerAuthenticationInfo authentication_info_;
10095
};

src/bedrock/network/net_event_callback.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ class NetEventCallback : public Bedrock::EnableNonOwnerReferences {
3636
virtual void onConnect(const NetworkIdentifier &) = 0;
3737
virtual void onUnableToConnect(Connection::DisconnectFailReason, const std::string &) = 0;
3838
virtual void onTick() = 0;
39+
virtual void onOutgoingPacket(const NetworkIdentifier &, MinecraftPacketIds, SubClientId, SubClientId) = 0;
3940
virtual void onValidPacketReceived(const NetworkIdentifier &, MinecraftPacketIds, SubClientId, SubClientId) = 0;
4041
virtual void onStoreOfferReceive(ShowStoreOfferRedirectType, const std::string &) = 0;
4142
virtual void onDisconnect(const NetworkIdentifier &, Connection::DisconnectFailReason,

src/bedrock/network/packet.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -255,9 +255,10 @@ enum class MinecraftPacketIds : int {
255255
ClientboundControlSchemeSetPacket = 327,
256256
ServerScriptDebugDrawerPacket = 328,
257257
ServerboundPackSettingChangePacket = 329,
258-
DataStoreSyncPacket = 330,
258+
ClientboundDataStore = 330,
259259
GraphicsParameterOverridePacket = 331,
260-
EndId = 332,
260+
ServerboundDataStore = 332,
261+
EndId = 333,
261262
};
262263

263264
class NetEventCallback;

0 commit comments

Comments
 (0)