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/MinecraftScreenModel.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/platform/Result.h"
20#include "mc/util/CallbackToken.h"
21#include "mc/util/UploadState.h"
39namespace Core {
class Path; }
40namespace Core {
class Result; }
44namespace MSGraph::Models {
struct GraphError; }
45namespace Realms {
struct World; }
62 using PlayerCountMap = ::std::map<::Realms::RealmId, int>;
64 using RealmFullMap = ::std::map<::Realms::RealmId, bool>;
66 using RealmsWorldList = ::std::vector<::Realms::World>;
68 using StashedNetworkSelection = ::std::pair<::NetworkWorldInfo const, ::NetworkWorldType>;
73 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::std::pair<::NetworkWorldInfo const, ::NetworkWorldType>>>
74 mLastNetworkSelection;
75 ::ll::TypedStorage<1, 1, bool> mIsDirty;
76 ::ll::TypedStorage<8, 24, ::std::vector<::LocalWorldInfo>> mLocalWorldList;
77 ::ll::TypedStorage<8, 24, ::std::vector<::LocalWorldInfo>> mBetaRetailLocalWorldList;
78 ::ll::TypedStorage<8, 24, ::std::vector<::WorldTemplateInfo>> mWorldTemplates;
79 ::ll::TypedStorage<8, 24, ::std::vector<::NetworkWorldInfo>> mFriendsNetworkWorldList;
80 ::ll::TypedStorage<8, 24, ::std::vector<::NetworkWorldInfo>> mCrossPlatformFriendsNetworkWorldList;
81 ::ll::TypedStorage<8, 24, ::std::vector<::NetworkWorldInfo>> mLANNetworkWorldList;
82 ::ll::TypedStorage<8, 24, ::std::vector<::NetworkWorldInfo>> mServerNetworkWorldList;
83 ::ll::TypedStorage<8, 24, ::std::vector<::RealmsWorldInfo>> mRealmWorldList;
84 ::ll::TypedStorage<8, 24, ::std::vector<::RealmsWorldInfo>> mUnpairedParentRealmWorldList;
85 ::ll::TypedStorage<8, 24, ::std::vector<::std::shared_ptr<::NetworkWorldInfo>>> mThirdPartyServerWorldList;
86 ::ll::TypedStorage<8, 24, ::std::vector<::LegacyWorldInfo>> mLegacyWorldList;
87 ::ll::TypedStorage<8, 24, ::std::vector<::LegacyWorldInfo>> mBetaRetailLegacyWorldList;
88 ::ll::TypedStorage<8, 64, ::std::unordered_map<::std::string, ::ResourceLocation>> mNetworkedFriendsGamerpicMap;
89 ::ll::TypedStorage<8, 72, ::std::chrono::steady_clock::time_point[9]> mUpdateTimes;
90 ::ll::TypedStorage<8, 24, ::std::vector<::Realms::World>> mWorlds;
91 ::ll::TypedStorage<1, 1, bool> mWorldsFetched;
92 ::ll::TypedStorage<8, 24, ::std::vector<::Realms::World>> mUnpairedParentWorlds;
93 ::ll::TypedStorage<1, 1, bool> mUnpairedWorldsFetched;
94 ::ll::TypedStorage<8, 16, ::std::map<::Realms::RealmId, int>> mUnreadCounts;
95 ::ll::TypedStorage<4, 4, int> mRealmWorldPartitionIndex;
96 ::ll::TypedStorage<4, 16, ::std::array<int, 4>> mSeenUnreadPosts;
97 ::ll::TypedStorage<1, 1, bool> mLocalWorldsPopulated;
98 ::ll::TypedStorage<1, 1, bool> mHasPendingInvites;
99 ::ll::TypedStorage<4, 4, int> mPendingInviteCount;
100 ::ll::TypedStorage<1, 1, bool> mFetchingInvites;
101 ::ll::TypedStorage<1, 1, bool> mFetchingLegacyWorldsInProgress;
102 ::ll::TypedStorage<1, 1, bool> mLegacyWorldsFetched;
103 ::ll::TypedStorage<1, 1, bool> mFoundLegacyWorlds;
104 ::ll::TypedStorage<8, 48, ::LegacyWorldConversionManager> mLegacyWorldConversionManager;
105 ::ll::TypedStorage<8, 24, ::std::vector<::LocalWorldInfo>> mEduCloudWorlds;
106 ::ll::TypedStorage<1, 1, bool> mFetchingEduCloudWorldsInProgress;
107 ::ll::TypedStorage<1, 1, bool> mEduCloudWorldsFetched;
108 ::ll::TypedStorage<1, 1, bool> mEduCloudWorldsPopulated;
109 ::ll::TypedStorage<1, 1, bool> mEduCloudFetchFailed;
110 ::ll::TypedStorage<4, 4, int> mEduCloudWorldsFetchRetriesRemaining;
111 ::ll::TypedStorage<8, 32, ::std::string> mEduCloudWorldsFetchNextLinkUrl;
115 ::Bedrock::Threading::Async<
116 ::Bedrock::Result<::MSGraph::Models::DriveItemCollection, ::MSGraph::Models::GraphError>>>
117 mEduCloudWorldsHandle;
118 ::ll::TypedStorage<8, 8, ::std::chrono::steady_clock::time_point> mFetchStartTimestamp;
119 ::ll::TypedStorage<8, 32, ::std::string> mFetchCorrelationId;
120 ::ll::TypedStorage<1, 1, bool> mFetchingPlayerCounts;
121 ::ll::TypedStorage<8, 8, ::std::chrono::steady_clock::time_point> mLastRealmsUpdate;
122 ::ll::TypedStorage<1, 1, bool> mJoiningRealm;
123 ::ll::TypedStorage<8, 8, ::std::chrono::steady_clock::time_point> mLastTryJoin;
124 ::ll::TypedStorage<8, 8, ::std::chrono::seconds> mRetryJoinInterval;
125 ::ll::TypedStorage<4, 4, int> mRetryTime;
126 ::ll::TypedStorage<8, 16, ::Bedrock::PubSub::Subscription> mPendingInviteCountSubscriber;
127 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::Legacy::WorldImporter>> mLegacyWorldImporter;
128 ::ll::TypedStorage<8, 16, ::CallbackToken> mRetrieveCallbackToken;
129 ::ll::TypedStorage<8, 16, ::CallbackToken> mImportCallbackToken;
130 ::ll::TypedStorage<1, 1, bool> mFirstRealmsFetchComplete;
131 ::ll::TypedStorage<1, 1, bool> mFirstUnpairedParentRealmsFetchComplete;
132 ::ll::TypedStorage<4, 4, ::Realms::GenericStatus> mRealmsStatus;
133 ::ll::TypedStorage<4, 4, ::Realms::GenericStatus> mUnpairedParentRealmsStatus;
134 ::ll::TypedStorage<8, 8, ::std::chrono::steady_clock::time_point> mLastPlayerCountUpdate;
135 ::ll::TypedStorage<8, 24, ::PlayScreenModel::PlayScreenLevelListCacheObserver> mLevelListCacheObserver;
136 ::ll::TypedStorage<8, 16, ::Bedrock::PubSub::Subscription> mTrialModeUpdateSubscription;
137 ::ll::TypedStorage<1, 1, bool> mAreTrialWorldsHidden;
138 ::ll::TypedStorage<1, 1, bool> mIsEditScreenLoading;
139 ::ll::TypedStorage<1, 1, bool> mIsLoadingAdditionalRealmInfo;
140 ::ll::TypedStorage<4, 4, int> mNumRealmsWorldsToQuery;
141 ::ll::TypedStorage<8, 16, ::std::set<::Realms::RealmId>> mWorldsWithDetailedInfo;
142 ::ll::TypedStorage<1, 1, bool> initRequestPendingInvites;
152 virtual ~PlayScreenModel() ;
154 virtual int getWorldCount(::WorldType worldType, ::NetworkWorldType networkType)
const ;
156 virtual ::LocalWorldInfo
const* getLocalWorldAtIndex(
int const index)
const ;
158 virtual ::LocalWorldInfo
const* getLocalWorldById(::std::string
const&
id)
const ;
160 virtual bool refresh(::WorldType tabType) ;
162 virtual void startLocalWorld(::LocalWorldInfo worldInfo, ::LevelSettings
const* settings) ;
164 virtual bool isDirty() const ;
166 virtual ::IMinecraftEventing& getMinecraftEventing() const ;
172 MCAPI explicit PlayScreenModel(::MinecraftScreenModel::
Context context);
174 MCAPI
void _fetchAdditionalRealmsWorldsInfo();
176 MCAPI
void _fetchTrialAvailability();
178 MCAPI
bool _isCrossPlatformGame(::Social::MultiplayerGameInfo const& gameInfo) const;
180 MCAPI
void _navigateToEditWorldScreen(::LocalWorldInfo const& info);
182 MCAPI
void _pingServer(::ExternalServer& externalServer);
184 MCAPI
void _populateAdditionalRealmsWorldsInfo();
186 MCAPI
void _populateEduCloudWorlds(::std::vector<::LocalWorldInfo>& localWorlds);
188 MCFOLD
void _populateLocalWorlds();
190 MCAPI
void _populateLocalWorldsFromStorageSource(
191 ::ILevelListCache& levelListCache,
192 ::std::vector<::LocalWorldInfo>& localWorlds,
193 ::std::vector<::LocalWorldInfo>& betaRetailWorlds,
198 MCAPI
void _populateNetworkWorlds();
200 MCAPI
void _populateRealmsWorldsInternal(
bool ofUnpairedParentRealms);
202 MCAPI
void _postRealmEvents();
204 MCAPI
void _processLegacyWorld(::std::shared_ptr<::Legacy::WorldProcessRequest> processRequest);
206 MCAPI
void _remove3PServersMismatchingEditorMode();
208 MCAPI
void _requestPendingInviteCount();
210 MCAPI
void _sendBulkUnreadCountRequest();
212 MCAPI
void _sortRealmsWorlds(::std::
string currentUserXUID, ::std::vector<::Realms::World>& worlds);
214 MCAPI
void _start3PNetworkWorld(::NetworkWorldInfo& world);
216 MCAPI
void _startFriendNetworkWorld(::NetworkWorldInfo const& world);
218 MCAPI
void _startRemoteNetworkWorld(::NetworkWorldInfo const& world);
220 MCAPI
void _updateExternalServer(::ExternalServer& externalServer, ::PingedCompatibleServer& remoteServer);
222 MCAPI
void _updateOwnerInfo();
224 MCAPI
bool areExternalAndRemoteServerSame(::ExternalServer& externalServer, ::PingedCompatibleServer remoteServer);
226 MCAPI
void connectToExperience(::ExperienceConnectionData data, ::std::function<
void()> onErrorCallback);
228 MCAPI
void convertLegacyWorld(
229 ::LegacyWorldInfo worldInfo,
230 ::std::
string const& newWorldDir,
231 ::std::function<
void(::Legacy::ImportStatus,
float, ::std::shared_ptr<::ImportResult>)> callback
234 MCAPI ::Core::PathBuffer<::std::
string> const createUniquePathForWorld() const;
236 MCAPI
void deleteLegacyWorld(uint legacyWorldIndex);
238 MCAPI
void fetchEduCloudWorlds();
240 MCAPI
void fetchRealmsPlayerCounts();
242 MCAPI
void fetchRealmsWorldsForPlayScreen();
244 MCAPI
void fetchThirdPartyServerWorlds(
bool forceFetch);
246 MCAPI ::std::shared_ptr<::FilePickerSettings> generateFilePickerSettingsForImport();
248 MCAPI
bool getFetchingThirdPartyWorldsInProgress() const;
250 MCAPI ::std::vector<::ResourceLocation> getLoadingPacks(::PackType type) const;
252 MCAPI
void handleLegacyWorldConversionComplete(::ImportResult const& result);
254 MCAPI
bool hasLocalWorldWithId(::std::
string const& levelId);
256 MCAPI
void initializeRealmsWorlds();
258 MCAPI
bool isEditorPlaytestRoundtrip() const;
260 MCAPI
bool isLocalWorldRealmsPlus(::LocalWorldInfo const& world);
262 MCAPI
void navigateToAddEditExternalScreen(
int id);
264 MCAPI
void navigateToEditWorldScreen(
int index, ::std::function<
void(::Core::Path const&)> onErrorCallback);
267 navigateToEditWorldScreen(::LocalWorldInfo* info, ::std::function<
void(::Core::Path const&)> onErrorCallback);
269 MCAPI
void navigateToWorldSyncModalScreen(
270 ::std::
string const& levelId,
271 ::std::function<
void(::Core::Result)> onCompleteCallback
274 MCAPI ::LocalWorldInfo refreshLocalWorldInfo(::LocalWorldInfo const& worldInfo);
276 MCFOLD
void repopulateLocalWorlds();
278 MCAPI
void startNetworkWorld(::NetworkWorldInfo worldInfo, ::NetworkWorldType worldType);
280 MCAPI ::Bedrock::PubSub::Subscription subscribeToBuildGameList();
282 MCAPI
bool supportsEduCloudWorlds() const;
284 MCAPI
void triggerMultiplayerGameRefresh(
bool tryToReconnect);
286 MCAPI
void updateNetworkWorldSorting();
288 MCAPI
void uploadLocalWorldFileAtIndex(
289 ::std::
string const& realmID,
292 ::std::function<
void(::UploadState, ::Realms::World)> callbackAfterUpload
299 MCAPI
void* $ctor(::MinecraftScreenModel::
Context context);
311 MCAPI
int $getWorldCount(::WorldType worldType, ::NetworkWorldType networkType) const;
313 MCAPI ::LocalWorldInfo const* $getLocalWorldAtIndex(
int const index) const;
315 MCAPI ::LocalWorldInfo const* $getLocalWorldById(::std::
string const&
id) const;
317 MCAPI
bool $refresh(::WorldType tabType);
319 MCAPI
void $startLocalWorld(::LocalWorldInfo worldInfo, ::LevelSettings const* settings);
321 MCAPI
bool $isDirty() const;
323 MCFOLD ::IMinecraftEventing& $getMinecraftEventing() const;
Definition FilePickerSettings.h:5
Definition ILevelListCache.h:27
Definition IMinecraftEventing.h:137
Definition IWorldsProvider.h:5
Definition LevelSettings.h:39
Definition MainMenuScreenModel.h:5
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 ExperienceConnectionData.h:5
Definition ExternalServer.h:5
Definition ImportResult.h:5
Definition LegacyWorldInfo.h:5
Definition WorldImporter.h:7
Definition WorldProcessRequest.h:7
Definition LocalWorldInfo.h:5
Definition DriveItemCollection.h:7
Definition GraphError.h:7
Definition MinecraftScreenModel.h:15
Definition NetworkWorldInfo.h:5
Definition PingedCompatibleServer.h:5
Definition PlayScreenModel.h:14
Definition PlayScreenModel.h:16
Definition RealmsWorldInfo.h:5
Definition MultiplayerGameInfo.h:7
Definition WorldTemplateInfo.h:12