73class ServerPlayer :
public ::Player {
84 enum class State :
int {
94 ::ll::TypedStorage<1, 1, bool> isAutonomous;
95 ::ll::TypedStorage<4, 4, ::ServerPlayer::NearbyActor::State> state;
96 ::ll::TypedStorage<8, 8, ::Actor*> tempActor;
100 using OnPlayerLoadedCallback = ::std::function<void(::ServerPlayer&)>;
103 LLNDAPI
static ServerPlayer* tryGetFromEntity(
::EntityContext& entity,
bool includeRemoved);
108 ::ll::TypedStorage<4, 4, ::PlatformType> mPlatformType;
109 ::ll::TypedStorage<8, 32, ::std::string> mLanguageCode;
110 ::ll::TypedStorage<8, 8, ::ServerNetworkSystem&> mNetwork;
111 ::ll::TypedStorage<8, 64, ::std::function<void(::ServerPlayer&)>> mOnPlayerLoadedCallback;
112 ::ll::TypedStorage<8, 112, ::InventoryMenu> mInventoryMenu;
113 ::ll::TypedStorage<1, 1, ::ContainerID> mContainerCounter;
114 ::ll::TypedStorage<8, 16, ::CallbackToken> mCloseContainerToken;
115 ::ll::TypedStorage<4, 4, uint> mMaxChunkRadius;
116 ::ll::TypedStorage<1, 1, bool> mIsInitialPlayerLoadHappening;
117 ::ll::TypedStorage<1, 1, bool> mIsTeacher;
118 ::ll::TypedStorage<1, 1, bool> mIsExternalCommunicationAllowed;
119 ::ll::TypedStorage<1, 1, bool> mLocalPlayerInitialized;
120 ::ll::TypedStorage<1, 1, bool> mWaitingForTickingAreasPreload;
121 ::ll::TypedStorage<8, 8, ::Tick> mPrevShieldBlockingTick;
122 ::ll::TypedStorage<4, 4, uint> mClientViewRadius;
123 ::ll::TypedStorage<4, 4, uint> mClientRequestedRadius;
124 ::ll::TypedStorage<1, 1, bool> mIsCompatibleWithClientSideChunkGen;
125 ::ll::TypedStorage<8, 48, ::std::optional<::PlayerPartyInfo>> mPartyInfo;
126 ::ll::TypedStorage<4, 4, int> mRemainingStructureRefreshTicks;
127 ::ll::TypedStorage<8, 48, ::HashedString> mCurrentStructureFeature;
128 ::ll::TypedStorage<8, 64, ::std::unordered_map<::ActorUniqueID, ::ServerPlayer::NearbyActor>> mNearbyActors;
129 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::Editor::IEditorPlayer>> mEditorServerPlayer;
130 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::Bedrock::DDUI::DataStoreSyncServer>> mDataStoreSync;
131 ::ll::TypedStorage<1, 1, bool> mHasQueuedViewMove;
132 ::ll::TypedStorage<1, 1, bool> mIsPendingDisconnect;
133 ::ll::TypedStorage<4, 52, ::std::array<::HudVisibility, 13>> mHudElementsVisibilityState;
134 ::ll::TypedStorage<8, 24, ::ServerLocatorBar> mServerLocatorBar;
135 ::ll::TypedStorage<8, 24, ::VanillaWaypointManager> mVanillaWaypointManager;
136 ::ll::TypedStorage<8, 24, ::Bedrock::NonOwnerPointer<::IPacketObserver>> mPacketObserver;
141 ServerPlayer& operator=(ServerPlayer
const&);
142 ServerPlayer(ServerPlayer
const&);
148 virtual ~ServerPlayer() =
default;
153 virtual void aiStep() ;
155 virtual void normalTick() ;
158 knockback(::Actor* source,
float damage,
float xd,
float zd,
::KnockbackParameters const& parameters) ;
162 virtual void moveView() ;
168 virtual bool isValidTarget(::Actor* attacker)
const ;
170 virtual bool swing(::ActorSwingSource swingSource, ::HandSlot handSlot) ;
173 hurtArmorSlots(
::ActorDamageSource const& source,
int dmg, ::std::bitset<5>
const hurtSlots) ;
175 virtual void sendArmorDamage(::std::bitset<5>
const damagedSlots) ;
177 virtual void sendArmor(::std::bitset<5>
const armorSlots) ;
179 virtual void setDamagedArmor(::SharedTypes::Legacy::ArmorSlot slot,
::ItemStack const& item) ;
181 virtual void sendInventory(
bool shouldSelectSlot) ;
185 virtual void sendComplexInventoryTransaction(::std::unique_ptr<::ComplexInventoryTransaction> transaction)
const
188 virtual void sendNetworkPacket(
::Packet& packet)
const ;
190 virtual void displayTextObjectMessage(
192 ::std::string
const& fromXuid,
193 ::std::string
const& fromPlatformId
196 virtual void displayTextObjectWhisperMessage(
198 ::std::string
const& xuid,
199 ::std::string
const& platformId
202 virtual void displayTextObjectWhisperMessage(
203 ::std::string
const& message,
204 ::std::string
const& xuid,
205 ::std::string
const& platformId
208 virtual void displayWhisperMessage(
209 ::std::string
const& author,
210 ::std::string
const& message,
211 ::std::optional<::std::string>
const filteredMessage,
212 ::std::string
const& xuid,
213 ::std::string
const& platformId
216 virtual void openTrading(
::ActorUniqueID const& uniqueID,
bool useNewScreen) ;
218 virtual void openPortfolio() ;
220 virtual void openNpcInteractScreen(::std::shared_ptr<::INpcDialogueData> npc) ;
222 virtual void openInventory() ;
224 virtual void openBook(
int,
bool,
int,
::BlockActor* lectern) ;
226 virtual void openSign(
::BlockPos const& position,
bool isFrontSide) ;
228 virtual void checkMovementStats(
::Vec3 const& d) ;
230 virtual ::HashedString getCurrentStructureFeature() const ;
232 virtual
void handleEntityEvent(::ActorEvent
id,
int data) ;
236 virtual
void slotChanged(
247 virtual
void stopSleepInBed(
bool forcefulWakeUp,
bool updateLevelList) ;
249 virtual
void setArmor(::SharedTypes::Legacy::ArmorSlot const armorSlot, ::
ItemStack const& item) ;
251 virtual
void setOffhandSlot(::
ItemStack const& item) ;
253 virtual
void clearVanishEnchantedItemsOnDeath() ;
255 virtual
bool canChangeDimensionsUsingPortal() const ;
259 virtual
void changeDimensionWithCredits(::
DimensionType dimension) ;
261 virtual
void setPlayerGameType(::GameType gameType) ;
263 virtual
void prepareRegion(::
ChunkSource& mainChunkSource) ;
265 virtual
bool isActorRelevant(::Actor const& actor) ;
269 virtual
void destroyRegion() ;
271 virtual
void onSuspension() ;
273 virtual
void onLinkedSlotsChanged() ;
275 virtual
bool isTeacher() const ;
277 virtual
bool isExternalCommunicationAllowed() const ;
279 virtual
bool isLoading() const ;
283 virtual
bool isPlayerInitialized() const ;
285 virtual
void respawn() ;
289 virtual
void destroyEditorPlayer() ;
291 virtual ::Bedrock::NonOwnerPointer<::Editor::IEditorPlayer> getEditorPlayer() const ;
293 virtual uchar getMaxChunkBuildRadius() const ;
297 virtual
void addChunksToQueue(::
std::vector<::
ChunkPos> const& chunkPostions,
bool isBiomeUpdate) ;
299 virtual
int _getSpawnChunkLimit() const;
301 virtual
void _updateChunkPublisherView(::
Vec3 const& position,
float minDistance);
303 virtual
void _serverInitItemStackIds() ;
313 ::ClientBlobCache::Server::ActiveTransfersManager& clientCacheMirror,
314 ::GameType playerGameType,
315 bool isHostingPlayer,
318 ::
std::function<
void(::ServerPlayer&)> onPlayerLoadedCallback,
320 ::
std::
string const& deviceId,
321 ::PlayerAuthenticationType authType,
324 bool enableItemStackNetManager,
326 ::PlatformType platformType,
327 ::InputMode inputMode,
332 ::CrashDumpLogStringID option1,
333 ::CrashDumpLogStringID option2,
334 ::CrashDumpLogStringID option3,
335 ::CrashDumpLogStringID option4
348 MCAPI
void disconnect();
350 MCAPI
void doDeleteContainerManager(
bool forceDisconnect);
352 MCAPI
void doInitialSpawn();
354 MCAPI ::
std::
string getLanguageCode() const;
358 MCAPI
void handleBlockPickRequestOnServer(::
BlockPos const& position,
bool withData);
360 MCAPI
void hideAllExcept(::
std::optional<::
std::vector<::HudElement>> const& hudElements);
362 MCAPI
void initiateContainerClose();
364 MCAPI
bool isInPickRangeOf(::
BlockPos const& pos) const;
366 MCAPI ::ContainerID openUnmanagedContainer(
367 ::SharedTypes::Legacy::ContainerType containerType,
375 MCAPI
bool selectItem(::
ItemStack const& item);
377 MCAPI
void sendPlayerContainerClosedEvent();
380 ::SharedTypes::Legacy::ContainerType type,
384 MCAPI
void setClientChunkRadius(uint requestedRadius, uchar clientMaxChunkRadius);
386 MCAPI
void setHudVisibilityState(
387 ::HudVisibility hudVisibility,
388 ::
std::optional<::
std::vector<::HudElement>> const& hudElements
401 ::ClientBlobCache::Server::ActiveTransfersManager& clientCacheMirror,
402 ::GameType playerGameType,
403 bool isHostingPlayer,
406 ::
std::function<
void(::ServerPlayer&)> onPlayerLoadedCallback,
408 ::
std::
string const& deviceId,
409 ::PlayerAuthenticationType authType,
412 bool enableItemStackNetManager,
414 ::PlatformType platformType,
415 ::InputMode inputMode,
427 MCAPI
void $normalTick();
429 MCAPI
void $knockback(::Actor* source,
float damage,
float xd,
float zd, ::
KnockbackParameters const& parameters);
439 MCAPI
bool $isValidTarget(::Actor* attacker) const;
441 MCAPI
bool $swing(::ActorSwingSource swingSource, ::HandSlot handSlot);
457 MCAPI
void $sendNetworkPacket(::
Packet& packet) const;
461 ::
std::
string const& fromXuid,
462 ::
std::
string const& fromPlatformId
467 ::
std::
string const& xuid,
468 ::
std::
string const& platformId
472 ::
std::
string const& message,
473 ::
std::
string const& xuid,
474 ::
std::
string const& platformId
478 ::
std::
string const& author,
479 ::
std::
string const& message,
480 ::
std::optional<::
std::
string> const filteredMessage,
481 ::
std::
string const& xuid,
482 ::
std::
string const& platformId
485 MCAPI
void $openTrading(::
ActorUniqueID const& uniqueID,
bool useNewScreen);
491 MCAPI
void $openInventory();
505 MCAPI
void $slotChanged(
520 MCAPI
void $setOffhandSlot(::
ItemStack const& item);
524 MCAPI
bool $canChangeDimensionsUsingPortal() const;
530 MCAPI
void $setPlayerGameType(::GameType gameType);
532 MCAPI
void $prepareRegion(::
ChunkSource& mainChunkSource);
554 MCAPI
void $respawn();
568 MCAPI
int $_getSpawnChunkLimit() const;
570 MCAPI
void $_updateChunkPublisherView(::
Vec3 const& position,
float minDistance);