Namespace: liveupdate
Language: Lua
Type: Defold Lua
File: script_liveupdate.h
Source: engine/liveupdate/src/script_liveupdate.h
Functions and constants to access resources.
Type: FUNCTION 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)
Notes
Parameters
name (string) - Unique name of the mounturi (string) - The uri of the mount, including the scheme. Currently supported schemes are ‘zip’ and ‘archive’.priority (number) - Priority of mount. Larger priority takes prescedencecallback (function) - Callback after the asynchronous request completedReturns
result (number) - The result of the requestExamples
Add multiple mounts. Higher priority takes precedence.
liveupdate.add_mount("common", "zip:/path/to/common_stuff.zip", 10, function (result) end) -- base pack
liveupdate.add_mount("levelpack_1", "zip:/path/to/levels_1_to_20.zip", 20, function (result) end) -- level pack
liveupdate.add_mount("season_pack_1", "zip:/path/to/easter_pack_1.zip", 30, function (result) end) -- season pack, overriding content in the other packs
Type: FUNCTION Get an array of the current mounts This can be used to determine if a new mount is needed or not
Returns
mounts (table) - Array of mountsExamples
Output the current resource mounts
pprint("MOUNTS", liveupdate.get_mounts())
Give an output like:
DEBUG:SCRIPT: MOUNTS,
{ --[[0x119667bf0]]
1 = { --[[0x119667c50]]
name = "liveupdate",
uri = "zip:/device/path/to/acchives/liveupdate.zip",
priority = 5
},
2 = { --[[0x119667d50]]
name = "_base",
uri = "archive:build/default/game.dmanifest",
priority = -10
}
}
Type: CONSTANT Mismatch between between expected bundled resources and actual bundled resources. The manifest expects a resource to be in the bundle, but it was not found in the bundle. This is typically the case when a non-excluded resource was modified between publishing the bundle and publishing the manifest.
Type: CONSTANT Mismatch between running engine version and engine versions supported by manifest.
Type: CONSTANT Failed to parse manifest data buffer. The manifest was probably produced by a different engine version.
Type: CONSTANT Argument was invalid
Type: CONSTANT The handled resource is invalid.
Type: CONSTANT The header of the resource is invalid.
Type: CONSTANT I/O operation failed
Type: CONSTANT Memory wasn’t allocated
Type: CONSTANT LIVEUPDATE_OK
Type: CONSTANT Mismatch between scheme used to load resources. Resources are loaded with a different scheme than from manifest, for example over HTTP or directly from file. This is typically the case when running the game directly from the editor instead of from a bundle.
Type: CONSTANT Mismatch between expected and actual integrity data for legacy liveupdate verification.
Type: CONSTANT Unspecified error
Type: CONSTANT Mismatch between manifest expected version and actual version.
Type: FUNCTION Remove a mount the resource system. The remaining mounts are persisted between sessions. Removing a mount does not affect any loaded resources.
Notes
Parameters
name (string) - Unique name of the mountReturns
result (number) - The result of the callExamples
Add multiple mounts. Higher priority takes precedence.
liveupdate.remove_mount("season_pack_1")