From 9046a0a7c8c385caa566b807be6d73aadf952f43 Mon Sep 17 00:00:00 2001 From: MrZ626 <1046101471@qq.com> Date: Thu, 20 May 2021 12:10:36 +0800 Subject: [PATCH] =?UTF-8?q?=E6=95=B4=E7=90=86=E7=89=88=E6=9C=AC=E6=9B=B4?= =?UTF-8?q?=E6=96=B0=E4=BB=A3=E7=A0=81=EF=BC=8C=E4=B8=B4=E6=97=B6=E6=94=B9?= =?UTF-8?q?=E6=88=90=E6=AF=8F=E6=AC=A1=E5=90=AF=E5=8A=A8=E5=88=B7=E6=96=B0?= =?UTF-8?q?=E6=89=80=E6=9C=89lib=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Zframework/loadLib.lua | 39 +++++++++++++++++---------------------- main.lua | 18 +++++++----------- 2 files changed, 24 insertions(+), 33 deletions(-) diff --git a/Zframework/loadLib.lua b/Zframework/loadLib.lua index a992cd8b..97ebaa25 100644 --- a/Zframework/loadLib.lua +++ b/Zframework/loadLib.lua @@ -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 diff --git a/main.lua b/main.lua index b03f353d..02212be9 100644 --- a/main.lua +++ b/main.lua @@ -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