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.
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.
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)
...
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