LeviLamina
Loading...
Searching...
No Matches
RealmsAllowListScreenController.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/client/gui/DirtyFlag.h"
7#include "mc/client/gui/ViewRequest.h"
8#include "mc/client/gui/screens/controllers/MainMenuScreenController.h"
9#include "mc/client/gui/screens/controllers/RealmPlayer.h"
10#include "mc/client/network/realms/RealmsAPI.h"
11#include "mc/client/network/realms/World.h"
12#include "mc/server/commands/PlayerPermissionLevel.h"
13
14// auto generated forward declare list
15// clang-format off
19class ProgressHandler;
20class UIPropertyBag;
21namespace Json { class Value; }
22namespace Realms { struct Player; }
23namespace Social { struct PlatformUserProfileData; }
24// clang-format on
25
27public:
28 // RealmsAllowListScreenController inner types define
29 enum class SearchState : int {
30 NotInitialized = -1,
31 NotFound = 0,
32 Found = 1,
33 };
34
35 enum class RealmPlayerList : int {
36 InvalidMemberList = -1,
37 MembersList = 0,
38 InvitedFriendsList = 1,
39 UninvitedFriendsList = 2,
40 BlockedPlayersList = 3,
41 };
42
43 using InviteList = ::std::map<::std::string, ::RealmsAPI::InviteAction>;
44
45public:
46 // member variables
47 // NOLINTBEGIN
48 ::ll::TypedStorage<8, 208, ::RealmPlayer> EMPTY_PLAYER;
49 ::ll::TypedStorage<1, 1, bool> mLoading;
50 ::ll::TypedStorage<1, 1, bool> mListsLoaded;
51 ::ll::TypedStorage<1, 1, bool> mFromExistingWorld;
52 ::ll::TypedStorage<8, 64, ::std::function<void()>> mFollowUpActionAfterCreation;
53 ::ll::TypedStorage<1, 1, bool> mRefreshUI;
54 ::ll::TypedStorage<1, 1, bool> mClickedRefresh;
55 ::ll::TypedStorage<8, 656, ::Realms::World> mWorld;
56 ::ll::TypedStorage<1, 1, bool> mInvitesSent;
57 ::ll::TypedStorage<8, 8, ::std::chrono::steady_clock::time_point> mLastRefreshUpdate;
58 ::ll::TypedStorage<8, 8, ::std::chrono::steady_clock::time_point> mLastFriendListUpdate;
59 ::ll::TypedStorage<1, 1, bool> mNewWorld;
60 ::ll::TypedStorage<1, 1, bool> mPermissionsDirty;
61 ::ll::TypedStorage<1, 1, bool> mMembersListDirty;
62 ::ll::TypedStorage<8, 8, ::std::chrono::steady_clock::time_point> mLastTryJoin;
63 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::ProgressHandler>> mProgressHandler;
64 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::PlatformMultiplayerRestrictions>> mPlatformMultiplayerRestrictions;
65 ::ll::TypedStorage<8, 16, ::std::shared_ptr<::DropdownScreenController>> mMembersDropdownController;
66 ::ll::TypedStorage<8, 16, ::std::shared_ptr<::DropdownScreenController>> mInvitedFriendsDropdownController;
67 ::ll::TypedStorage<4, 4, int> mUninvitedFriendsPageIndex;
68 ::ll::TypedStorage<4, 4, int> mInvitedFriendsPageIndex;
69 ::ll::TypedStorage<4, 4, int> mMembersPageIndex;
70 ::ll::TypedStorage<4, 4, int> mBlockedPlayersPageIndex;
71 ::ll::TypedStorage<1, 1, ::PlayerPermissionLevel> mDefaultPermission;
72 ::ll::TypedStorage<1, 1, ::PlayerPermissionLevel> mDefaultPermissionOld;
73 ::ll::TypedStorage<8, 32, ::std::string> mUninvitedFriendsLastFilter;
74 ::ll::TypedStorage<8, 32, ::std::string> mInvitedFriendsLastFilter;
75 ::ll::TypedStorage<8, 32, ::std::string> mMembersLastFilter;
76 ::ll::TypedStorage<8, 32, ::std::string> mBlockedPlayersLastFilter;
77 ::ll::TypedStorage<4, 4, int> mPreviousMembersPageIndex;
78 ::ll::TypedStorage<4, 4, int> mPreviousInvitedFriendsPageIndex;
79 ::ll::TypedStorage<4, 4, int> mPreviousUninvitedFriendsPageIndex;
80 ::ll::TypedStorage<4, 4, int> mPreviousBlockedPlayersPageIndex;
81 ::ll::TypedStorage<8, 64, ::std::unordered_map<::std::string, ::RealmPlayer>> mCompleteWorldPlayerList;
82 ::ll::TypedStorage<8, 64, ::std::unordered_map<::std::string, ::Social::PlatformUserProfileData>>
83 mLinkedPlatformAccounts;
84 ::ll::TypedStorage<4, 4, ::std::atomic<uint>> mLinkedAccountLoadCounter;
85 ::ll::TypedStorage<8, 24, ::std::vector<::std::string>> mCurrentMembersList;
86 ::ll::TypedStorage<8, 24, ::std::vector<::std::string>> mFullMembersList;
87 ::ll::TypedStorage<8, 24, ::std::vector<::std::string>> mFilteredMembersList;
88 ::ll::TypedStorage<8, 24, ::std::vector<::std::string>> mCurrentInvitedFriendsList;
89 ::ll::TypedStorage<8, 24, ::std::vector<::std::string>> mFullInvitedFriendsList;
90 ::ll::TypedStorage<8, 24, ::std::vector<::std::string>> mFilteredInvitedFriendsList;
91 ::ll::TypedStorage<8, 24, ::std::vector<::std::string>> mCurrentUninvitedFriendsList;
92 ::ll::TypedStorage<8, 24, ::std::vector<::std::string>> mFullUninvitedFriendsList;
93 ::ll::TypedStorage<8, 24, ::std::vector<::std::string>> mFilteredUninvitedFriendsList;
94 ::ll::TypedStorage<8, 24, ::std::vector<::std::string>> mCurrentBlockedPlayersList;
95 ::ll::TypedStorage<8, 24, ::std::vector<::std::string>> mFullBlockedPlayersList;
96 ::ll::TypedStorage<8, 24, ::std::vector<::std::string>> mFilteredBlockedPlayersList;
97 ::ll::TypedStorage<8, 24, ::std::vector<::std::string>> mPendingXuidsForLinkedAccounts;
98 ::ll::TypedStorage<8, 64, ::std::unordered_set<::std::string>> mPreviouslyObservedXboxLiveFriends;
99 ::ll::TypedStorage<8, 32, ::std::string> mSharePopupBButtonDescription;
100 ::ll::TypedStorage<4, 4, uint> mCurrentUpdatedPlayers;
101 ::ll::TypedStorage<1, 1, bool> mShowLinkedAccounts;
102 // NOLINTEND
103
104public:
105 // prevent constructor by default
106 RealmsAllowListScreenController();
107
108public:
109 // virtual functions
110 // NOLINTBEGIN
111 virtual ~RealmsAllowListScreenController() /*override*/;
112
113 virtual void onLeave() /*override*/;
114
115 virtual ::ui::DirtyFlag tick() /*override*/;
116
117 virtual void addStaticScreenVars(::Json::Value& globalVars) /*override*/;
118
119 virtual ::std::string _getButtonBDescription() /*override*/;
120
121 virtual bool _getGamepadHelperVisible() const /*override*/;
122 // NOLINTEND
123
124public:
125 // member functions
126 // NOLINTBEGIN
127 MCAPI RealmsAllowListScreenController(
128 ::std::shared_ptr<::MainMenuScreenModel> model,
129 ::Realms::World const& world,
130 bool const& fromExistingWorld,
131 ::std::function<void()> followUpCallbackAfterCreation,
132 bool fromSettingsOrAllowListEntryPoint
133 );
134
135 MCAPI void _buildPlayerList();
136
137 MCAPI void _clearFromFriendLists(::std::string const& xuid);
138
139 MCAPI void _clearMemberList();
140
141 MCAPI void _finalizeLinkedAccountLoading();
142
143 MCAPI void _getBlocklistProfiles(::std::vector<::std::string> allXuids, ::std::vector<::std::string> blockList);
144
145 MCAPI ::std::map<::std::string, ::RealmsAPI::InviteAction> _getInvitesToSend() const;
146
147 MCAPI ::RealmPlayer*
148 _getRealmPlayerAtIndex(int index, ::RealmsAllowListScreenController::RealmPlayerList realmPlayerList);
149
150 MCAPI ::RealmPlayer* _getRealmPlayerFromXuid(::std::string const& xuid);
151
152 MCAPI ::RealmsAllowListScreenController::RealmPlayerList const
153 _getRealmPlayerListFromCollection(::UIPropertyBag const* bag) const;
154
155 MCAPI void _handleDoesNotHavePermission(::std::function<void()> newWorldCallback);
156
157 MCAPI ::ui::ViewRequest _handleInviteClick(::UIPropertyBag* bag);
158
159 MCAPI void _handlePlayerInvite(::RealmPlayer& player);
160
161 MCAPI void _handleUpdateFailed(::std::function<void()> callback);
162
163 MCAPI void _initializeLinkedAccounts(
164 ::std::vector<::std::string>& platformIds,
165 ::std::vector<::Social::PlatformUserProfileData> const& platformProfiles
166 );
167
168 MCAPI void _initializePlayerList(::std::function<void()> callback);
169
170 MCAPI void _joinRealm();
171
172 MCAPI void _registerBindings();
173
174 MCAPI void _registerEventHandlers();
175
176 MCAPI void _requestPlatformGamerpic(::Social::PlatformUserProfileData const& platformEntry);
177
178 MCAPI void _sendInvites(::std::function<void()> callback);
179
180 MCAPI bool _shouldUpdateFriendsList();
181
182 MCAPI void _sortPlayerList();
183
184 MCAPI void _updateFriendsList();
185
186 MCAPI void _updateLinkedAccountLoading();
187
188 MCAPI void _updatePlayerList(
189 ::std::vector<::Realms::Player> const& newPlayers,
190 ::std::vector<::Realms::Player> const& newBlockList
191 );
192
193 MCAPI void _updatePlayerlistModel(
194 ::std::string const& filter,
195 ::RealmsAllowListScreenController::RealmPlayerList realmPlayerList,
196 bool forceUpdate
197 );
198
199 MCAPI void sendDefaultPermission(::PlayerPermissionLevel const& permission);
200
201 MCAPI void sendInvitesWithProgress(::std::function<void()> callback);
202
203 MCAPI void sendUserPermission(
204 ::std::string const& xuid,
205 ::PlayerPermissionLevel permission,
206 ::PlayerPermissionLevel oldPermission
207 );
208
209 MCAPI void updateWorld(::Realms::World const& world, ::std::function<void()> callback);
210 // NOLINTEND
211
212public:
213 // constructor thunks
214 // NOLINTBEGIN
215 MCAPI void* $ctor(
216 ::std::shared_ptr<::MainMenuScreenModel> model,
217 ::Realms::World const& world,
218 bool const& fromExistingWorld,
219 ::std::function<void()> followUpCallbackAfterCreation,
220 bool fromSettingsOrAllowListEntryPoint
221 );
222 // NOLINTEND
223
224public:
225 // destructor thunk
226 // NOLINTBEGIN
227 MCAPI void $dtor();
228 // NOLINTEND
229
230public:
231 // virtual function thunks
232 // NOLINTBEGIN
233 MCAPI void $onLeave();
234
235 MCAPI ::ui::DirtyFlag $tick();
236
237 MCAPI void $addStaticScreenVars(::Json::Value& globalVars);
238
239 MCAPI ::std::string $_getButtonBDescription();
240
241 MCAPI bool $_getGamepadHelperVisible() const;
242 // NOLINTEND
243
244public:
245 // vftables
246 // NOLINTBEGIN
247 MCNAPI static void** $vftableForScreenController();
248
250 // NOLINTEND
251};
Definition DropdownScreenController.h:5
Definition Value.h:16
Definition MainMenuScreenController.h:5
Definition MainMenuScreenModel.h:5
Definition PlatformMultiplayerRestrictions.h:5
Definition ProgressHandler.h:5
Definition RealmsAllowListScreenController.h:5
static MCAPI void ** $vftableForScreenController()
static MCAPI void ** $vftableForEnableNonOwnerReferences()
Definition UIPropertyBag.h:5
Definition Player.h:7
Definition PlatformUserProfileData.h:7