3#include "mc/_HeaderOutputPredefine.h"
6#include "mc/client/gui/screens/models/LegacyWorldConversionManager.h"
7#include "mc/client/gui/screens/models/MainMenuScreenModel.h"
8#include "mc/client/gui/screens/models/PlayScreenDefaultTab.h"
9#include "mc/client/gui/screens/models/WorldType.h"
10#include "mc/client/gui/screens/models/interface/IWorldsProvider.h"
11#include "mc/client/legacy/ImportStatus.h"
12#include "mc/client/network/realms/GenericStatus.h"
13#include "mc/client/network/realms/RealmId.h"
14#include "mc/client/world/NetworkWorldType.h"
15#include "mc/deps/core/file/PathBuffer.h"
16#include "mc/deps/core/resource/PackType.h"
17#include "mc/deps/core/threading/Async.h"
18#include "mc/deps/core/utility/pub_sub/Subscription.h"
19#include "mc/events/IMinecraftEventing.h"
20#include "mc/platform/ErrorInfo.h"
21#include "mc/platform/Result.h"
22#include "mc/util/CallbackToken.h"
23#include "mc/util/UploadState.h"
24#include "mc/world/actor/player/LoadingState.h"
25#include "mc/world/level/LevelListCacheObserver.h"
43namespace Core {
class Path; }
47namespace MSGraph::Models {
struct GraphError; }
48namespace Realms {
struct World; }
65 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::Social::MultiplayerGameInfo>> server;
66 ::ll::TypedStorage<1, 1, bool> found;
67 ::ll::TypedStorage<8, 8, double> lastFoundTime;
68 ::ll::TypedStorage<1, 1, bool> dead;
76 ::ll::TypedStorage<8, 8, ::PlayScreenModel&> mModel;
81 PlayScreenLevelListCacheObserver& operator=(PlayScreenLevelListCacheObserver
const&);
82 PlayScreenLevelListCacheObserver(PlayScreenLevelListCacheObserver
const&);
83 PlayScreenLevelListCacheObserver();
88 virtual void onLevelAdded(::std::string
const& levelId) ;
90 virtual void onLevelUpdated(::std::string
const& levelId) ;
92 virtual void onLevelDeleted(::std::string
const& levelId) ;
94 virtual void onStorageChanged() ;
100 MCFOLD
void $onLevelAdded(::std::string
const& levelId);
102 MCFOLD
void $onLevelUpdated(::std::string
const& levelId);
104 MCFOLD
void $onLevelDeleted(::std::string
const& levelId);
106 MCFOLD
void $onStorageChanged();
116 using PlayerCountMap = ::std::map<::Realms::RealmId, int>;
118 using RealmFullMap = ::std::map<::Realms::RealmId, bool>;
120 using RealmsWorldList = ::std::vector<::Realms::World>;
122 using StashedNetworkSelection = ::std::pair<::NetworkWorldInfo const, ::NetworkWorldType>;
127 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::std::pair<::NetworkWorldInfo const, ::NetworkWorldType>>>
128 mLastNetworkSelection;
129 ::ll::TypedStorage<1, 1, bool> mIsDirty;
130 ::ll::TypedStorage<8, 24, ::std::vector<::LocalWorldInfo>> mLocalWorldList;
131 ::ll::TypedStorage<8, 24, ::std::vector<::LocalWorldInfo>> mBetaRetailLocalWorldList;
132 ::ll::TypedStorage<8, 24, ::std::vector<::WorldTemplateInfo>> mWorldTemplates;
133 ::ll::TypedStorage<8, 24, ::std::vector<::NetworkWorldInfo>> mFriendsNetworkWorldList;
134 ::ll::TypedStorage<8, 24, ::std::vector<::NetworkWorldInfo>> mCrossPlatformFriendsNetworkWorldList;
135 ::ll::TypedStorage<8, 24, ::std::vector<::NetworkWorldInfo>> mLANNetworkWorldList;
136 ::ll::TypedStorage<8, 24, ::std::vector<::NetworkWorldInfo>> mServerNetworkWorldList;
137 ::ll::TypedStorage<8, 24, ::std::vector<::RealmsWorldInfo>> mRealmWorldList;
138 ::ll::TypedStorage<8, 24, ::std::vector<::RealmsWorldInfo>> mUnpairedParentRealmWorldList;
139 ::ll::TypedStorage<8, 24, ::std::vector<::std::shared_ptr<::NetworkWorldInfo>>> mThirdPartyServerWorldList;
140 ::ll::TypedStorage<8, 24, ::std::vector<::LegacyWorldInfo>> mLegacyWorldList;
141 ::ll::TypedStorage<8, 24, ::std::vector<::LegacyWorldInfo>> mBetaRetailLegacyWorldList;
142 ::ll::TypedStorage<8, 64, ::std::unordered_map<::std::string, ::ResourceLocation>> mNetworkedFriendsGamerpicMap;
143 ::ll::TypedStorage<8, 72, ::std::chrono::steady_clock::time_point[9]> mUpdateTimes;
144 ::ll::TypedStorage<8, 24, ::std::vector<::Realms::World>> mWorlds;
145 ::ll::TypedStorage<1, 1, bool> mWorldsFetched;
146 ::ll::TypedStorage<8, 24, ::std::vector<::Realms::World>> mUnpairedParentWorlds;
147 ::ll::TypedStorage<1, 1, bool> mUnpairedWorldsFetched;
148 ::ll::TypedStorage<8, 16, ::std::map<::Realms::RealmId, int>> mUnreadCounts;
149 ::ll::TypedStorage<4, 4, int> mRealmWorldPartitionIndex;
150 ::ll::TypedStorage<4, 24, ::std::array<int, 6>> mSeenUnreadPosts;
151 ::ll::TypedStorage<1, 1, bool> mLocalWorldsPopulated;
152 ::ll::TypedStorage<1, 1, bool> mHasPendingInvites;
153 ::ll::TypedStorage<4, 4, int> mPendingInviteCount;
154 ::ll::TypedStorage<1, 1, bool> mFetchingInvites;
155 ::ll::TypedStorage<1, 1, bool> mFetchingLegacyWorldsInProgress;
156 ::ll::TypedStorage<1, 1, bool> mLegacyWorldsFetched;
157 ::ll::TypedStorage<1, 1, bool> mFoundLegacyWorlds;
158 ::ll::TypedStorage<8, 48, ::LegacyWorldConversionManager> mLegacyWorldConversionManager;
159 ::ll::TypedStorage<8, 24, ::std::vector<::LocalWorldInfo>> mEduCloudWorlds;
160 ::ll::TypedStorage<1, 1, bool> mFetchingEduCloudWorldsInProgress;
161 ::ll::TypedStorage<1, 1, bool> mEduCloudWorldsFetched;
162 ::ll::TypedStorage<1, 1, bool> mEduCloudWorldsPopulated;
163 ::ll::TypedStorage<1, 1, bool> mEduCloudFetchFailed;
164 ::ll::TypedStorage<4, 4, int> mEduCloudWorldsFetchRetriesRemaining;
165 ::ll::TypedStorage<8, 32, ::std::string> mEduCloudWorldsFetchNextLinkUrl;
171 mEduCloudWorldsHandle;
172 ::ll::TypedStorage<8, 8, ::std::chrono::steady_clock::time_point> mFetchStartTimestamp;
173 ::ll::TypedStorage<8, 32, ::std::string> mFetchCorrelationId;
174 ::ll::TypedStorage<1, 1, bool> mFetchingPlayerCounts;
175 ::ll::TypedStorage<8, 8, ::std::chrono::steady_clock::time_point> mLastRealmsUpdate;
176 ::ll::TypedStorage<1, 1, bool> mJoiningRealm;
177 ::ll::TypedStorage<8, 8, ::std::chrono::steady_clock::time_point> mLastTryJoin;
178 ::ll::TypedStorage<8, 8, ::std::chrono::seconds> mRetryJoinInterval;
179 ::ll::TypedStorage<4, 4, int> mRetryTime;
180 ::ll::TypedStorage<8, 16, ::Bedrock::PubSub::Subscription> mPendingInviteCountSubscriber;
181 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::Legacy::WorldImporter>> mLegacyWorldImporter;
182 ::ll::TypedStorage<8, 16, ::CallbackToken> mRetrieveCallbackToken;
183 ::ll::TypedStorage<8, 16, ::CallbackToken> mImportCallbackToken;
184 ::ll::TypedStorage<1, 1, bool> mFirstRealmsFetchComplete;
185 ::ll::TypedStorage<1, 1, bool> mFirstUnpairedParentRealmsFetchComplete;
186 ::ll::TypedStorage<4, 4, ::Realms::GenericStatus> mRealmsStatus;
187 ::ll::TypedStorage<4, 4, ::Realms::GenericStatus> mUnpairedParentRealmsStatus;
188 ::ll::TypedStorage<8, 8, ::std::chrono::steady_clock::time_point> mLastPlayerCountUpdate;
189 ::ll::TypedStorage<8, 24, ::PlayScreenModel::PlayScreenLevelListCacheObserver> mLevelListCacheObserver;
190 ::ll::TypedStorage<8, 16, ::Bedrock::PubSub::Subscription> mTrialModeUpdateSubscription;
191 ::ll::TypedStorage<1, 1, bool> mAreTrialWorldsHidden;
192 ::ll::TypedStorage<1, 1, bool> mIsEditScreenLoading;
193 ::ll::TypedStorage<1, 1, bool> mIsLoadingAdditionalRealmInfo;
194 ::ll::TypedStorage<4, 4, int> mNumRealmsWorldsToQuery;
195 ::ll::TypedStorage<8, 16, ::std::set<::Realms::RealmId>> mWorldsWithDetailedInfo;
196 ::ll::TypedStorage<1, 1, bool> initRequestPendingInvites;
206 virtual ~PlayScreenModel() ;
208 virtual int getWorldCount(::WorldType worldType, ::NetworkWorldType networkType)
const ;
210 virtual ::LocalWorldInfo
const* getLocalWorldAtIndex(
int const index)
const ;
212 virtual ::LocalWorldInfo
const* getLocalWorldById(::std::string
const&
id)
const ;
214 virtual bool refresh(::WorldType tabType) ;
218 virtual bool isDirty() const ;
228 MCAPI
void _fetchAdditionalRealmsWorldsInfo();
230 MCAPI
void _fetchTrialAvailability();
232 MCAPI
bool _isCrossPlatformGame(::Social::MultiplayerGameInfo const& gameInfo) const;
234 MCAPI
void _navigateToEditWorldScreen(::
LocalWorldInfo const& info);
238 MCAPI
void _populateAdditionalRealmsWorldsInfo();
240 MCAPI
void _populateEduCloudWorlds(::
std::vector<::
LocalWorldInfo>& localWorlds);
242 MCAPI
void _populateLocalWorldsFromStorageSource(
250 MCAPI
void _populateNetworkWorlds();
252 MCAPI
void _populateRealmsWorldsInternal(
bool ofUnpairedParentRealms);
254 MCAPI
void _postRealmEvents();
256 MCAPI
void _processLegacyWorld(::
std::shared_ptr<::Legacy::WorldProcessRequest> processRequest);
258 MCAPI
void _remove3PServersMismatchingEditorMode();
260 MCAPI
void _requestPendingInviteCount();
262 MCAPI
void _sendBulkUnreadCountRequest();
264 MCAPI
void _sortRealmsWorlds(::
std::
string currentUserXUID, ::
std::vector<::Realms::World>& worlds);
274 MCAPI
void _trialModeChanged(
bool newTrialModeStatus);
276 MCAPI
void _updateOwnerInfo();
280 MCAPI
void cancelImportCallbackToken();
282 MCAPI
void clearUnreadCount(::Realms::RealmId realmId);
284 MCAPI
void convertLegacyWorld(
286 ::
std::
string const& newWorldDir,
287 ::
std::function<
void(::Legacy::ImportStatus,
float, ::
std::shared_ptr<::
ImportResult>)> callback
290 MCAPI ::Core::PathBuffer<::
std::
string> const createUniquePathForWorld() const;
292 MCAPI
void deleteLegacyWorld(uint legacyWorldIndex);
294 MCAPI
void fetchEduCloudWorlds();
296 MCAPI
void fetchLegacyWorldsForPlayScreen(::
std::function<
void()> noWorldsFoundCallback);
298 MCAPI
void fetchRealmsPlayerCounts();
300 MCAPI
void fetchRealmsWorldsForPlayScreen();
302 MCAPI
void fetchThirdPartyServerWorlds(
bool forceFetch);
306 MCAPI
void fireClubsOpenFeedScreenEvent(::Realms::RealmId realmId, ::
std::
string const& clubId,
int unreadPosts);
308 MCAPI
void fireIgnoredNotificationsEvent(
310 int notificationCount,
314 MCAPI
void forceFetchWorld();
320 MCAPI ::
LocalWorldInfo* getBetaRetailLocalWorldAtIndex(
int index);
322 MCAPI
bool getEduCloudFetchFailed() const;
324 MCAPI
bool getEduCloudWorldsFetched() const;
326 MCAPI
bool getEduCloudWorldsPopulated() const;
328 MCAPI
bool getFetchingThirdPartyWorldsInProgress() const;
330 MCAPI ::Core::
Path const& getIconPathOfCrossPlatformFriendWorld(
int index) const;
332 MCAPI ::Core::
Path const& getIconPathOfFriendWorld(
int index) const;
334 MCFOLD ::
std::chrono::steady_clock::time_point& getLastPlayerCountUpdate();
338 MCAPI
float getLegacyWorldConversionProgress() const;
340 MCAPI ::LoadingState getLegacyWorldConversionState() const;
342 MCAPI
bool getLegacyWorldsFetched() const;
350 MCAPI
bool getLocalWorldsPopulated() const;
354 MCAPI ::
NetworkWorldInfo* getNetworkWorldAtIndex(
int index, ::NetworkWorldType networkType);
356 MCAPI
int getOwnedActiveUnpairedParentRealmWorldCount() const;
358 MCAPI
int getPendingInviteCount() const;
362 MCAPI
int getRealmWorldCount() const;
364 MCAPI
int getRealmWorldsPartitionIndex() const;
366 MCAPI
bool getRealmsFirstFetchComplete() const;
368 MCAPI ::Realms::GenericStatus getRealmsStatus() const;
370 MCAPI
int getSeenUnreadPostsCount(::PlayScreenDefaultTab tab);
372 MCAPI
int getUnpairedParentRealmWorldCount() const;
374 MCAPI
bool getUnpairedParentRealmsFirstFetchComplete() const;
376 MCAPI ::Realms::GenericStatus getUnpairedParentRealmsStatus() const;
378 MCAPI
int getUnreadCount(::Realms::RealmId realmId) const;
382 MCAPI uint64 const getWorldTemplateSize() const;
384 MCFOLD ::
std::vector<::Realms::World>& getWorlds();
386 MCAPI
void handleLegacyWorldConversionComplete(::
ImportResult const& result);
388 MCAPI
bool hasLocalWorldWithId(::
std::
string const& levelId);
390 MCAPI
void initLegacyWorldImporter();
392 MCAPI
void initializeRealmsWorlds();
394 MCAPI
bool isEditorPlaytestRoundtrip() const;
398 MCAPI
void markLocalLevelDirty(::
std::
string const&
id);
400 MCAPI
void navigateToAddEditExternalScreen(
int id);
402 MCAPI
void navigateToEditWorldScreen(
int index, ::
std::function<
void(::Core::
Path const&)> onErrorCallback);
405 navigateToEditWorldScreen(::
LocalWorldInfo* info, ::
std::function<
void(::Core::
Path const&)> onErrorCallback);
408 navigateToEditWorldScreen(::
std::
string const& levelId, ::
std::function<
void(::Core::
Path const&)> onErrorCallback);
410 MCAPI
void navigateToRealmsSharingLauncherScreen(::
std::
string const& realmsInvite);
412 MCAPI
void navigateToWorldSyncModalScreen(
413 ::
std::
string const& levelId,
414 ::
std::function<
void(::nonstd::expected<
void, ::Bedrock::ErrorInfo<::
std::error_code>>)> onCompleteCallback
419 MCAPI
void repopulateLocalWorlds();
421 MCAPI
void resetEduCloudFetchStatus();
423 MCAPI
void resetUpdateIntervals();
425 MCAPI
void resetUpdateTimer(::WorldType worldType);
427 MCAPI
void setForceUpdate();
429 MCAPI
void setLegacyWorldConversionProgress(
float progress);
431 MCAPI
void setPlayScreenDefaultTab(::PlayScreenDefaultTab tab);
433 MCAPI
void setSeenUnreadPostsCount(::PlayScreenDefaultTab tab,
int value);
435 MCAPI
void startNetworkWorld(::
NetworkWorldInfo worldInfo, ::NetworkWorldType worldType);
437 MCAPI ::Bedrock::PubSub::Subscription subscribeToBuildGameList();
439 MCAPI
bool supportsEduCloudWorlds() const;
441 MCAPI
void triggerMultiplayerGameRefresh(
bool tryToReconnect);
443 MCAPI
void tryAcquireMissingDlc(::
std::
string const& levelId, ::
std::function<
void(
bool)> downloadCompleteCallback);
447 MCAPI
void uploadLocalWorldFileAtIndex(
448 ::
std::
string const& realmID,
451 ::
std::function<
void(::UploadState, ::Realms::World)> callbackAfterUpload
470 MCAPI
int $getWorldCount(::WorldType worldType, ::NetworkWorldType networkType) const;
472 MCAPI ::
LocalWorldInfo const* $getLocalWorldAtIndex(
int const index) const;
476 MCAPI
bool $refresh(::WorldType tabType);
480 MCFOLD
bool $isDirty() const;
Definition FilePickerSettings.h:5
Definition ILevelListCache.h:27
Definition IMinecraftEventing.h:138
Definition IWorldsProvider.h:5
Definition WorldImporter.h:7
Definition WorldProcessRequest.h:7
Definition LevelSettings.h:39
Definition MainMenuScreenModel.h:5
Definition PlayScreenModel.h:16
static MCAPI void ** $vftable()
Definition PlayScreenModel.h:5
static MCAPI void ** $vftableForIWorldsProvider()
static MCAPI void ** $vftableForIDlcBatcher()
static MCAPI void ** $vftableForMainMenuScreenModel()
static MCAPI void ** $vftableForIMinecraftScreenModel()
Definition ResourceLocation.h:15
Definition MultiplayerGameInfo.h:7
Definition ExternalServer.h:5
Definition ImportResult.h:5
Definition LegacyWorldInfo.h:5
Definition LocalWorldInfo.h:5
Definition DriveItemCollection.h:7
Definition GraphError.h:7
Definition MinecraftScreenModelContext.h:5
Definition NetworkWorldInfo.h:5
Definition PingedCompatibleServer.h:5
Definition PlayScreenModel.h:14
Definition RealmsWorldInfo.h:5
Definition WorldTemplateInfo.h:16