Dont update if debug build
This commit is contained in:
parent
d910ea5df5
commit
dd38d2e6ff
@ -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
|
||||||
{
|
{
|
||||||
};
|
};
|
||||||
|
@ -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
|
||||||
|
|
||||||
|
if (name == binaryname) then
|
||||||
|
updatebinary = true
|
||||||
end
|
end
|
||||||
|
|
||||||
table.insert(needed, files[i])
|
table.insert(needed, files[i])
|
||||||
end
|
|
||||||
|
::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"
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user