GameConfigUtil = GameConfigUtil or {} function GameConfigUtil.Load() if not AppConst.UpdateMode then ClientConfig.login_php = ClientConfig.url_account_path .. ClientConfig.login_php ClientConfig.server_version = ClientConfig.url_account_path .. ClientConfig.server_version ClientConfig.server_file = ClientConfig.url_account_path .. ClientConfig.server_file ClientConfig.simplify_server_file = ClientConfig.url_account_path .. ClientConfig.simplify_server_file GameConfigUtil.CheckBelongSimplifyServer( ) ClientConfig.notice_version = ClientConfig.notice_download_url .. ClientConfig.notice_version ClientConfig.notice_file = ClientConfig.notice_download_url .. ClientConfig.notice_file return end if GameConfig:GetValue("OpenLuaErrorWin") == "0" then ClientConfig.open_lua_error_win = false end if GameConfig:GetValue("AutoSlientUpdate") == "0" then ClientConfig.auto_slient_update = false end local game_publish_data = GameConfig:GetValue("GamePublishData") if game_publish_data and game_publish_data ~= "" then ClientConfig.game_publish_data = game_publish_data end if GameConfig:GetValue("OpenPay") == "0" then ClientConfig.open_pay = false end if GameConfig:GetValue("OpenCustomPay") == "1" then ClientConfig.open_custom_pay = true end if GameConfig:GetValue("OpenAccountServer") == "1" then ClientConfig.account_server = true end if GameConfig:GetValue("OpenSDKServer") == "1" then ClientConfig.sdk_server = true ClientConfig.account_server = true end if GameConfig:GetValue("PlatCustomExit") == "1" then ClientConfig.plat_custom_exit = true end if GameConfig:GetValue("OutServer") == "1" then ClientConfig.is_out_server = true ClientConfig.cur_server_key = ClientConfig.out_server_key end if GameConfig:GetValue("PlatBelong") ~= "" then ClientConfig.plat_belong = GameConfig:GetValue("PlatBelong") end if GameConfig:GetValue("PlatLuaName") ~= "" and GameConfig:GetValue("PlatLuaClass") ~= "" then ClientConfig.plat_lua_name = GameConfig:GetValue("PlatLuaName") ClientConfig.plat_lua_class = GameConfig:GetValue("PlatLuaClass") end ClientConfig.plat_name = GameConfig:GetValue("PlatName") ClientConfig.login_php = GameConfig:GetValue("LoginPhp") ClientConfig.server_version = GameConfig:GetValue("ServerVersion") ClientConfig.server_file = GameConfig:GetValue("ServerFile") ClientConfig.php_website_error = GameConfig:GetValue("PhpWebsiteError") ClientConfig.plat_logo = GameConfig:GetValue("PlatLogo") if AppConst.IOSAlphaState then ClientConfig.plat_belong = "appstore" ClientConfig.alpha_mode = true ClientConfig.plat_name = ClientConfig.plat_name .. "_alpha" local alpha_plat_belong = GameConfig:GetValue("AlphaPlatBelong") if alpha_plat_belong and alpha_plat_belong ~= "" then ClientConfig.plat_belong = alpha_plat_belong end end local plat_channel = GameConfig:GetValue("PlatChannel") if plat_channel and plat_channel ~= "" then ClientConfig.plat_name = plat_channel end local phone_dir = GameConfig:GetValue("phone") if phone_dir and phone_dir ~= "" then ClientConfig.phone_dir = phone_dir local login_bg_res_name = GameConfig:GetValue("LoginBgResName") if login_bg_res_name and login_bg_res_name ~= "" then GamePlatformRes.APPRES[ClientConfig.phone_dir .. "/" .. login_bg_res_name] = GamePlatformRes.Define.LOGIN_BG end local login_logo_res_name = GameConfig:GetValue("LoginLogoResName") if login_logo_res_name and login_logo_res_name ~= "" then GamePlatformRes.APPRES[ClientConfig.phone_dir .. "/" .. login_logo_res_name] = GamePlatformRes.Define.LOGIN_LOGO end local login_photo_res_name = GameConfig:GetValue("LoginPhotoResName") if login_photo_res_name and login_photo_res_name ~= "" then GamePlatformRes.APPRES[ClientConfig.phone_dir .. "/" .. login_photo_res_name] = GamePlatformRes.Define.HEAD_LOGO end end local remote_url = GameConfig:GetValue("AccountRootPath") if remote_url ~= "" then ClientConfig.url_account_path = remote_url end local backurl_account_path = GameConfig:GetValue("BackUpAccountRootPath") if backurl_account_path and backurl_account_path ~= "" then ClientConfig.backurl_account_path = backurl_account_path else ClientConfig.backurl_account_path = nil end local rolehead_url = GameConfig:GetValue("RoleHeadUrl") if rolehead_url and rolehead_url ~= "" then ClientConfig.rolehead_url = rolehead_url else ClientConfig.rolehead_url = ClientConfig.url_account_path end local rolehead_download_url = GameConfig:GetValue("RoleHeadPictureDownUrl") if rolehead_download_url and rolehead_download_url ~= "" then ClientConfig.rolehead_download_url = rolehead_download_url else ClientConfig.rolehead_download_url = ClientConfig.rolehead_url end local super_vip_open_config = GameConfig:GetValue("SuperVipOpenConfig") if super_vip_open_config and super_vip_open_config ~= "" then ClientConfig.super_vip_open_config = GameConfig:GetValue("SuperVipOpenConfig") end local super_vip_custom_info = GameConfig:GetValue("SuperVipCustomInfo") if super_vip_custom_info and super_vip_custom_info ~= "" then ClientConfig.super_vip_custom_info = GameConfig:GetValue("SuperVipCustomInfo") end local super_vip_open = GameConfig:GetValue("SuperVipOpen") if super_vip_open and super_vip_open == "1" then ClientConfig.super_vip_open = true end local vip_gift_data = GameConfig:GetValue("VipGiftRewardNew") if vip_gift_data and vip_gift_data ~= "" then ClientConfig.vip_gift_data = vip_gift_data end local product_plat = GameConfig:GetValue("ProductPlat") if product_plat and product_plat ~= "" then ClientConfig.product_plat = product_plat end local overseas_plat = GameConfig:GetValue("OverseasPlat") if overseas_plat and overseas_plat == "1" then ClientConfig.overseas_plat = true end local notice_download_url = GameConfig:GetValue("NoticeDownloadUrl") if notice_download_url and notice_download_url ~= "" then ClientConfig.notice_download_url = notice_download_url end if ClientConfig.overseas_plat then ClientConfig.notice_download_url = ClientConfig.url_account_path ClientConfig.notice_version = ClientConfig.notice_download_url .. "logs/" .. ClientConfig.notice_version ClientConfig.notice_file = ClientConfig.notice_download_url .. "logs/" .. ClientConfig.notice_file else ClientConfig.notice_version = ClientConfig.notice_download_url .. ClientConfig.notice_version ClientConfig.notice_file = ClientConfig.notice_download_url .. ClientConfig.notice_file end ClientConfig.login_php = ClientConfig.url_account_path .. ClientConfig.login_php ClientConfig.server_version = ClientConfig.url_account_path .. ClientConfig.server_version ClientConfig.server_file = ClientConfig.url_account_path .. ClientConfig.server_file ClientConfig.simplify_server_file = ClientConfig.url_account_path .. ClientConfig.simplify_server_file GameConfigUtil.CheckBelongSimplifyServer( ) end function GameConfigUtil.GetValue( key ) return GameConfig:GetValue(key) end function GameConfigUtil.CheckBackupAccountUrl( cur_url ) if ClientConfig.backurl_account_path and not G_USE_BACKUP_ACCOUNT_URL_MODE and string.find(cur_url, ClientConfig.backurl_account_path) then print("use back account url mode succeed") ClientConfig.server_version = string.gsub(ClientConfig.server_version,ClientConfig.url_account_path,ClientConfig.backurl_account_path) ClientConfig.simplify_server_file = string.gsub(ClientConfig.simplify_server_file,ClientConfig.url_account_path,ClientConfig.backurl_account_path) GameConfigUtil.CheckBelongSimplifyServer( ) ClientConfig.server_file = string.gsub(ClientConfig.server_file,ClientConfig.url_account_path,ClientConfig.backurl_account_path) ClientConfig.login_php = string.gsub(ClientConfig.login_php,ClientConfig.url_account_path,ClientConfig.backurl_account_path) G_USE_BACKUP_ACCOUNT_URL_MODE = true end end function GameConfigUtil.CheckBelongSimplifyServer( ) if ClientConfig.plat_belong == "demon" then--开发不拼接专属 return end if ClientConfig.plat_belong and not string.find(ClientConfig.simplify_server_file, ClientConfig.plat_belong) then ClientConfig.simplify_server_file = string.gsub(ClientConfig.simplify_server_file,"server","server_" .. ClientConfig.plat_belong) end end