LeviLamina
Loading...
Searching...
No Matches
PlayerPermissionsManager.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/deps/core/utility/NonOwnerPointer.h"
7#include "mc/deps/core/utility/pub_sub/Publisher.h"
8#include "mc/deps/core/utility/pub_sub/Subscription.h"
9#include "mc/legacy/ActorUniqueID.h"
10#include "mc/server/commands/PlayerPermissionLevel.h"
11#include "mc/world/actor/player/AbilitiesIndex.h"
12
13// auto generated forward declare list
14// clang-format off
15class Player;
18namespace Bedrock::PubSub::ThreadModel { struct SingleThreaded; }
19// clang-format on
20
21class PlayerPermissionsManager {
22public:
23 // member variables
24 // NOLINTBEGIN
25 ::ll::TypedStorage<8, 24, ::Bedrock::NonOwnerPointer<::PlayerAbilitiesManager>> mPlayerAbilitiesManager;
26 ::ll::TypedStorage<8, 24, ::Bedrock::NonOwnerPointer<::PlayerListManager>> mPlayerListManager;
27 ::ll::TypedStorage<8, 64, ::std::function<::Player*()>> mGetPrimaryLocalPlayer;
28 ::ll::TypedStorage<8, 8, ::ActorUniqueID> mCurrentPlayerID;
29 ::ll::TypedStorage<1, 2, ::std::optional<::PlayerPermissionLevel>> mCurrentPlayerPermissionLevel;
30 ::ll::TypedStorage<8, 24, ::std::vector<::std::pair<::AbilitiesIndex, bool>>> mCurrentPlayerPermissionsList;
31 ::ll::TypedStorage<8, 24, ::std::vector<::std::pair<::AbilitiesIndex, bool>>> mLocalPlayerPermissionsList;
32 ::ll::TypedStorage<8, 16, ::Bedrock::PubSub::Subscription> mPlayerAbilitiesSubscription;
33 ::ll::TypedStorage<
34 8,
35 48,
36 ::Bedrock::PubSub::
38 mPlayerPermissionsChangedPublisher;
39 ::ll::TypedStorage<
40 8,
41 48,
43 void(::ActorUniqueID const&, ::std::optional<::PlayerPermissionLevel>),
45 0>>
46 mCachedPlayerPermissionLevelChangedPublisher;
47 // NOLINTEND
48
49public:
50 // prevent constructor by default
51 PlayerPermissionsManager();
52
53public:
54 // virtual functions
55 // NOLINTBEGIN
56 virtual ~PlayerPermissionsManager();
57
58 virtual bool hasPlayerPermissions(::ActorUniqueID playerId) const;
59 // NOLINTEND
60
61public:
62 // member functions
63 // NOLINTBEGIN
64 MCAPI PlayerPermissionsManager(
67 ::std::function<::Player*()> getPrimaryLocalPlayer
68 );
69
70 MCAPI void _loadLocalPermissionsList();
71
72 MCAPI_C void _updatePermissionLevel();
73
74 MCAPI_C void _updatePermissionsList();
75
76 MCAPI_C bool arePermissionsSynced(
77 ::std::optional<::PlayerPermissionLevel> playerPermissionLevel,
78 ::std::vector<::std::pair<::AbilitiesIndex, bool>> playerPermissions
79 ) const;
80
81 MCAPI bool loadPlayerPermissions(::ActorUniqueID playerId);
82
83 MCAPI_C bool savePlayerPermissions(::ActorUniqueID playerId);
84 // NOLINTEND
85
86public:
87 // constructor thunks
88 // NOLINTBEGIN
89 MCAPI void* $ctor(
92 ::std::function<::Player*()> getPrimaryLocalPlayer
93 );
94 // NOLINTEND
95
96public:
97 // destructor thunk
98 // NOLINTBEGIN
99 MCAPI void $dtor();
100 // NOLINTEND
101
102public:
103 // virtual function thunks
104 // NOLINTBEGIN
105 MCAPI bool $hasPlayerPermissions(::ActorUniqueID playerId) const;
106
107
108 // NOLINTEND
109
110public:
111 // vftables
112 // NOLINTBEGIN
113 MCNAPI static void** $vftable();
114 // NOLINTEND
115};
Definition NonOwnerPointer.h:9
Definition Publisher.h:8
Definition PlayerAbilitiesManager.h:19
Definition PlayerListManager.h:23
static MCAPI void ** $vftable()
Definition Player.h:125
Definition ActorUniqueID.h:5