@@ -98,6 +98,24 @@ public static string GetRequestStreamingAssetsPath()
9898 {
9999 return BundleConfig . GetRequestStreamingAssetsPath ( ) ;
100100 }
101+
102+ /// <summary>
103+ /// Get defualt bundle decryption services
104+ /// </summary>
105+ /// <returns></returns>
106+ public static DecryptionServices GetBundleDecryptionServices ( )
107+ {
108+ return PackageManager . bundleDecryptionServices ;
109+ }
110+
111+ /// <summary>
112+ /// Get default manifest decryption services
113+ /// </summary>
114+ /// <returns></returns>
115+ public static DecryptionServices GetManifestDecryptionServices ( )
116+ {
117+ return PackageManager . manifestDecryptionServices ;
118+ }
101119 #endregion
102120
103121 #region Patch Status
@@ -148,6 +166,25 @@ public static bool IsDone()
148166 #endregion
149167
150168 #region Patch Operation
169+ /// <summary>
170+ /// Custom app packages and dlc packages to bundle config at runtime
171+ /// </summary>
172+ /// <param name="appPackages"></param>
173+ /// <param name="dlcPackages"></param>
174+ public static void SetPresetPackages ( List < AppPackageInfoWithBuild > appPackages , List < DlcPackageInfoWithBuild > dlcPackages )
175+ {
176+ PatchLauncher . SetPresetPackages ( appPackages , dlcPackages ) ;
177+ }
178+
179+ /// <summary>
180+ /// Init and setup preset packages
181+ /// </summary>
182+ /// <returns></returns>
183+ public static async UniTask InitSetupPresetPackages ( )
184+ {
185+ await PatchLauncher . InitializePresetPackages ( ) ;
186+ }
187+
151188 /// <summary>
152189 /// Start patch update
153190 /// </summary>
@@ -215,17 +252,29 @@ public static string GetAppVersion()
215252 /// <summary>
216253 /// Get newest patch version (Recommend use encode to display)
217254 /// <para> Min and Max length = 11 to 32 </para>
255+ /// <para> Note: The newest patch version from preset packages </para>
218256 /// </summary>
219257 /// <returns></returns>
220258 public static string GetPatchVersion ( bool encode = false , int length = 16 , string separator = "-" )
221259 {
222260 string [ ] versions = PatchManager . patchVersions . Values . ToArray ( ) ;
261+ return GetPatchVersion ( versions , encode , length , separator ) ;
262+ }
263+
264+ /// <summary>
265+ /// Get newest patch version by custom (Recommend use encode to display)
266+ /// <para> Min and Max length = 11 to 32 </para>
267+ /// </summary>
268+ /// <returns></returns>
269+ public static string GetPatchVersion ( string [ ] customPatchVersions , bool encode = false , int length = 16 , string separator = "-" )
270+ {
271+ string [ ] versions = customPatchVersions ;
223272 string newestVersion = BundleUtility . NewestPackageVersion ( versions ) ;
224273 string patchVersion = string . IsNullOrEmpty ( newestVersion ) ? string . Empty : newestVersion ;
225274
226275 // For simulate mode
227276 if ( string . IsNullOrEmpty ( patchVersion ) )
228- patchVersion = BundleUtility . GetDefaultPackageVersion ( ) ;
277+ patchVersion = BundleUtility . GetPackageVersionForNow ( ) ;
229278
230279 if ( encode )
231280 {
@@ -259,7 +308,7 @@ public static ulong GetPackageSizeInLocal(string packageName)
259308 }
260309
261310 /// <summary>
262- /// Unload package and clear package files from local sandbox
311+ /// Unload (Destroy) package and clear package files from local sandbox
263312 /// </summary>
264313 /// <param name="packageName"></param>
265314 /// <param name="destroyPackage">Remove package from cache memory</param>
@@ -284,17 +333,17 @@ public static async UniTask<bool> UnloadPackage(string packageName)
284333 /// Init package by type
285334 /// </summary>
286335 /// <param name="packageInfo"></param>
287- /// <param name="autoUpdate "></param>
336+ /// <param name="updatePackage "></param>
288337 /// <returns></returns>
289- public static async UniTask < bool > InitPackage ( PackageInfoWithBuild packageInfo , bool autoUpdate = false )
338+ public static async UniTask < bool > InitPackage ( PackageInfoWithBuild packageInfo , bool updatePackage = false )
290339 {
291340 if ( packageInfo is AppPackageInfoWithBuild )
292341 {
293- return await InitAppPackage ( packageInfo as AppPackageInfoWithBuild , autoUpdate ) ;
342+ return await InitAppPackage ( packageInfo as AppPackageInfoWithBuild , updatePackage ) ;
294343 }
295344 else if ( packageInfo is DlcPackageInfoWithBuild )
296345 {
297- return await InitDlcPackage ( packageInfo as DlcPackageInfoWithBuild , autoUpdate ) ;
346+ return await InitDlcPackage ( packageInfo as DlcPackageInfoWithBuild , updatePackage ) ;
298347 }
299348
300349 return false ;
@@ -305,23 +354,20 @@ public static async UniTask<bool> InitPackage(PackageInfoWithBuild packageInfo,
305354 /// Init app package (If PlayMode is HostMode will request from default host path)
306355 /// </summary>
307356 /// <param name="packageInfo"></param>
308- /// <param name="autoUpdate "></param>
357+ /// <param name="updatePackage "></param>
309358 /// <returns></returns>
310- public static async UniTask < bool > InitAppPackage ( AppPackageInfoWithBuild packageInfo , bool autoUpdate = false )
359+ public static async UniTask < bool > InitAppPackage ( AppPackageInfoWithBuild packageInfo , bool updatePackage = false )
311360 {
312361 string hostServer = null ;
313362 string fallbackHostServer = null ;
314363
315- // Host Mode or WebGL Mode
316- if ( BundleConfig . playMode == BundleConfig . PlayMode . HostMode ||
317- BundleConfig . playMode == BundleConfig . PlayMode . WeakHostMode ||
318- BundleConfig . playMode == BundleConfig . PlayMode . WebGLRemoteMode )
364+ if ( BundleConfig . playModeParameters . autoConfigureServerEndpoints )
319365 {
320366 hostServer = await BundleConfig . GetHostServerUrl ( packageInfo . packageName ) ;
321367 fallbackHostServer = await BundleConfig . GetFallbackHostServerUrl ( packageInfo . packageName ) ;
322368 }
323369
324- return await PackageManager . InitPackage ( packageInfo , autoUpdate , hostServer , fallbackHostServer ) ;
370+ return await PackageManager . InitPackage ( packageInfo , updatePackage , hostServer , fallbackHostServer ) ;
325371 }
326372 #endregion
327373
@@ -330,30 +376,27 @@ public static async UniTask<bool> InitAppPackage(AppPackageInfoWithBuild package
330376 /// Init dlc package (If PlayMode is HostMode will request from default host dlc path)
331377 /// </summary>
332378 /// <param name="packageInfo"></param>
333- /// <param name="autoUpdate "></param>
379+ /// <param name="updatePackage "></param>
334380 /// <returns></returns>
335- public static async UniTask < bool > InitDlcPackage ( DlcPackageInfoWithBuild packageInfo , bool autoUpdate = false )
381+ public static async UniTask < bool > InitDlcPackage ( DlcPackageInfoWithBuild packageInfo , bool updatePackage = false )
336382 {
337383 string hostServer = packageInfo . hostServer ;
338384 string fallbackHostServer = packageInfo . fallbackHostServer ;
339385
340- // Host Mode or WebGL Mode
341- if ( BundleConfig . playMode == BundleConfig . PlayMode . HostMode ||
342- BundleConfig . playMode == BundleConfig . PlayMode . WeakHostMode ||
343- BundleConfig . playMode == BundleConfig . PlayMode . WebGLRemoteMode )
386+ if ( BundleConfig . playModeParameters . autoConfigureServerEndpoints )
344387 {
345388 hostServer = string . IsNullOrEmpty ( hostServer ) ? await BundleConfig . GetDlcHostServerUrl ( packageInfo . packageName , packageInfo . dlcVersion , packageInfo . withoutPlatform ) : hostServer ;
346389 fallbackHostServer = string . IsNullOrEmpty ( fallbackHostServer ) ? await BundleConfig . GetDlcFallbackHostServerUrl ( packageInfo . packageName , packageInfo . dlcVersion , packageInfo . withoutPlatform ) : fallbackHostServer ;
347390 }
348391
349- return await PackageManager . InitPackage ( packageInfo , autoUpdate , hostServer , fallbackHostServer ) ;
392+ return await PackageManager . InitPackage ( packageInfo , updatePackage , hostServer , fallbackHostServer ) ;
350393 }
351394 #endregion
352395 #endregion
353396
354397 #region Update Package
355398 /// <summary>
356- /// Update package manifest by package name
399+ /// Update package version and manifest by package name
357400 /// </summary>
358401 /// <param name="packageName"></param>
359402 /// <returns></returns>
@@ -421,6 +464,15 @@ public static ResourcePackage[] GetPackages(params string[] packageNames)
421464 {
422465 return PackageManager . GetPackages ( packageNames ) ;
423466 }
467+
468+ /// <summary>
469+ /// Get all packages
470+ /// </summary>
471+ /// <returns></returns>
472+ public static ResourcePackage [ ] GetAllPackages ( )
473+ {
474+ return PackageManager . GetAllPackages ( ) ;
475+ }
424476 #endregion
425477
426478 #region Get Preset Package
@@ -481,30 +533,6 @@ public static DlcPackageInfoWithBuild[] GetPresetDlcPackageInfos()
481533 }
482534 #endregion
483535
484- #region AssetInfo
485- /// <summary>
486- /// Get specific package assetInfos (Tags)
487- /// </summary>
488- /// <param name="package"></param>
489- /// <param name="tags"></param>
490- /// <returns></returns>
491- public static AssetInfo [ ] GetPackageAssetInfosByTags ( ResourcePackage package , params string [ ] tags )
492- {
493- return PackageManager . GetPackageAssetInfosByTags ( package , tags ) ;
494- }
495-
496- /// <summary>
497- /// Get specific package assetInfos (AssetNames)
498- /// </summary>
499- /// <param name="package"></param>
500- /// <param name="assetNames"></param>
501- /// <returns></returns>
502- public static AssetInfo [ ] GetPackageAssetInfosByAssetNames ( ResourcePackage package , params string [ ] assetNames )
503- {
504- return PackageManager . GetPackageAssetInfosByAssetNames ( package , assetNames ) ;
505- }
506- #endregion
507-
508536 #region Downloader
509537 /// <summary>
510538 /// Get specific package downloader
0 commit comments