【bug】修复老包报错
parent
097d754111
commit
5d149e54fa
|
@ -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
|
Loading…
Reference in New Issue