源战役客户端
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

203 rindas
8.1 KiB

pirms 4 nedēļām
  1. GameConfigUtil = GameConfigUtil or {}
  2. function GameConfigUtil.Load()
  3. if not AppConst.UpdateMode then
  4. ClientConfig.login_php = ClientConfig.url_account_path .. ClientConfig.login_php
  5. ClientConfig.server_version = ClientConfig.url_account_path .. ClientConfig.server_version
  6. ClientConfig.server_file = ClientConfig.url_account_path .. ClientConfig.server_file
  7. ClientConfig.simplify_server_file = ClientConfig.url_account_path .. ClientConfig.simplify_server_file
  8. GameConfigUtil.CheckBelongSimplifyServer( )
  9. ClientConfig.notice_version = ClientConfig.notice_download_url .. ClientConfig.notice_version
  10. ClientConfig.notice_file = ClientConfig.notice_download_url .. ClientConfig.notice_file
  11. return
  12. end
  13. if GameConfig:GetValue("OpenLuaErrorWin") == "0" then
  14. ClientConfig.open_lua_error_win = false
  15. end
  16. if GameConfig:GetValue("AutoSlientUpdate") == "0" then
  17. ClientConfig.auto_slient_update = false
  18. end
  19. local game_publish_data = GameConfig:GetValue("GamePublishData")
  20. if game_publish_data and game_publish_data ~= "" then
  21. ClientConfig.game_publish_data = game_publish_data
  22. end
  23. if GameConfig:GetValue("OpenPay") == "0" then
  24. ClientConfig.open_pay = false
  25. end
  26. if GameConfig:GetValue("OpenCustomPay") == "1" then
  27. ClientConfig.open_custom_pay = true
  28. end
  29. if GameConfig:GetValue("OpenAccountServer") == "1" then
  30. ClientConfig.account_server = true
  31. end
  32. if GameConfig:GetValue("OpenSDKServer") == "1" then
  33. ClientConfig.sdk_server = true
  34. ClientConfig.account_server = true
  35. end
  36. if GameConfig:GetValue("PlatCustomExit") == "1" then
  37. ClientConfig.plat_custom_exit = true
  38. end
  39. if GameConfig:GetValue("OutServer") == "1" then
  40. ClientConfig.is_out_server = true
  41. ClientConfig.cur_server_key = ClientConfig.out_server_key
  42. end
  43. if GameConfig:GetValue("PlatBelong") ~= "" then
  44. ClientConfig.plat_belong = GameConfig:GetValue("PlatBelong")
  45. end
  46. if GameConfig:GetValue("PlatLuaName") ~= "" and GameConfig:GetValue("PlatLuaClass") ~= "" then
  47. ClientConfig.plat_lua_name = GameConfig:GetValue("PlatLuaName")
  48. ClientConfig.plat_lua_class = GameConfig:GetValue("PlatLuaClass")
  49. end
  50. ClientConfig.plat_name = GameConfig:GetValue("PlatName")
  51. ClientConfig.login_php = GameConfig:GetValue("LoginPhp")
  52. ClientConfig.server_version = GameConfig:GetValue("ServerVersion")
  53. ClientConfig.server_file = GameConfig:GetValue("ServerFile")
  54. ClientConfig.php_website_error = GameConfig:GetValue("PhpWebsiteError")
  55. ClientConfig.plat_logo = GameConfig:GetValue("PlatLogo")
  56. if AppConst.IOSAlphaState then
  57. ClientConfig.plat_belong = "appstore"
  58. ClientConfig.alpha_mode = true
  59. ClientConfig.plat_name = ClientConfig.plat_name .. "_alpha"
  60. local alpha_plat_belong = GameConfig:GetValue("AlphaPlatBelong")
  61. if alpha_plat_belong and alpha_plat_belong ~= "" then
  62. ClientConfig.plat_belong = alpha_plat_belong
  63. end
  64. end
  65. local plat_channel = GameConfig:GetValue("PlatChannel")
  66. if plat_channel and plat_channel ~= "" then
  67. ClientConfig.plat_name = plat_channel
  68. end
  69. local phone_dir = GameConfig:GetValue("phone")
  70. if phone_dir and phone_dir ~= "" then
  71. ClientConfig.phone_dir = phone_dir
  72. local login_bg_res_name = GameConfig:GetValue("LoginBgResName")
  73. if login_bg_res_name and login_bg_res_name ~= "" then
  74. GamePlatformRes.APPRES[ClientConfig.phone_dir .. "/" .. login_bg_res_name] = GamePlatformRes.Define.LOGIN_BG
  75. end
  76. local login_logo_res_name = GameConfig:GetValue("LoginLogoResName")
  77. if login_logo_res_name and login_logo_res_name ~= "" then
  78. GamePlatformRes.APPRES[ClientConfig.phone_dir .. "/" .. login_logo_res_name] = GamePlatformRes.Define.LOGIN_LOGO
  79. end
  80. local login_photo_res_name = GameConfig:GetValue("LoginPhotoResName")
  81. if login_photo_res_name and login_photo_res_name ~= "" then
  82. GamePlatformRes.APPRES[ClientConfig.phone_dir .. "/" .. login_photo_res_name] = GamePlatformRes.Define.HEAD_LOGO
  83. end
  84. end
  85. local remote_url = GameConfig:GetValue("AccountRootPath")
  86. if remote_url ~= "" then
  87. ClientConfig.url_account_path = remote_url
  88. end
  89. local backurl_account_path = GameConfig:GetValue("BackUpAccountRootPath")
  90. if backurl_account_path and backurl_account_path ~= "" then
  91. ClientConfig.backurl_account_path = backurl_account_path
  92. else
  93. ClientConfig.backurl_account_path = nil
  94. end
  95. local rolehead_url = GameConfig:GetValue("RoleHeadUrl")
  96. if rolehead_url and rolehead_url ~= "" then
  97. ClientConfig.rolehead_url = rolehead_url
  98. else
  99. ClientConfig.rolehead_url = ClientConfig.url_account_path
  100. end
  101. local rolehead_download_url = GameConfig:GetValue("RoleHeadPictureDownUrl")
  102. if rolehead_download_url and rolehead_download_url ~= "" then
  103. ClientConfig.rolehead_download_url = rolehead_download_url
  104. else
  105. ClientConfig.rolehead_download_url = ClientConfig.rolehead_url
  106. end
  107. local super_vip_open_config = GameConfig:GetValue("SuperVipOpenConfig")
  108. if super_vip_open_config and super_vip_open_config ~= "" then
  109. ClientConfig.super_vip_open_config = GameConfig:GetValue("SuperVipOpenConfig")
  110. end
  111. local super_vip_custom_info = GameConfig:GetValue("SuperVipCustomInfo")
  112. if super_vip_custom_info and super_vip_custom_info ~= "" then
  113. ClientConfig.super_vip_custom_info = GameConfig:GetValue("SuperVipCustomInfo")
  114. end
  115. local super_vip_open = GameConfig:GetValue("SuperVipOpen")
  116. if super_vip_open and super_vip_open == "1" then
  117. ClientConfig.super_vip_open = true
  118. end
  119. local vip_gift_data = GameConfig:GetValue("VipGiftRewardNew")
  120. if vip_gift_data and vip_gift_data ~= "" then
  121. ClientConfig.vip_gift_data = vip_gift_data
  122. end
  123. local product_plat = GameConfig:GetValue("ProductPlat")
  124. if product_plat and product_plat ~= "" then
  125. ClientConfig.product_plat = product_plat
  126. end
  127. local overseas_plat = GameConfig:GetValue("OverseasPlat")
  128. if overseas_plat and overseas_plat == "1" then
  129. ClientConfig.overseas_plat = true
  130. end
  131. local notice_download_url = GameConfig:GetValue("NoticeDownloadUrl")
  132. if notice_download_url and notice_download_url ~= "" then
  133. ClientConfig.notice_download_url = notice_download_url
  134. end
  135. if ClientConfig.overseas_plat then
  136. ClientConfig.notice_download_url = ClientConfig.url_account_path
  137. ClientConfig.notice_version = ClientConfig.notice_download_url .. "logs/" .. ClientConfig.notice_version
  138. ClientConfig.notice_file = ClientConfig.notice_download_url .. "logs/" .. ClientConfig.notice_file
  139. else
  140. ClientConfig.notice_version = ClientConfig.notice_download_url .. ClientConfig.notice_version
  141. ClientConfig.notice_file = ClientConfig.notice_download_url .. ClientConfig.notice_file
  142. end
  143. ClientConfig.login_php = ClientConfig.url_account_path .. ClientConfig.login_php
  144. ClientConfig.server_version = ClientConfig.url_account_path .. ClientConfig.server_version
  145. ClientConfig.server_file = ClientConfig.url_account_path .. ClientConfig.server_file
  146. ClientConfig.simplify_server_file = ClientConfig.url_account_path .. ClientConfig.simplify_server_file
  147. GameConfigUtil.CheckBelongSimplifyServer( )
  148. end
  149. function GameConfigUtil.GetValue( key )
  150. return GameConfig:GetValue(key)
  151. end
  152. function GameConfigUtil.CheckBackupAccountUrl( cur_url )
  153. if ClientConfig.backurl_account_path and not G_USE_BACKUP_ACCOUNT_URL_MODE and string.find(cur_url, ClientConfig.backurl_account_path) then
  154. print("use back account url mode succeed")
  155. ClientConfig.server_version = string.gsub(ClientConfig.server_version,ClientConfig.url_account_path,ClientConfig.backurl_account_path)
  156. ClientConfig.simplify_server_file = string.gsub(ClientConfig.simplify_server_file,ClientConfig.url_account_path,ClientConfig.backurl_account_path)
  157. GameConfigUtil.CheckBelongSimplifyServer( )
  158. ClientConfig.server_file = string.gsub(ClientConfig.server_file,ClientConfig.url_account_path,ClientConfig.backurl_account_path)
  159. ClientConfig.login_php = string.gsub(ClientConfig.login_php,ClientConfig.url_account_path,ClientConfig.backurl_account_path)
  160. G_USE_BACKUP_ACCOUNT_URL_MODE = true
  161. end
  162. end
  163. function GameConfigUtil.CheckBelongSimplifyServer( )
  164. if ClientConfig.plat_belong == "demon" then--开发不拼接专属
  165. return
  166. end
  167. if ClientConfig.plat_belong and not string.find(ClientConfig.simplify_server_file, ClientConfig.plat_belong) then
  168. ClientConfig.simplify_server_file = string.gsub(ClientConfig.simplify_server_file,"server","server_" .. ClientConfig.plat_belong)
  169. end
  170. end