【配置】完善逻辑并应用

dev_chengFeng
gaoxin 2021-03-02 15:18:06 +08:00
parent 16ea6c16de
commit d124d59f1b
7 changed files with 57 additions and 17 deletions

View File

@ -5,7 +5,6 @@
* @Created by MagicianJoker * @Created by MagicianJoker
--]] --]]
SERVER_VERSION = 0 -- 0 正式服 1 提审服
-- 启用功能引导 -- 启用功能引导
ENABLE_FUNC_GUIDE = 1 --0关闭1开启 ENABLE_FUNC_GUIDE = 1 --0关闭1开启
RECHARGEABLE = true --false不可充值 true可充值 RECHARGEABLE = true --false不可充值 true可充值

View File

@ -1,18 +1,56 @@
ServerConfigManager = { } ServerConfigManager = { }
local _ActiveCode = 0 -- 激活版本
ServerConfigManager.SettingConfig = {
ServerVersion = "ServerVersion", -- 用于切换正式服和提审服
ThinkAnalysis_GetDeviceID = "ThinkAnalysis_GetDeviceID", -- 数数获取DeviceID方法
LayoutBuilderWrap = "LayoutBuilderWrap", -- 强制刷新layout组件大小的方法修改到lua中调用
LanguagePackager = "LanguagePackager", -- 本地化处理
}
function ServerConfigManager.Initialize() function ServerConfigManager.Initialize()
LogError(ServerConfigManager.GetConfigInfo("func.Func_1.desc"))
end end
-- 判断是否有 -- 判断设置是否激活
function ServerConfigManager.IsConfig() function ServerConfigManager.IsSettingActive(settingType)
if AndroidDeviceInfo.Instance:GetVersionCode() > 24 then local s_isActive = "Setting."..settingType..".isActive"
local s_versionCode = "Setting."..settingType..".versionCode"
local isActive = ServerConfigManager.GetConfigInfo(s_isActive) == "1"
if isActive then -- 激活
local vc = AndroidDeviceInfo.Instance:GetVersionCode()
if vc >= tonumber(ServerConfigManager.GetConfigInfo(s_versionCode)) then --符合包版本
return true
end
end
return false
end
function ServerConfigManager.GetSettingValue(settingType)
if ServerConfigManager.IsSettingActive(settingType) then
local s_value = "Setting."..settingType..".value"
local value = ServerConfigManager.GetConfigInfo(s_value)
LogError(s_value .. "| ".. value)
return value
end end
end end
-- 获取version信息老版本信息新版中用于获取版本号包版本号
function ServerConfigManager.GetVersionInfo(key)
-- 包版本大于启用的版本使用新的配置
if 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)
end
end
--
function ServerConfigManager.GetConfigInfo(key) function ServerConfigManager.GetConfigInfo(key)
local s = ConfigMgr:GetConfigInfo(key) local s = ConfigMgr:GetConfigInfo(key)
return s return s
@ -30,5 +68,4 @@ end
function ServerConfigManager.GetConfigStreamingInfo(key) function ServerConfigManager.GetConfigStreamingInfo(key)
local s = ConfigMgr:GetConfigStreamingInfo(key) local s = ConfigMgr:GetConfigStreamingInfo(key)
return s return s
end end

View File

@ -71,7 +71,7 @@ end
-- 获取设备Id -- 获取设备Id
function this.GetDeviceId() function this.GetDeviceId()
if AppConst.isSDK then if AppConst.isSDK then
if AndroidDeviceInfo.Instance:GetVersionCode() > 24 then if ServerConfigManager.IsSettingActive(ServerConfigManager.SettingConfig.ThinkAnalysis_GetDeviceID) then
return App.TAMgr:GetDeviceId() return App.TAMgr:GetDeviceId()
end end
return AndroidDeviceInfo.Instance:GetDeviceID() return AndroidDeviceInfo.Instance:GetDeviceID()

View File

@ -7,7 +7,7 @@ this.IsLogin = false
this.pt_pId = "" this.pt_pId = ""
this.pt_gId = "" this.pt_gId = ""
local LoginRoot_Url = VersionManager:GetVersionInfo("serverUrl") local LoginRoot_Url = ServerConfigManager.GetVersionInfo("serverUrl")
function this.Initialize() function this.Initialize()
this.IsLogin = false this.IsLogin = false
this.GameName='DouDou' this.GameName='DouDou'

View File

@ -4,7 +4,7 @@ LoginPanel = Inherit(BasePanel)
local this = LoginPanel local this = LoginPanel
this.LoginWay = { Account = 0, WeChat = 1 } this.LoginWay = { Account = 0, WeChat = 1 }
SERVER_VERSION = tonumber(ServerConfigManager.GetSettingValue(ServerConfigManager.SettingConfig.ServerVersion) or 0)
local ServerVersion = SERVER_VERSION local ServerVersion = SERVER_VERSION
local IsShowNotice = SERVER_VERSION == 0 -- 正式服显示公告 local IsShowNotice = SERVER_VERSION == 0 -- 正式服显示公告
@ -15,11 +15,11 @@ local openIdkey = "openIdkey"
local openIdPw = "openIdPw" local openIdPw = "openIdPw"
local defaultOpenIdkey = Language[11118] local defaultOpenIdkey = Language[11118]
local defaultOpenIdPw = "" local defaultOpenIdPw = ""
local LoginRoot_Url = VersionManager:GetVersionInfo("serverUrl") local LoginRoot_Url = ServerConfigManager.GetVersionInfo("serverUrl")
local LoginRoot_SubChannel = VersionManager:GetVersionInfo("subChannel") local LoginRoot_SubChannel = ServerConfigManager.GetVersionInfo("subChannel")
local LoginRoot_Channel = VersionManager:GetVersionInfo("channel") local LoginRoot_Channel = ServerConfigManager.GetVersionInfo("channel")
local LoginRoot_Version = VersionManager:GetVersionInfo("version") local LoginRoot_Version = ServerConfigManager.GetVersionInfo("version")
local LoginRoot_PackageVersion = VersionManager:GetVersionInfo("packageVersion") local LoginRoot_PackageVersion = ServerConfigManager.GetVersionInfo("packageVersion")
local orginLayer local orginLayer
local timeStamp = Time.realtimeSinceStartup local timeStamp = Time.realtimeSinceStartup

View File

@ -1,7 +1,7 @@
require("Base/BasePanel") require("Base/BasePanel")
NoticePopup = Inherit(BasePanel) NoticePopup = Inherit(BasePanel)
local this = NoticePopup local this = NoticePopup
local LoginRoot_Url = VersionManager:GetVersionInfo("serverUrl") local LoginRoot_Url = ServerConfigManager.GetVersionInfo("serverUrl")
--初始化组件(用于子类重写) --初始化组件(用于子类重写)
function NoticePopup:InitComponent() function NoticePopup:InitComponent()

View File

@ -15,7 +15,11 @@ namespace GameEditor.FrameTool {
public class ConfigWindow : EditorWindow public class ConfigWindow : EditorWindow
{ {
string m_ExcelPath = EditorPrefs.GetString("m_ExcelPath"); string m_ExcelPath;
private void OnEnable()
{
m_ExcelPath = EditorPrefs.GetString("m_ExcelPath");
}
// Add menu named "My Window" to the Window menu // Add menu named "My Window" to the Window menu
[MenuItem("Build/Config")] [MenuItem("Build/Config")]