From 5d149e54fa051f8d667a3e6853355e1f68f788dd Mon Sep 17 00:00:00 2001 From: JieLing Date: Mon, 8 Mar 2021 22:17:00 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90bug=E3=80=91=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E8=80=81=E5=8C=85=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Framework/Manager/ServerConfigManager.lua | 42 +++++++++---------- 1 file changed, 20 insertions(+), 22 deletions(-) diff --git a/Assets/ManagedResources/~Lua/Framework/Manager/ServerConfigManager.lua b/Assets/ManagedResources/~Lua/Framework/Manager/ServerConfigManager.lua index f8a182ff4d..88915a1d11 100644 --- a/Assets/ManagedResources/~Lua/Framework/Manager/ServerConfigManager.lua +++ b/Assets/ManagedResources/~Lua/Framework/Manager/ServerConfigManager.lua @@ -18,15 +18,9 @@ end function ServerConfigManager.IsSettingActive(settingType) local s_isActive = "Setting."..settingType..".isActive" local s_versionCode = "Setting."..settingType..".versionCode" - local isActive = ServerConfigManager.GetConfigInfo(s_isActive) == "1" - if isActive then -- 激活 - if not AppConst.isSDK then - return true - end - local vc = AndroidDeviceInfo.Instance:GetVersionCode() - if vc >= tonumber(ServerConfigManager.GetConfigInfo(s_versionCode)) then --符合包版本 - return true - end + local isActive = ServerConfigManager.GetConfigInfo(s_isActive) + if isActive and isActive == "1" then -- 激活 + return true end return false end @@ -40,23 +34,27 @@ end -- 获取version信息(老版本信息,新版中用于获取版本号,包版本号,) function ServerConfigManager.GetVersionInfo(key) - -- 包版本大于启用的版本使用新的配置 - if not AppConst.isSDK or AndroidDeviceInfo.Instance:GetVersionCode() >= _ActiveCode then - local v = ServerConfigManager.GetConfigInfo(key) - if not v then - v = VersionManager:GetVersionInfo(key) - end - return v - else - return VersionManager:GetVersionInfo(key) + local v = ServerConfigManager.GetConfigInfo(key) + if not v then + v = VersionManager:GetVersionInfo(key) end + return v end -- function ServerConfigManager.GetConfigInfo(key) - if not ConfigMgr then - ConfigMgr=App.ConfigMgr + -- 包版本大于启用的版本使用新的配置 + if AppConst.isSDK then + LogError(tostring(AppConst.isSDK)) + LogError(tostring(AndroidDeviceInfo.Instance:GetVersionCode())) + LogError(tostring(_ActiveCode)) + LogError(tostring(AndroidDeviceInfo.Instance:GetVersionCode() >= _ActiveCode)) + end + if not AppConst.isSDK or AndroidDeviceInfo.Instance:GetVersionCode() >= _ActiveCode then + if not ConfigMgr then + ConfigMgr=App.ConfigMgr + end + local s = ConfigMgr:GetConfigInfo(key) + return s end - local s = ConfigMgr:GetConfigInfo(key) - return s end \ No newline at end of file