74class ServerPlayer :
public ::Player {
85 enum class State :
int {
95 ::ll::TypedStorage<1, 1, bool> isAutonomous;
96 ::ll::TypedStorage<4, 4, ::ServerPlayer::NearbyActor::State> state;
97 ::ll::TypedStorage<8, 8, ::Actor*> tempActor;
101 using OnPlayerLoadedCallback = ::std::function<void(::ServerPlayer&)>;
104 LLNDAPI
static ServerPlayer* tryGetFromEntity(
::EntityContext& entity,
bool includeRemoved);
109 ::ll::TypedStorage<4, 4, ::PlatformType> mPlatformType;
110 ::ll::TypedStorage<8, 32, ::std::string> mLanguageCode;
111 ::ll::TypedStorage<8, 8, ::ServerNetworkSystem&> mNetwork;
112 ::ll::TypedStorage<8, 64, ::std::function<void(::ServerPlayer&)>> mOnPlayerLoadedCallback;
113 ::ll::TypedStorage<8, 112, ::InventoryMenu> mInventoryMenu;
114 ::ll::TypedStorage<1, 1, ::ContainerID> mContainerCounter;
115 ::ll::TypedStorage<8, 16, ::CallbackToken> mCloseContainerToken;
116 ::ll::TypedStorage<4, 4, uint> mMaxChunkRadius;
117 ::ll::TypedStorage<1, 1, bool> mIsInitialPlayerLoadHappening;
118 ::ll::TypedStorage<1, 1, bool> mIsTeacher;
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;
140 ServerPlayer& operator=(ServerPlayer
const&);
141 ServerPlayer(ServerPlayer
const&);
147 virtual ~ServerPlayer() ;
152 virtual void aiStep() ;
154 virtual void normalTick() ;
157 knockback(::Actor* source,
int damage,
float xd,
float zd,
::KnockbackParameters const& parameters) ;
161 virtual void moveView() ;
167 virtual bool isValidTarget(::Actor*)
const ;
169 virtual bool swing(::ActorSwingSource swingSource) ;
172 hurtArmorSlots(
::ActorDamageSource const& source,
int dmg, ::std::bitset<5>
const hurtSlots) ;
174 virtual void sendArmorDamage(::std::bitset<5>
const damagedSlots) ;
176 virtual void sendArmor(::std::bitset<5>
const armorSlots) ;
178 virtual void setDamagedArmor(::SharedTypes::Legacy::ArmorSlot slot,
::ItemStack const& item) ;
180 virtual void sendInventory(
bool shouldSelectSlot) ;
184 virtual void sendComplexInventoryTransaction(::std::unique_ptr<::ComplexInventoryTransaction> transaction)
const
187 virtual void sendNetworkPacket(
::Packet& packet)
const ;
189 virtual void displayTextObjectMessage(
191 ::std::string
const& fromXuid,
192 ::std::string
const& fromPlatformId
195 virtual void displayTextObjectWhisperMessage(
197 ::std::string
const& xuid,
198 ::std::string
const& platformId
201 virtual void displayTextObjectWhisperMessage(
202 ::std::string
const& message,
203 ::std::string
const& xuid,
204 ::std::string
const& platformId
207 virtual void displayWhisperMessage(
208 ::std::string
const& author,
209 ::std::string
const& message,
210 ::std::optional<::std::string>
const filteredMessage,
211 ::std::string
const& xuid,
212 ::std::string
const& platformId
215 virtual void openTrading(
::ActorUniqueID const& uniqueID,
bool useNewScreen) ;
217 virtual void openPortfolio() ;
219 virtual void openNpcInteractScreen(::std::shared_ptr<::INpcDialogueData> npc) ;
221 virtual void openInventory() ;
223 virtual void openBook(
int lectern,
bool,
int,
::BlockActor*) ;
225 virtual void openSign(
::BlockPos const& position,
bool isFrontSide) ;
227 virtual void checkMovementStats(
::Vec3 const& d) ;
229 virtual ::HashedString getCurrentStructureFeature() const ;
231 virtual
void handleEntityEvent(::ActorEvent
id,
int data) ;
235 virtual
void slotChanged(
246 virtual
void stopSleepInBed(
bool forcefulWakeUp,
bool updateLevelList) ;
248 virtual
void setArmor(::SharedTypes::Legacy::ArmorSlot const armorSlot, ::
ItemStack const& item) ;
250 virtual
void setOffhandSlot(::
ItemStack const& item) ;
252 virtual
void clearVanishEnchantedItemsOnDeath() ;
254 virtual
bool canChangeDimensionsUsingPortal() const ;
258 virtual
void changeDimensionWithCredits(::
DimensionType dimension) ;
260 virtual
void setPlayerGameType(::GameType gameType) ;
262 virtual
void prepareRegion(::
ChunkSource& mainChunkSource) ;
264 virtual
bool isActorRelevant(::Actor const& actor) ;
268 virtual
void destroyRegion() ;
270 virtual
void onSuspension() ;
272 virtual
void onLinkedSlotsChanged() ;
274 virtual
bool isTeacher() const ;
276 virtual
bool isLoading() const ;
280 virtual
bool isPlayerInitialized() const ;
282 virtual
void respawn() ;
286 virtual
void destroyEditorPlayer() ;
288 virtual ::Bedrock::NonOwnerPointer<::Editor::IEditorPlayer> getEditorPlayer() const ;
290 virtual uchar getMaxChunkBuildRadius() const ;
294 virtual
int _getSpawnChunkLimit() const;
296 virtual
void _updateChunkPublisherView(::
Vec3 const& position,
float minDistance);
298 virtual
void _serverInitItemStackIds() ;
308 ::ClientBlobCache::Server::ActiveTransfersManager& clientCacheMirror,
309 ::GameType playerGameType,
310 bool isHostingPlayer,
313 ::
std::function<
void(::ServerPlayer&)> onPlayerLoadedCallback,
315 ::
std::
string const& deviceId,
316 ::PlayerAuthenticationType authType,
319 bool enableItemStackNetManager,
321 ::PlatformType platformType,
322 ::InputMode inputMode,
326 MCAPI
bool _checkForLoadedTickingAreas() const;
328 MCAPI
void _logCDEvent(
329 ::CrashDumpLogStringID option1,
330 ::CrashDumpLogStringID option2,
331 ::CrashDumpLogStringID option3,
332 ::CrashDumpLogStringID option4
335 MCAPI ::ContainerID _nextContainerCounter();
337 MCAPI
void _removeNearbyEntities();
341 MCAPI
void _updateNearbyActors();
343 MCAPI
void _updateWaitingForTickingAreasPreload();
345 MCAPI
void addActorToReplicationList(::gsl::not_null<::Actor*> actor,
bool autonomous);
347 MCAPI
void createEditorPlayer(::Bedrock::NonOwnerPointer<::Editor::IEditorManager> editorManager);
349 MCAPI
void disconnect();
351 MCAPI
void doDeleteContainerManager(
bool forceDisconnect);
353 MCAPI
void doInitialSpawn();
355 MCAPI ::Bedrock::DDUI::DataStoreSyncServer& getDataStoreSync();
357 MCAPI
bool getFilterProfanity() const;
359 MCAPI ::
std::array<::HudVisibility, 13> const& getHudVisibilityState() const;
363 MCAPI ::
std::
string getLanguageCode() const;
365 MCAPI
int getMaxClientViewDistance() const;
367 MCAPI ::DeviceMemoryTier getMemoryTier() const;
369 MCAPI ::PlatformType getPlatformType() const;
373 MCAPI ::
std::optional<
int> getTextFilteringDebugTimeoutMilliSeconds() const;
375 MCAPI
void handleActorPickRequestOnServer(::Actor& target,
bool withData,
bool isActorAgentAndEduMode);
377 MCAPI
void handleBlockPickRequestOnServer(::
BlockPos const& position,
bool withData);
379 MCAPI
void hideAllExcept(::
std::optional<::
std::vector<::HudElement>> const& hudElements);
381 MCAPI
void initiateContainerClose();
383 MCAPI
bool isCompatibleWithClientSideChunkGen() const;
385 MCAPI
bool isInPickRangeOf(::
BlockPos const& pos) const;
387 MCAPI
bool isPendingDisconnect() const;
389 MCAPI
bool isShowingCredits() const;
391 MCAPI ::ContainerID openUnmanagedContainer(
392 ::SharedTypes::Legacy::ContainerType containerType,
396 MCAPI
void postLoad(
bool newPlayerCreated);
398 MCAPI
void postReplicationTick(::
Tick const& currentTick);
400 MCAPI
void preReplicationTick(::
Tick const& currentTick);
402 MCAPI
bool selectItem(::
ItemStack const& item);
404 MCAPI
void sendMobEffectPackets();
406 MCAPI
void sendPlayerAuthInputReceivedEvent();
408 MCAPI
void sendPlayerContainerClosedEvent();
410 MCAPI
void sendPlayerContainerOpenedEvent(
411 ::SharedTypes::Legacy::ContainerType type,
415 MCAPI
void setClientChunkRadius(uint requestedRadius, uchar clientMaxChunkRadius);
417 MCAPI
void setHudVisibilityState(
418 ::HudVisibility hudVisibility,
419 ::
std::optional<::
std::vector<::HudElement>> const& hudElements
422 MCAPI
void setIsCompatibleWithClientSideChunkGen(
bool isCompatible);
424 MCAPI
void setIsPendingDisconnect(
bool isPendingDisconnect);
426 MCAPI
void setIsShowingCredits(
bool value);
428 MCAPI
void setLanguageCode(::
std::
string const& languageCode);
430 MCAPI
void setLocalPlayerAsInitialized();
432 MCAPI
void triggerRespawnFromCompletingTheEnd();
452 ::ClientBlobCache::Server::ActiveTransfersManager& clientCacheMirror,
453 ::GameType playerGameType,
454 bool isHostingPlayer,
457 ::
std::function<
void(::ServerPlayer&)> onPlayerLoadedCallback,
459 ::
std::
string const& deviceId,
460 ::PlayerAuthenticationType authType,
463 bool enableItemStackNetManager,
465 ::PlatformType platformType,
466 ::InputMode inputMode,
480 MCAPI
void $initializeComponents(::ActorInitializationMethod method, ::
VariantParameterList const& params);
482 MCAPI
void $aiStep();
484 MCAPI
void $normalTick();
486 MCAPI
void $knockback(::Actor* source,
int damage,
float xd,
float zd, ::
KnockbackParameters const& parameters);
490 MCAPI
void $moveView();
492 MCAPI
void $moveSpawnView(::
Vec3 const& spawnPosition, ::
DimensionType dimension);
496 MCAPI
bool $isValidTarget(::Actor*) const;
498 MCAPI
bool $swing(::ActorSwingSource swingSource);
500 MCAPI
void $hurtArmorSlots(::
ActorDamageSource const& source,
int dmg, ::
std::bitset<5> const hurtSlots);
502 MCAPI
void $sendArmorDamage(::
std::bitset<5> const damagedSlots);
504 MCAPI
void $sendArmor(::
std::bitset<5> const armorSlots);
506 MCAPI
void $setDamagedArmor(::SharedTypes::Legacy::ArmorSlot slot, ::
ItemStack const& item);
508 MCAPI
void $sendInventory(
bool shouldSelectSlot);
514 MCAPI
void $sendNetworkPacket(::
Packet& packet) const;
516 MCAPI
void $displayTextObjectMessage(
518 ::
std::
string const& fromXuid,
519 ::
std::
string const& fromPlatformId
522 MCAPI
void $displayTextObjectWhisperMessage(
524 ::
std::
string const& xuid,
525 ::
std::
string const& platformId
528 MCAPI
void $displayTextObjectWhisperMessage(
529 ::
std::
string const& message,
530 ::
std::
string const& xuid,
531 ::
std::
string const& platformId
534 MCAPI
void $displayWhisperMessage(
535 ::
std::
string const& author,
536 ::
std::
string const& message,
537 ::
std::optional<::
std::
string> const filteredMessage,
538 ::
std::
string const& xuid,
539 ::
std::
string const& platformId
542 MCAPI
void $openTrading(::
ActorUniqueID const& uniqueID,
bool useNewScreen);
544 MCFOLD
void $openPortfolio();
548 MCAPI
void $openInventory();
550 MCAPI
void $openBook(
int lectern,
bool,
int, ::
BlockActor*);
552 MCAPI
void $openSign(::
BlockPos const& position,
bool isFrontSide);
554 MCAPI
void $checkMovementStats(::
Vec3 const& d);
556 MCAPI ::
HashedString $getCurrentStructureFeature() const;
558 MCAPI
void $handleEntityEvent(::ActorEvent
id,
int data);
562 MCAPI
void $slotChanged(
573 MCAPI
void $stopSleepInBed(
bool forcefulWakeUp,
bool updateLevelList);
575 MCAPI
void $setArmor(::SharedTypes::Legacy::ArmorSlot const armorSlot, ::
ItemStack const& item);
577 MCAPI
void $setOffhandSlot(::
ItemStack const& item);
579 MCAPI
void $clearVanishEnchantedItemsOnDeath();
581 MCAPI
bool $canChangeDimensionsUsingPortal() const;
585 MCAPI
void $changeDimensionWithCredits(::
DimensionType dimension);
587 MCAPI
void $setPlayerGameType(::GameType gameType);
589 MCAPI
void $prepareRegion(::
ChunkSource& mainChunkSource);
591 MCAPI
bool $isActorRelevant(::Actor const& actor);
595 MCAPI
void $destroyRegion();
597 MCAPI
void $onSuspension();
599 MCAPI
void $onLinkedSlotsChanged();
601 MCAPI
bool $isTeacher() const;
603 MCAPI
bool $isLoading() const;
607 MCAPI
bool $isPlayerInitialized() const;
609 MCAPI
void $respawn();
613 MCAPI
void $destroyEditorPlayer();
615 MCAPI ::Bedrock::NonOwnerPointer<::Editor::IEditorPlayer> $getEditorPlayer() const;
617 MCAPI uchar $getMaxChunkBuildRadius() const;
621 MCAPI
int $_getSpawnChunkLimit() const;
623 MCAPI
void $_updateChunkPublisherView(::
Vec3 const& position,
float minDistance);
625 MCAPI
void $_serverInitItemStackIds();
633 MCAPI static
void** $vftable();