51 enum class ExportType :
int {
55 PlayableEditorLevel = 3,
57 PackagedLevelOnly = 5,
60 enum class ShowToast :
int {
65 enum class State :
int {
71 struct CopyWorldResult {
75 ::ll::TypedStorage<4, 4, ::FileArchiverOutcome> outcome;
76 ::ll::TypedStorage<8, 32, ::std::string> copiedLevelId;
77 ::ll::TypedStorage<8, 32, ::Core::PathBuffer<::std::string>> copiedLevelPath;
84 CopyWorldResult& operator=(CopyWorldResult
const&);
94 MCAPI ~CopyWorldResult();
119 ::ll::TypedStorage<1, 1, bool> isCloudImport;
120 ::ll::TypedStorage<1, 1, bool> allowMultiplayer;
121 ::ll::TypedStorage<8, 32, ::std::string> messUserId;
122 ::ll::TypedStorage<8, 32, ::std::string> cTag;
123 ::ll::TypedStorage<8, 32, ::std::string> name;
139 ::ll::TypedStorage<4, 4, ::FileArchiverOutcome> outcome;
140 ::ll::TypedStorage<8, 32, ::Core::PathBuffer<::std::string>> path;
147 ::ll::TypedStorage<4, 4, ::FileArchiverOutcome> outcome;
148 ::ll::TypedStorage<8, 24, ::std::vector<::FileArchiver::ImportWorldsResult::ImportWorldResult>> worlds;
156 ::ll::TypedStorage<8, 80, ::std::mutex> mProgressLock;
157 ::ll::TypedStorage<8, 32, ::std::string> mProgressTitle;
158 ::ll::TypedStorage<8, 32, ::std::string> mProgressMessage;
166 virtual void clear() ;
173 MCAPI ::std::string getProgressMessage();
175 MCAPI ::std::string getProgressTitle();
178 MCAPI
void setProgressMessage(::std::string
const& message);
194 ::ll::TypedStorage<4, 4, ::FileArchiverOutcome> outcome;
195 ::ll::TypedStorage<8, 32, ::Core::PathBuffer<::std::string>> fileName;
196 ::ll::TypedStorage<8, 32, ::Core::PathBuffer<::std::string>> levelId;
197 ::ll::TypedStorage<8, 32, ::Core::PathBuffer<::std::string>> originalLevelId;
202 Result& operator=(Result
const&);
230 ::ll::TypedStorage<4, 4, ::FileArchiver::ExportType> mExportType;
231 ::ll::TypedStorage<8, 32, ::std::string> mLevelId;
232 ::ll::TypedStorage<8, 8, uint64> mTotalFileCount;
233 ::ll::TypedStorage<8, 104, ::FileArchiver::Result> mResult;
234 ::ll::TypedStorage<8, 16, ::Bedrock::UniqueOwnerPointer<::LevelStorage>> mLevelStorage;
235 ::ll::TypedStorage<8, 8, ::LevelData*> mLevelData;
236 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::LevelData>> mOwnedLevelData;
237 ::ll::TypedStorage<8, 32, ::Core::PathBuffer<::std::string>> mWorldPath;
245 ::ll::TypedStorage<1, 2, ::std::optional<bool>> mKeepPlayerData;
255 virtual void enqueueConvertImportingWorldTasks(
256 ::std::shared_ptr<::FileArchiver::Result>& sharedResult,
257 ::Bedrock::NotNullNonOwnerPtr<::FileArchiver::ProgressReporter> progress,
261 virtual bool shouldCopyWorldForConversion(::std::string
const& levelId)
const = 0;
263 virtual void enqueueConvertExportingWorldTasks(
264 ::std::shared_ptr<::FileArchiver::ExportData>& exportData,
265 ::Bedrock::NotNullNonOwnerPtr<::FileArchiver::ProgressReporter> progress,
267 ::gsl::not_null<::std::shared_ptr<::FileArchiver::InterventionPublishers>> interventionPublishers,
268 ::std::optional<::FileArchiver::WorldConverterExportSettings>
const exportSetting
271 virtual bool prepareEditorProjectForSaveSnapshot(
278 struct InterventionPublishers {
281 using BeginSignature = void(::FileArchiver::ExportType, ::std::string
const&,
::Core::Path const&);
283 using CleanupSignature = void(::FileArchiver::ExportType);
285 using CopyCompleteSignature =
288 using LevelDataFinalizeSignature = void(::FileArchiver::ExportType,
::LevelData&);
290 using LevelDataMutationSignature = void(::FileArchiver::ExportType,
::LevelData&);
292 using PreFileRemovalSignature =
295 using PrePackageSignature =
305 void(::FileArchiver::ExportType, ::std::string
const&,
::Core::Path const&),
360 MCAPI InterventionPublishers();
375 ::ll::TypedStorage<8, 192, ::FileArchiver::ProgressReporter> mProgress;
376 ::ll::TypedStorage<8, 80, ::std::mutex> mStateLock;
377 ::ll::TypedStorage<4, 4, ::FileArchiver::State> mCurrentState;
378 ::ll::TypedStorage<8, 24, ::Bedrock::NotNullNonOwnerPtr<::Core::FilePathManager>> mFilePathManager;
379 ::ll::TypedStorage<8, 64, ::std::function<void(::std::string
const&)>> mDisplayMessageCallback;
380 ::ll::TypedStorage<8, 24, ::Bedrock::NotNullNonOwnerPtr<::IResourcePackRepository>> mResourcePackRepository;
381 ::ll::TypedStorage<8, 8, ::ILevelListCache&> mLevelListCache;
382 ::ll::TypedStorage<8, 8, ::LevelStorageSource&> mLevelStorageSource;
383 ::ll::TypedStorage<8, 24, ::std::vector<::Core::PathBuffer<::std::string>>> mSuccessfullyFiledArchives;
384 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::TaskGroup>> mIOTaskGroup;
385 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::FileArchiver::IWorldConverter>> mWorldConverter;
386 ::ll::TypedStorage<1, 1, bool> mIsEditorModeEnabled;
387 ::ll::TypedStorage<8, 24, ::Bedrock::NotNullNonOwnerPtr<::IContentKeyProvider const>> mKeyProvider;
388 ::ll::TypedStorage<8, 24, ::Bedrock::NotNullNonOwnerPtr<::LevelDbEnv>> mLevelDbEnv;
389 ::ll::TypedStorage<8, 64, ::std::unordered_map<::std::string, ::FileArchiver::EduCloudImportInfo>>
395 FileArchiver& operator=(FileArchiver
const&);
396 FileArchiver(FileArchiver
const&);
402 virtual ~FileArchiver() =
default;
404 virtual ::std::shared_ptr<::FilePickerSettings>
405 generateFilePickerSettings(::std::vector<::FileArchiver::ExportType>
const& types, ::std::string
const&)
const;
415 ::Bedrock::NotNullNonOwnerPtr<::Core::FilePathManager>
const& pathManager,
416 ::Bedrock::NotNullNonOwnerPtr<::IResourcePackRepository>
const& resourcePackRepository,
417 bool isEditorModeEnabled,
418 ::std::unique_ptr<::FileArchiver::IWorldConverter> worldConverter,
419 ::Bedrock::NotNullNonOwnerPtr<::IContentKeyProvider const> keyProvider,
420 ::Bedrock::NotNullNonOwnerPtr<::LevelDbEnv> levelDbEnv,
421 ::std::function<
void(::std::string
const&)> displayMessageFunction
424 MCAPI
void _clearArchiverState();
429 MCAPI ::Bedrock::Threading::Async<::FileArchiver::Result> _enqueueExportWorldTasks(
431 ::std::string
const& worldId,
433 ::FileArchiver::ExportType exportType,
434 ::FileArchiver::ShowToast
const showToast,
436 ::gsl::not_null<::std::shared_ptr<::FileArchiver::InterventionPublishers>> interventionPublishers,
438 ::std::optional<::FileArchiver::WorldConverterExportSettings>
const exportSetting,
443 MCAPI
bool _importWorld(
446 ::std::string
const& importLevelId
453 MCAPI
void _printLevelStartMessage();
456 MCAPI
void _printMessage(::std::string
const& message);
458 MCAPI ::FileArchiver::Result _tryBeginExportLevel(
459 ::std::string
const& levelId,
461 ::FileArchiver::ShowToast
const showToast
464 MCAPI
bool _validatePremiumUpgradePacks(
::Core::Path const& filePath);
467 MCAPI ::std::string copyLevel(::std::string
const& worldId,
::Core::Path const& targetFolder);
469 MCAPI ::Bedrock::Threading::Async<::FileArchiver::CopyWorldResult> copyLevelAsync(::std::string
const& worldId);
472 MCAPI ::Bedrock::Threading::Async<::FileArchiver::Result> exportCurrentEditorLevel(
475 ::gsl::not_null<::std::shared_ptr<::FileArchiver::InterventionPublishers>> interventionPublishers,
476 ::std::optional<::FileArchiver::WorldConverterExportSettings> exportSetting,
477 ::FileArchiver::ExportType exportType,
478 ::FileArchiver::ShowToast toast
481 MCAPI
void exportCurrentLevel(
484 ::FileArchiver::ExportType exportType,
487 ::gsl::not_null<::std::shared_ptr<::FileArchiver::InterventionPublishers>> interventionPublishers
491 MCAPI
void exportLevel(
492 ::std::string
const& worldId,
494 ::FileArchiver::ExportType exportType,
497 ::FileArchiver::ShowToast showToast,
498 ::gsl::not_null<::std::shared_ptr<::FileArchiver::InterventionPublishers>> interventionPublishers
502 MCAPI
void exportPack(
509 MCAPI ::Bedrock::Threading::Async<::FileArchiver::Result> importLevel(
511 bool suppressStartMessage,
512 bool suppressEndMessage,
513 ::std::string
const& levelId
516 MCAPI
void importLevel(
519 bool suppressStartMessage,
520 bool suppressEndMessage,
521 ::std::string
const& levelId
524 MCAPI
void setEduCloudImportInfo(
525 ::std::string
const& worldId,
526 ::std::string
const& cTag,
527 ::std::string
const& name,
528 ::std::string
const& oid,
529 bool allowMultiplayer
537 MCAPI
static void _revertPremiumUpgradePacks(
::Core::Path const& filePath);
540 MCAPI
static void _sanitizeWorld(
::Core::Path const& newWorldPath);
548 MCAPI static ::std::string
const& EXTENSION_ADDON();
551 MCAPI static ::std::string
const& EXTENSION_PROJECT();
553 MCAPI static ::std::string
const& EXTENSION_RESOURCEPACK();
555 MCAPI static ::std::string
const& EXTENSION_TEMPLATE();
557 MCAPI static ::std::string
const& EXTENSION_VANILLA();
559 MCAPI static ::std::string
const& IMPORT_LOCK_FILE();
569 ::Bedrock::NotNullNonOwnerPtr<::Core::FilePathManager>
const& pathManager,
570 ::Bedrock::NotNullNonOwnerPtr<::IResourcePackRepository>
const& resourcePackRepository,
571 bool isEditorModeEnabled,
572 ::std::unique_ptr<::FileArchiver::IWorldConverter> worldConverter,
573 ::Bedrock::NotNullNonOwnerPtr<::IContentKeyProvider const> keyProvider,
574 ::Bedrock::NotNullNonOwnerPtr<::LevelDbEnv> levelDbEnv,
575 ::std::function<
void(::std::string
const&)> displayMessageFunction
582 MCAPI ::std::shared_ptr<::FilePickerSettings>
583 $generateFilePickerSettings(::std::vector<::FileArchiver::ExportType>
const& types, ::std::string
const&)
const;
Definition IContentKeyProvider.h:13