I’m afraid I cannot reproduce your scenario.
My output is like this:
DEBUG:SCRIPT: Missing resources,
{ --[[0x11190ead0]]
1 = "3be32cfd80b4016a9ebaf1c7249396ef608c95bd",
2 = "9170a12e266ec41f5575bb8f837d0f4bb6cab03f",
3 = "07f1284d530deb401da0ed142da50d5724cb04cd"
}
INFO:RESOURCE: Live Update archive: /Users/mawe/Library/Application Support/e288e86f371f3dfd7d3f1b207f9d8a3206aa5fb4/liveupdate.arcd
DEBUG:SCRIPT: Successfully stored resource: 07f1284d530deb401da0ed142da50d5724cb04cd
DEBUG:SCRIPT:
{ --[[0x111910e10]]
AFTER_STORE = { --[[0x111911020]]
1 = "3be32cfd80b4016a9ebaf1c7249396ef608c95bd",
2 = "9170a12e266ec41f5575bb8f837d0f4bb6cab03f"
}
}
DEBUG:SCRIPT: Successfully stored resource: 3be32cfd80b4016a9ebaf1c7249396ef608c95bd
DEBUG:SCRIPT:
{ --[[0x111911640]]
AFTER_STORE = { --[[0x111911850]]
1 = "9170a12e266ec41f5575bb8f837d0f4bb6cab03f"
}
}
DEBUG:SCRIPT: Successfully stored resource: 9170a12e266ec41f5575bb8f837d0f4bb6cab03f
DEBUG:SCRIPT:
{ --[[0x111911e70]]
AFTER_STORE = { } --[[0x111912080]]
}
And my script looks like this:
function init(self)
msg.post(".", "acquire_input_focus")
self.target = "levels#level1"
self.manifest = resource.get_current_manifest()
end
local function callback_store_resource(self, hexdigest, status)
if status == true then
print("Successfully stored resource: " .. hexdigest)
pprint({ AFTER_STORE = collectionproxy.missing_resources(self.target) })
else
print("Failed to store resource: " .. hexdigest)
end
end
local function load_resources(self, target)
local resources = collectionproxy.missing_resources(target)
pprint("Missing resources", resources)
for _, resource_hash in ipairs(resources) do
local baseurl = "http://192.168.10.210:8000/"
http.request(baseurl .. resource_hash, "GET", function(self, id, response)
if response.status == 200 then
resource.store_resource(self.manifest, response.response, resource_hash, callback_store_resource)
else
print("Failed to download resource: " .. resource_hash)
end
end)
end
end
function on_input(self, action_id, action)
if action_id == hash("touch") and action.pressed then
load_resources(self, self.target)
end
end
Perhaps you can give me a small repro case project?