Are liveupdate platform specific?

Hello,
When using LiveUpdate with ZIP, that I upload on my own server.
Do I need to use a different URL depending on the platform?
Or is the content of the ZIP the same regardless of the platform?

It appears I need to change the URL of resource downloading according to the platform, but I want to make sure it’s correct.

1 Like

The content per platform may very well vary.
I don’t think we’ll every make such guarantee either, as that would limit our range of solutions in the future.

1 Like

OK so I believe I should use different URLs according to the platform:

if message_id == hash("attempt_download") then
		local manifest = resource.get_current_manifest() 
		local device = device()
		local base_url = string.format("https://myserver.com/resources/%s/",device)
        local url = base_url .. message.resource_hash
	   http.request(url, "GET", function(self, id, response)
...

Yes, exactly. This will avoid any problems down the road.

I’m still having an issue with LIVE UPDATE.
I have a game that have different levels, they are excluded from the build.

Version1: contains level A
Version2: contains level A,B

User installs Version1, download all floors properly.
User updates to Version2.
User downloads but can’t access level B.

Errors is the following:

WARNING:RESOURCE: Unable to create resource:    
 /worldmap/floors/2/floor_2_generated_0_generated_0.spinemodelc: DDF_ERROR
    05-18 11:10:42.714 24265 24309 W defold  : WARNING:RESOURCE: Unable to create resource: /worldmap/floors/2/floor_2_generated_0.goc: DDF_ERROR
    05-18 11:10:42.714 24265 24309 W defold  : WARNING:RESOURCE: Unable to create resource: /worldmap/floors/2/floor_2_generated_1_generated_0.spinemodelc: DDF_ERROR
    05-18 11:10:42.714 24265 24309 W defold  : WARNING:RESOURCE: Unable to create resource: /worldmap/floors/2/floor_2_generated_1.goc: DDF_ERROR
    05-18 11:10:42.828 24265 24309 W defold  : WARNING:RESOURCE: Unable to create resource: /worldmap/floors/2/floor_2_generated_3.goc: IO_ERROR
    05-18 11:10:42.859 24265 24309 W defold  : WARNING:RESOURCE: Unable to create resource: /worldmap/floors/2/floor_2_generated_6_generated_0.spinemodelc: DDF_ERROR
    05-18 11:10:42.859 24265 24309 W defold  : WARNING:RESOURCE: Unable to create resource: /worldmap/floors/2/floor_2_generated_6.goc: DDF_ERROR

(floor 2 is the name level B in my project).

How to fix that situation? I’m guessing the problem comes from the manifest.
I put this code:

elseif message_id == hash("attempt_download_manifest") then
		local base_url = get_base_url()
		local MANIFEST_FILENAME = "liveupdate.game.dmanifest"
		http.request(base_url .. MANIFEST_FILENAME, "GET", function(self, id, response)
			if response.status == 200 or response.status == 304 then
				print("verifying and storing manifest " .. MANIFEST_FILENAME)
				resource.store_manifest(response.response, store_manifest_cb) -- <2>
			else
				print("Failed to download manifest: " .. MANIFEST_FILENAME)
			end
		end)

But it’s never called. Should I download the new manifest manuallly? Should I do it before or after downloading the new resources?

Thanks for your help

I should mention I’m compiling version1 and version2 with the same version of Defold (1.2.180)

The only work-around I can see at the moment, is deleting all the LU content, and re-downloading everything. It works but it means the user has to re-download everything for each install, which is not really optimal…

local game_name = sys.get_config("project.title")
		local deleted_file1 = os.remove(sys.get_save_file(game_name, "liveupdate.arcd"))
		local deleted_file2 =  os.remove(sys.get_save_file(game_name, "liveupdate.arci"))
		local deleted_file3 =  os.remove(sys.get_save_file(game_name, "liveupdate.arci.tmp"))
		if deleted_file1 or deleted_file2 or deleted_file3 then
			sys.reboot()
			return true
		end