I've let it sit for hours, and the wait dialog just sits there. I added code to let me close the dialog, and this is what shows afterwards:
So I'm thinking that the file reaches original line #276 and then barfs. Since nothing closes the dialog, the onscreen log doesn't update and it just waits forever. Once I close it manually, I see that it actually has just skipped over the function that's sent as a parameter of publishFileUpdate() and went right to the end of publishAddonSteam(). I'm assuming that publishFileUpdate() is compiled and exposed in te4-steam.dll or similar, as I can't find any source code to debug it further.
#276 core.steam.publishFileUpdate(pubid, file:sub(2), false, function(error)
Code: Select all
function _M:publishAddonSteam(add)
game.log("#ROYAL_BLUE#Starting publishAddonSteam()...")
if not add.tags or type(add.tags) ~= "table" then
game.log("#LIGHT_RED#Addon init.lua must contain a tags table")
Dialog:simplePopup("Registering new addon", "Addon init.lua must contain a tags table, i.e: tags={'foo', 'bar'}")
return
end
if not add.description then
game.log("#LIGHT_RED#Addon init.lua must contain a description field")
Dialog:simplePopup("Registering new addon", "Addon init.lua must contain a description field")
return
end
local file, fmd5 = self:zipAddon(add, true)
game.log("#ROYAL_BLUE#Initiating core.profile.pushOrder('%s', '%s')...", "check_steam_pubid", add.short_name)
core.profile.pushOrder(table.serialize{o="AddonAuthoring", suborder="check_steam_pubid",
for_module = game.__mod_info.short_name,
short_name = add.short_name,
version = add.version,
md5 = fmd5,
})
local pubid = nil
local err = nil
game.log("#ROYAL_BLUE#Connecting to Steam server...")
local popup = Dialog:simpleWaiter("Connecting to server", "Addon: "..add.short_name)
game.log("#ROYAL_BLUE#Initiating profile:waitEvent('%s', %d)...", "check_steam_pubid", 10000)
profile:waitEvent("AddonAuthoring", function(e) if e.suborder == "check_steam_pubid" then pubid = e.pubid err = e.err end end, 10000)
game.log("#ROYAL_BLUE#Clear wait dialog...")
if popup then popup:done() end
if pubid == '' then pubid = nil end
game.log("#LIGHT_GREEN#Retrieved Steam pubid '%s' for addon %s.", pubid, add.short_name)
print("[STEAM UPLOAD] Got addon steam pubid", pubid)
if err then
game.log("#LIGHT_RED#Update error: %s", err or "unknown")
return
Dialog:simplePopup("Steam Workshop: "..add.long_name, "Update error: "..(err or "unknown"))
end
game.log("#ROYAL_BLUE#Uploading addon %s to Steam Workshop...", add.short_name)
local popup = Dialog:simpleWaiter("Uploading addon to Steam Workshop", "Addon: "..add.short_name, nil, 10000)
--to remove
popup.key:addBinds{ EXIT = function() popup:done() core.display.forceRedraw() game.log("#ROYAL_BLUE#Manually cleared wait dialog...") end, }
--to remove end
core.display.forceRedraw()
if not pubid then
game.log("#ROYAL_BLUE#No pubid...")
local preview = "user-generated-addons/"..add.for_module.."-"..add.short_name.."-custom.png"
if not fs.exists(preview) then
game.log("#LIGHT_RED#Preview image %s doesn't exist...", preview)
preview = self:addonPreview(add)
game.log("#ROYAL_BLUE#Using %s instead...", preview)
end
game.log("#ROYAL_BLUE#Initiating core.steam.publishFile(%'s', '%s')...", file:sub(2), preview)
core.display.forceRedraw()
core.steam.publishFile(file:sub(2), preview, add.long_name, add.description, add.tags, function(pubid, needaccept, error)
game.log("#ROYAL_BLUE#Clear wait dialog...")
if popup then popup:done() end
if not error and pubid then
game.log("#ROYAL_BLUE#Initiating core.steam.pushOrder('%s', '%s')...", "steam_pubid", add.short_name)
core.profile.pushOrder(table.serialize{o="AddonAuthoring", suborder="steam_pubid", for_module = game.__mod_info.short_name, short_name = add.short_name, pubid = pubid})
end
if error then
game.log("#LIGHT_RED#There was an error uploading the addon %s: %s", add.short_name, error)
Dialog:simplePopup("Steam Workshop: "..add.long_name, "There was an error uploading the addon.")
elseif needaccept then
game.log("#LIGHT_GREEN#Addon %s succesfully uploaded to the Workshop. You need to accept Steam Workshop Agreement in your Steam Client before the addon is visible to the community.", add.short_name)
Dialog:yesnoLongPopup("Steam Workshop: "..add.long_name, "Addon succesfully uploaded to the Workshop.\nYou need to accept Steam Workshop Agreement in your Steam Client before the addon is visible to the community.", 500, function(ret) if ret then
util.browserOpenUrl("http://steamcommunity.com/sharedfiles/workshoplegalagreement")
end end, "Go to Workshop", "Later")
else
game.log("#LIGHT_GREEN#Addon %s succesfully uploaded to the Workshop.", add.short_name)
Dialog:simplePopup("Steam Workshop: "..add.long_name, "Addon succesfully uploaded to the Workshop.")
end
end)
else
game.log("#ROYAL_BLUE#Initiating core.steam.publishFileUpdate('%s', '%s')...", pubid, file:sub(2))
core.steam.publishFileUpdate(pubid, file:sub(2), false, function(error)
game.log("#ROYAL_BLUE#Clear wait dialog...")
if popup then popup:done() end
game.log("#ROYAL_BLUE#Checking for custom preview image %s...", add.short_name, "user-generated-addons/"..add.for_module.."-"..add.short_name.."-custom.png")
if fs.exists("/user-generated-addons/"..add.for_module.."-"..add.short_name.."-custom.png") then
game.log("#LIGHT_GREEN#Found %s", add.short_name, "user-generated-addons/"..add.for_module.."-"..add.short_name.."-custom.png")
game:registerTimer(0.01, function()
game.log("#ROYAL_BLUE#Uploading addon %s preview image %s to Steam Workshop...", add.short_name, "user-generated-addons/"..add.for_module.."-"..add.short_name.."-custom.png")
local popup = Dialog:simpleWaiter("Uploading addon preview to Steam Workshop", "Addon: "..add.short_name, nil, 10000)
game.log("#ROYAL_BLUE#Initiating publishFileUpdate('%s')...", "user-generated-addons/"..add.for_module.."-"..add.short_name.."-custom.png")
core.steam.publishFileUpdate(pubid, "user-generated-addons/"..add.for_module.."-"..add.short_name.."-custom.png", true, function(error)
game.log("#ROYAL_BLUE#Clear wait dialog...")
if popup then popup:done() end
if error then
game.log("#LIGHT_RED#There was an error uploading the preview image: %s", error)
Dialog:simplePopup("Steam Workshop: "..add.long_name, "There was an error uploading the addon preview.")
else
game.log("#LIGHT_GREEN#Preview image succesfully uploaded to the Workshop.")
Dialog:simplePopup("Steam Workshop: "..add.long_name, "Addon update & preview succesfully uploaded to the Workshop.")
end
end)
end) else
if error then
game.log("#LIGHT_RED#There was an error uploading the addon %s: %s", add.short_name, error)
Dialog:simplePopup("Steam Workshop: "..add.long_name, "There was an error uploading the addon.")
else
game.log("#LIGHT_GREEN#Addon %s update succesfully uploaded to the Workshop.", add.short_name)
Dialog:simplePopup("Steam Workshop: "..add.long_name, "Addon update succesfully uploaded to the Workshop.")
end
end
end)
end
game.log("#ROYAL_BLUE#Ending publishAddonSteam()...")
end
---
I added:
Code: Select all
if popup then
game.log("#LIGHT_RED#Something went wrong somewhere, as a dialog was left hanging open and had to be closed at the end of publishAddonSteam().")
popup:done()
end