Dont update if debug build

This commit is contained in:
fed 2022-01-31 09:03:59 +01:00
parent d910ea5df5
commit dd38d2e6ff
2 changed files with 30 additions and 8 deletions

View File

@ -1185,6 +1185,11 @@ namespace ui_scripting::lua
utils::nt::terminate(); utils::nt::terminate();
}; };
game_type["isdebugbuild"] = [](const game&)
{
return DEBUG;
};
struct player struct player
{ {
}; };

View File

@ -173,29 +173,46 @@ function updaterpopup(oncancel)
}) })
end end
function deleteoldfile()
io.removefile(game:binaryname() .. ".old")
end
deleteoldfile()
function verifyfiles(files) function verifyfiles(files)
local needed = {} local needed = {}
local needtoupdatebinary = false local updatebinary = false
if (game:isdebugbuild()) then
--return needed, updaetbinary
end
local binaryname = game:binaryname() local binaryname = game:binaryname()
for i = 1, #files do for i = 1, #files do
local name = files[i][1] local name = files[i][1]
if (not io.fileexists(name) or game:sha(io.readfile(name)) ~= files[i][3]) then if (io.fileexists(name) and game:sha(io.readfile(name)) == files[i][3]) then
if (name == game:binaryname()) then goto continue
needtoupdatebinary = true
end
table.insert(needed, files[i])
end end
if (name == binaryname) then
updatebinary = true
end
table.insert(needed, files[i])
::continue::
end end
return needed, needtoupdatebinary return needed, updatebinary
end end
local canceled = false local canceled = false
function downloadfiles(popup, files, callback) function downloadfiles(popup, files, callback)
deleteoldfile()
local text = popup:getchildren()[7] local text = popup:getchildren()[7]
local folder = game:environment() == "develop" and "data-dev" or "data" local folder = game:environment() == "develop" and "data-dev" or "data"