• Functions and constants to access live update.

Static methods

@:native("add_mount")staticaddMount(name:String, uri:String, priority:Int, callback:() ‑> Void):Int

  • Adds a resource mount to the resource system. The mounts are persisted between sessions. After the mount succeeded, the resources are available to load. (i.e. no reboot required)

Parameters:

name

unique name of the mount

uri

the uri of the mount, including the scheme. Currently supported schemes are 'zip' and 'archive'.

priority

priority of mount. Larger priority takes prescedence

callback

callback after the asynchronous request completed

Returns:

the result of the request

@:native("get_current_manifest")staticgetCurrentManifest():LiveUpdateManifestReference

  • Return a reference to the Manifest that is currently loaded.

Returns:

reference to the Manifest that is currently loaded

@:native("get_mounts")staticgetMounts():LuaArray<Dynamic>

  • Get an array of the current mounts This can be used to determine if a new mount is needed or not.

Returns:

array of mounts

@:native("is_built_with_excluded_files")staticisBuiltWithExcludedFiles():Bool

  • Returns if the application was built with excluded files option enabled.

This can be used to decide if liveupdate content should be downloaded or if it's expected to be part of the bundle.

Returns:

true if the application bundle was built with excluded files

@:native("is_using_liveupdate_data")staticisUsingLiveupdateData():Bool

  • Is any liveupdate data mounted and currently in use? This can be used to determine if a new manifest or zip file should be downloaded.

Returns:

true if a liveupdate archive (any format) has been loaded

@:native("remove_mount")staticremoveMount(name:String):Int

  • Remove a mount the resource system. The remaining mounts are persisted between sessions. Removing a mount does not affect any loaded resources.

Parameters:

name

unique name of the mount

Returns:

the result of the call

@:has_untypedstaticinlinestoreArchive(path:String, callback:(status:LiveUpdateStatus) ‑> Void, ?options:Null<LiveUpdateStoreArchiveOptions>):Void

  • Stores a zip file and uses it for live update content. The path is renamed and stored in the (internal) live update location.

Parameters:

path

the path to the original file on disc

callback

the callback function executed after the storage has completed

options

optional table with extra parameters

@:has_untypedstaticinlinestoreManifest(manifest_buffer:String, callback:(status:LiveUpdateStatus) ‑> Void):Void

  • Create, verify, and store a manifest to device.

Create a new manifest from a buffer. The created manifest is verified by ensuring that the manifest was signed using the bundled public/private key-pair during the bundle process and that the manifest supports the current running engine version. Once the manifest is verified it is stored on device. The next time the engine starts (or is rebooted) it will look for the stored manifest before loading resources. Storing a new manifest allows the developer to update the game, modify existing resources, or add new resources to the game through LiveUpdate.

Parameters:

manifest_buffer

the binary data that represents the manifest

callback

the callback function executed once the engine has attempted to store the manifest.

@:has_untypedstaticinlinestoreResource(manifestReference:LiveUpdateManifestReference, data:String, hexdigest:String, callback:(hexdigest:String, status:Bool) ‑> Void):Void

  • Add a resource to the data archive and runtime index.

The resource will be verified internally before being added to the data archive.

Parameters:

manifestReference

The manifest to check against.

data

The resource data that should be stored.

hexdigest

The expected hash for the resource, retrieved through collectionproxy.missing_resources.

callback

The callback function that is executed once the engine has been attempted to store the resource. Arguments: self The current object. hexdigest The hexdigest of the resource. * status Whether or not the resource was successfully stored.