Functions and constants to access resources.
Version: alpha
| ENUMS | |
|---|---|
| liveupdate.LIVEUPDATE | LiveUpdate values |
| FUNCTIONS | |
|---|---|
| liveupdate.add_mount() | Add resource mount |
| liveupdate.get_mounts() | Get current mounts |
| liveupdate.is_built_with_excluded_files() | check if the build contains excluded live update resources |
| liveupdate.remove_mount() | Remove resource mount |
liveupdate.LIVEUPDATE: integer
LiveUpdate values
VALUES
liveupdate.add_mount(name:string|hash, uri:string, priority:integer, callback:fun(self:script_instance, name:hash, uri:string, result:liveupdate.LIVEUPDATE))→result:liveupdate.LIVEUPDATE
Adds a resource mount to the resource system. After the mount succeeded, the resources are available to load. (i.e. no reboot required)
PARAMETERS
name |
stringhash |
Unique name of the mount |
uri |
string |
The uri of the mount, including the scheme. Currently supported schemes are 'zip' and 'archive'. |
priority |
integer |
Priority of mount. Larger priority takes prescedence |
callback |
function(
self:script_instance,
name:hash,
uri:string,
result:liveupdate.LIVEUPDATE) |
Callback after the asynchronous request completed
- name hash Unique name of the mount
- uri string The uri of the mount
- result liveupdate.LIVEUPDATE The result of the request
|
RETURNS
result |
liveupdate.LIVEUPDATE |
The result of the request |
EXAMPLES
Add multiple mounts. Higher priority takes precedence.liveupdate.add_mount("common", "zip:/path/to/common_stuff.zip", 10, function (self, name, uri, result) end) -- base pack
liveupdate.add_mount("levelpack_1", "zip:/path/to/levels_1_to_20.zip", 20, function (self, name, uri, result) end) -- level pack
liveupdate.add_mount("season_pack_1", "zip:/path/to/easter_pack_1.zip", 30, function (self, name, uri, result) end) -- season pack, overriding content in the other packs
liveupdate.get_mounts()→mounts:{ name:hash, uri:string, priority:integer }[]
Get an array of the current mounts This can be used to determine if a new mount is needed or not
PARAMETERS
None
RETURNS
mounts |
{name:hash,
uri:string,
priority:integer}[] |
Array of mounts |
EXAMPLES
Output the current resource mountspprint("MOUNTS", liveupdate.get_mounts())
DEBUG:SCRIPT: MOUNTS,
{ --[[0x119667bf0]]
1 = { --[[0x119667c50]]
name = hash: [liveupdate],
uri = "zip:/device/path/to/acchives/liveupdate.zip",
priority = 5
},
2 = { --[[0x119667d50]]
name = hash: [_base],
uri = "archive:build/default/game.dmanifest",
priority = -10
}
}
liveupdate.is_built_with_excluded_files()→is_built_with_excluded_files:boolean
Checks if the bundled application was built with one or more resources
excluded from the main bundle, through a collection proxy with
Exclude enabled.
This value is based on metadata in the bundled manifest. It does not check
whether any live update archive has been mounted or whether the excluded
resources are currently available on device.
PARAMETERS
None
RETURNS
is_built_with_excluded_files |
boolean |
true if the bundled application was built with excluded files |
EXAMPLES
if liveupdate.is_built_with_excluded_files() then
print("The bundle expects live update content.")
end
liveupdate.remove_mount(name:string|hash)→result:liveupdate.LIVEUPDATE
Remove a mount the resource system. Removing a mount does not affect any loaded resources.
PARAMETERS
name |
stringhash |
Unique name of the mount |
RETURNS
result |
liveupdate.LIVEUPDATE |
The result of the call |
EXAMPLES
Add multiple mounts. Higher priority takes precedence.liveupdate.remove_mount("season_pack_1")