整理版本更新代码,临时改成每次启动刷新所有lib文件

This commit is contained in:
MrZ626
2021-05-20 12:10:36 +08:00
parent 4173441d3c
commit 9046a0a7c8
2 changed files with 24 additions and 33 deletions

View File

@@ -10,33 +10,28 @@ return function(name,libName)
local fs=love.filesystem
local platform={'arm64-v8a','armeabi-v7a'}
local libFunc=package.loadlib(SAVEDIR.."/lib/"..libName.Android,libName.libFunc)
if libFunc then
LOG.print(name.." lib loaded",'message')
else
for i=1,#platform do
local soFile,_,_,mes1=fs.read('data',"libAndroid/"..platform[i].."/"..libName.Android)
if soFile then
local success,mes2=fs.write("lib/"..libName.Android,soFile)
if success then
libFunc,mes2=package.loadlib(SAVEDIR.."/lib/"..libName.Android,libName.libFunc)
if libFunc then
LOG.print(name.." lib loaded",'message')
break
else
LOG.print("Cannot load "..name..": "..mes2,'error')
end
for i=1,#platform do
local soFile,_,_,mes1=fs.read('data',"libAndroid/"..platform[i].."/"..libName.Android)
if soFile then
local success,mes2=fs.write("lib/"..libName.Android,soFile)
if success then
libFunc,mes2=package.loadlib(SAVEDIR.."/lib/"..libName.Android,libName.libFunc)
if libFunc then
LOG.print(name.." lib loaded",'message')
break
else
LOG.print(("Write %s-%s to saving failed: %s"):format(name,platform[i],mes2),'error')
LOG.print("Cannot load "..name..": "..mes2,'error')
end
else
LOG.print(("Read %s-%s to saving failed: %s"):format(name,platform[i],mes1),'error')
LOG.print(("Write %s-%s to saving failed: %s"):format(name,platform[i],mes2),'error')
end
else
LOG.print(("Read %s-%s to saving failed: %s"):format(name,platform[i],mes1),'error')
end
if not libFunc then
LOG.print("Cannot load "..name,'error')
return
end
end
if not libFunc then
LOG.print("Cannot load "..name,'error')
return
end
return libFunc()
else

View File

@@ -239,8 +239,7 @@ end
--Update data
do
local needSave
local autoRestart
local needSave,autoRestart
if type(STAT.version)~='number'then
STAT.version=0
@@ -267,21 +266,18 @@ do
needSave=true
autoRestart=true
end
if STAT.version~=VERSION.code then
STAT.version=VERSION.code
needSave=true
autoRestart=true
end
if not SETTING.VKSkin then SETTING.VKSkin=1 end
if not TABLE.find({8,10,13,17,22,29,37,47,62,80,100},SETTING.frameMul)then
SETTING.frameMul=100
end
SETTING.appLock=nil
for _,v in next,VK_org do v.color=nil end
if STAT.version~=VERSION.code then
STAT.version=VERSION.code
CLEAR("lib")
needSave=true
autoRestart=true
end
if RANKS.GM then RANKS.GM=0 end
if RANKS.infinite then RANKS.infinite=6 end
if RANKS.infinite_dig then RANKS.infinite_dig=6 end