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