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() ;
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) ;
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,
331 MCAPI
void _logCDEvent(
332 ::CrashDumpLogStringID option1,
333 ::CrashDumpLogStringID option2,
334 ::CrashDumpLogStringID option3,
335 ::CrashDumpLogStringID option4
338 MCAPI
void _removeNearbyEntities();
342 MCAPI
void addActorToReplicationList(::gsl::not_null<::Actor*> actor,
bool autonomous);
344 MCAPI
void createEditorPlayer(::Bedrock::NonOwnerPointer<::Editor::IEditorManager> editorManager);
346 MCAPI
void disconnect();
348 MCAPI
void doDeleteContainerManager(
bool forceDisconnect);
350 MCAPI
void doInitialSpawn();
352 MCAPI ::
std::
string getLanguageCode() const;
354 MCAPI
void handleActorPickRequestOnServer(::Actor& target,
bool withData,
bool isActorAgentAndEduMode);
356 MCAPI
void handleBlockPickRequestOnServer(::
BlockPos const& position,
bool withData);
358 MCAPI
void hideAllExcept(::
std::optional<::
std::vector<::HudElement>> const& hudElements);
360 MCAPI
void initiateContainerClose();
362 MCAPI
bool isInPickRangeOf(::
BlockPos const& pos) const;
364 MCAPI ::ContainerID openUnmanagedContainer(
365 ::SharedTypes::Legacy::ContainerType containerType,
369 MCAPI
void postReplicationTick(::
Tick const& currentTick);
371 MCAPI
void preReplicationTick(::
Tick const& currentTick);
373 MCAPI
bool selectItem(::
ItemStack const& item);
375 MCAPI
void sendPlayerContainerClosedEvent();
377 MCAPI
void sendPlayerContainerOpenedEvent(
378 ::SharedTypes::Legacy::ContainerType type,
382 MCAPI
void setClientChunkRadius(uint requestedRadius, uchar clientMaxChunkRadius);
384 MCAPI
void setHudVisibilityState(
385 ::HudVisibility hudVisibility,
386 ::
std::optional<::
std::vector<::HudElement>> const& hudElements
399 ::ClientBlobCache::Server::ActiveTransfersManager& clientCacheMirror,
400 ::GameType playerGameType,
401 bool isHostingPlayer,
404 ::
std::function<
void(::ServerPlayer&)> onPlayerLoadedCallback,
406 ::
std::
string const& deviceId,
407 ::PlayerAuthenticationType authType,
410 bool enableItemStackNetManager,
412 ::PlatformType platformType,
413 ::InputMode inputMode,
427 MCAPI
void $initializeComponents(::ActorInitializationMethod method, ::
VariantParameterList const& params);
429 MCAPI
void $aiStep();
431 MCAPI
void $normalTick();
433 MCAPI
void $knockback(::Actor* source,
float damage,
float xd,
float zd, ::
KnockbackParameters const& parameters);
437 MCAPI
void $moveView();
439 MCAPI
void $moveSpawnView(::
Vec3 const& spawnPosition, ::
DimensionType dimension);
443 MCAPI
bool $isValidTarget(::Actor* attacker) const;
445 MCAPI
bool $swing(::ActorSwingSource swingSource, ::HandSlot handSlot);
447 MCAPI
void $hurtArmorSlots(::
ActorDamageSource const& source,
int dmg, ::
std::bitset<5> const hurtSlots);
449 MCAPI
void $sendArmorDamage(::
std::bitset<5> const damagedSlots);
451 MCAPI
void $sendArmor(::
std::bitset<5> const armorSlots);
453 MCAPI
void $setDamagedArmor(::SharedTypes::Legacy::ArmorSlot slot, ::
ItemStack const& item);
455 MCAPI
void $sendInventory(
bool shouldSelectSlot);
461 MCAPI
void $sendNetworkPacket(::
Packet& packet) const;
463 MCAPI
void $displayTextObjectMessage(
465 ::
std::
string const& fromXuid,
466 ::
std::
string const& fromPlatformId
469 MCAPI
void $displayTextObjectWhisperMessage(
471 ::
std::
string const& xuid,
472 ::
std::
string const& platformId
475 MCAPI
void $displayTextObjectWhisperMessage(
476 ::
std::
string const& message,
477 ::
std::
string const& xuid,
478 ::
std::
string const& platformId
481 MCAPI
void $displayWhisperMessage(
482 ::
std::
string const& author,
483 ::
std::
string const& message,
484 ::
std::optional<::
std::
string> const filteredMessage,
485 ::
std::
string const& xuid,
486 ::
std::
string const& platformId
489 MCAPI
void $openTrading(::
ActorUniqueID const& uniqueID,
bool useNewScreen);
491 MCFOLD
void $openPortfolio();
495 MCAPI
void $openInventory();
497 MCAPI
void $openBook(
int,
bool,
int, ::
BlockActor* lectern);
499 MCAPI
void $openSign(::
BlockPos const& position,
bool isFrontSide);
501 MCAPI
void $checkMovementStats(::
Vec3 const& d);
503 MCAPI ::
HashedString $getCurrentStructureFeature() const;
505 MCAPI
void $handleEntityEvent(::ActorEvent
id,
int data);
509 MCAPI
void $slotChanged(
520 MCAPI
void $stopSleepInBed(
bool forcefulWakeUp,
bool updateLevelList);
522 MCAPI
void $setArmor(::SharedTypes::Legacy::ArmorSlot const armorSlot, ::
ItemStack const& item);
524 MCAPI
void $setOffhandSlot(::
ItemStack const& item);
526 MCAPI
void $clearVanishEnchantedItemsOnDeath();
528 MCAPI
bool $canChangeDimensionsUsingPortal() const;
532 MCAPI
void $changeDimensionWithCredits(::
DimensionType dimension);
534 MCAPI
void $setPlayerGameType(::GameType gameType);
536 MCAPI
void $prepareRegion(::
ChunkSource& mainChunkSource);
538 MCAPI
bool $isActorRelevant(::Actor const& actor);
542 MCAPI
void $destroyRegion();
544 MCAPI
void $onSuspension();
546 MCAPI
void $onLinkedSlotsChanged();
548 MCAPI
bool $isTeacher() const;
550 MCAPI
bool $isExternalCommunicationAllowed() const;
552 MCAPI
bool $isLoading() const;
556 MCAPI
bool $isPlayerInitialized() const;
558 MCAPI
void $respawn();
562 MCAPI
void $destroyEditorPlayer();
564 MCAPI ::Bedrock::NonOwnerPointer<::Editor::IEditorPlayer> $getEditorPlayer() const;
566 MCAPI uchar $getMaxChunkBuildRadius() const;
570 MCAPI
void $addChunksToQueue(::
std::vector<::
ChunkPos> const& chunkPostions);
572 MCAPI
int $_getSpawnChunkLimit() const;
574 MCAPI
void $_updateChunkPublisherView(::
Vec3 const& position,
float minDistance);
576 MCAPI
void $_serverInitItemStackIds();