LeviLamina
Loading...
Searching...
No Matches
PlayerLocationSender.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/deps/core/math/Vec3.h"
7#include "mc/deps/core/utility/NonOwnerPointer.h"
8#include "mc/platform/brstd/flat_map.h"
9#include "mc/world/level/dimension/DimensionType.h"
10
11// auto generated forward declare list
12// clang-format off
13class PacketSender;
14class Player;
16class WeakEntityRef;
17struct ActorUniqueID;
18// clang-format on
19
20class PlayerLocationSender {
21public:
22 // PlayerLocationSender inner types declare
23 // clang-format off
26 struct PlayerLocationData;
27 // clang-format on
28
29 // PlayerLocationSender inner types define
31
33
35 public:
36 // member variables
37 // NOLINTBEGIN
38 ::ll::TypedStorage<4, 16, ::std::optional<::Vec3>> mPosition;
39 ::ll::TypedStorage<4, 4, ::DimensionType> mDimension;
40 ::ll::TypedStorage<1, 1, bool> mIsSpectator;
41 // NOLINTEND
42 };
43
44 using OptionalPosition = ::std::optional<::Vec3>;
45
46public:
47 // member variables
48 // NOLINTBEGIN
49 ::ll::TypedStorage<
50 8,
51 48,
56 ::std::vector<::ActorUniqueID>,
57 ::std::vector<::PlayerLocationSender::PlayerLocationData>>>
58 mCurrentPlayerLocationData;
59 ::ll::TypedStorage<
60 8,
61 48,
63 ::std::pair<::ActorUniqueID, ::ActorUniqueID>,
64 ::std::optional<::Vec3>,
66 ::std::vector<::std::pair<::ActorUniqueID, ::ActorUniqueID>>,
67 ::std::vector<::std::optional<::Vec3>>>>
68 mSentPlayerData;
69 ::ll::TypedStorage<8, 24, ::Bedrock::NonOwnerPointer<::PacketSender>> mPacketSender;
70 ::ll::TypedStorage<4, 4, float> mSimulationDistance;
71 // NOLINTEND
72
73public:
74 // prevent constructor by default
75 PlayerLocationSender();
76
77public:
78 // member functions
79 // NOLINTBEGIN
80 MCAPI PlayerLocationSender(
81 ::PacketSender& packetSender,
82 int simulationDistanceChunks,
83 float simulationDistanceMultiplyFactor
84 );
85
86 MCAPI void _checkPlayerPairAndMaybeSendPacket(
87 ::UserEntityIdentifierComponent const& userIdentifier,
88 ::Player const& viewingPlayer,
89 ::Player const& observedPlayer
90 );
91
92 MCAPI void _forEachClientPlayerPair(
93 ::std::vector<::WeakEntityRef> const& gameplayUsers,
94 ::std::function<void(::UserEntityIdentifierComponent const&, ::Player const&, ::Player const&)> action
95 );
96
97 MCAPI bool _shouldSendPositionPacket(
98 ::Vec3 const& viewingPlayerPosition,
99 ::DimensionType const& viewingPlayerDimension,
100 bool viewingPlayerIsSpectator,
101 ::std::optional<::Vec3> const& observedPlayerPosPrev,
102 ::PlayerLocationSender::PlayerLocationData const& observedPlayerPositionNew
103 ) const;
104
105 MCAPI void _updatePlayerData(::Player const& player);
106
107 MCAPI void checkPlayerPairsAndMaybeSendPackets(::std::vector<::WeakEntityRef> const& gameplayUsers);
108
109 MCAPI void sendPacketsHidingAllPlayers(::std::vector<::WeakEntityRef> const& gameplayUsers);
110
111 MCAPI void updatePlayersData(::std::vector<::WeakEntityRef> const& gameplayUsers);
112
113 MCAPI ~PlayerLocationSender();
114 // NOLINTEND
115
116public:
117 // static variables
118 // NOLINTBEGIN
119 MCAPI static ::PlayerLocationSender::PlayerLocationData const& NULL_PLAYER_LOCATION_DATA();
120 // NOLINTEND
121
122public:
123 // constructor thunks
124 // NOLINTBEGIN
125 MCAPI void*
126 $ctor(::PacketSender& packetSender, int simulationDistanceChunks, float simulationDistanceMultiplyFactor);
127 // NOLINTEND
128
129public:
130 // destructor thunk
131 // NOLINTBEGIN
132 MCAPI void $dtor();
133 // NOLINTEND
134};
Definition PacketSender.h:17
Definition Player.h:137
Definition UserEntityIdentifierComponent.h:17
Definition Vec3.h:10
Definition WeakEntityRef.h:14
Definition flat_map.h:15
Definition ActorUniqueID.h:10
Definition DimensionType.h:5
Definition PlayerLocationSender.h:30
Definition PlayerLocationSender.h:32
Definition PlayerLocationSender.h:34