--UPDATE_TRY_VERSION_MAX = 0 --wavepay支付是否使用blueplanet GW_IS_WAVEPAY_USE_BLUEPLANET = true GW_UPDATE_VERSION_FULL = false UPDATE_VERSION_MAX = 891 VerPath = { ["801"] = {name="ZeroInWork_801_20230629_1", size=29554746}, ["802"] = {name="ZeroInWork_802_20230629_1", size=23076}, ["803"] = {name="ZeroInWork_803_20230629_1", size=12313}, ["804"] = {name="ZeroInWork_803_20230629_1", size=1038984}, ["805"] = {name="ZeroInWork_804_20230706_1", size=1038984}, ["806"] = {name="ZeroInWork_805_20230713_1", size=6602532}, ["807"] = {name="ZeroInWork_806_20230720_1", size=3823437}, ["808"] = {name="ZeroInWork_807_20230720_2", size=135794}, ["809"] = {name="ZeroInWork_809_20230727_1", size=5888370}, ["810"] = {name="ZeroInWork_810_20230727_2", size=463208}, ["811"] = {name="ZeroInWork_810_20230803_1", size=7504255}, ["812"] = {name="ZeroInWork_811_20230803_1", size=7837758}, ["813"] = {name="ZeroInWork_813_20230803_1", size=1169962}, ["814"] = {name="ZeroInWork_814_20230809_1", size=9130418}, ["815"] = {name="ZeroInWork_815_20230809_1", size=33500}, ["816"] = {name="ZeroInWork_816_20230809_1", size=75947}, ["817"] = {name="ZeroInWork_817_20230810_1", size=1383546}, ["818"] = {name="ZeroInWork_818_20230810_1", size=1259549}, ["819"] = {name="ZeroInWork_819_20230810_1", size=466601}, ["820"] = {name="ZeroInWork_820_20230817_1", size=1671344}, ["821"] = {name="ZeroInWork_821_20230824_1", size=1269415}, ["822"] = {name="ZeroInWork_822_20230824_1", size=1269431}, ["823"] = {name="ZeroInWork_902_20230830_1", size=1588727}, ["824"] = {name="ZeroInWork_903_20230831_1", size=31789}, ["825"] = {name="ZeroInWork_904_20230906_1", size=2041013}, ["826"] = {name="ZeroInWork_905_20230906_1", size=1169563}, ["827"] = {name="ZeroInWork_906_20230909_1", size=1422066}, ["828"] = {name="ZeroInWork_907_20230913_1", size=1475890}, ["829"] = {name="ZeroInWork_908_20230914_1", size=18708}, ["830"] = {name="ZeroInWork_909_20230914_1", size=1251887}, ["831"] = {name="ZeroInWork_910_20230920_1", size=2007950}, ["832"] = {name="ZeroInWork_912_20230921_1", size=8154}, ["833"] = {name="ZeroInWork_913_20231004_1", size=1211459}, ["834"] = {name="ZeroInWork_914_20231011_1", size=1395987}, ["835"] = {name="ZeroInWork_915_20231018_1", size=1976012}, ["836"] = {name="ZeroInWork_916_20231025_1", size=7589972}, ["837"] = {name="ZeroInWork_916_20231025_2", size=2091626}, ["838"] = {name="ZeroInWork_916_20231025_4", size=4137343}, ["839"] = {name="ZeroInWork_916_20231025_5", size=4137365}, ["840"] = {name="ZeroInWork_918_20231102_1", size=3062185}, ["841"] = {name="ZeroInWork_919_20231104_1", size=123833}, ["842"] = {name="ZeroInWork_920_20231108_1", size=3942991}, ["843"] = {name="ZeroInWork_921_20231111_1", size=1412610}, ["844"] = {name="ZeroInWork_922_20231115_1", size=1574452}, ["845"] = {name="ZeroInWork_923_20231122_1", size=6667339}, ["846"] = {name="ZeroInWork_924_20231123_1", size=1303183}, ["847"] = {name="ZeroInWork_925_20231124_1", size=1412011}, ["848"] = {name="ZeroInWork_926_20231124_2", size=37111}, ["849"] = {name="ZeroInWork_927_20231124_3", size=110455}, ["850"] = {name="ZeroInWork_928_20231129_1", size=1402029}, ["851"] = {name="ZeroInWork_929_20231204_1", size=1366609}, ["852"] = {name="ZeroInWork_930_20231206_1", size=2044011}, ["853"] = {name="ZeroInWork_931_20231207_1", size=1452418}, ["854"] = {name="ZeroInWork_932_20231208_1", size=1905539}, ["855"] = {name="ZeroInWork_932_20231213_2", size=1696816}, ["856"] = {name="ZeroInWork_935_20231220_1", size=13720048}, ["857"] = {name="ZeroInWork_936_20231220_1", size=1309002}, ["858"] = {name="ZeroInWork_937_20231227_1", size=4606876}, ["859"] = {name="ZeroInWork_938_20231227_1", size=2625479}, ["860"] = {name="ZeroInWork_938_20240103_2", size=3677398}, ["861"] = {name="ZeroInWork_940_20240111_1", size=2560362}, ["862"] = {name="ZeroInWork_941_20240117_1", size=4723313}, ["863"] = {name="ZeroInWork_942_20240118_1", size=3040423}, ["864"] = {name="ZeroInWork_943_20240125_1", size=8261539}, ["865"] = {name="ZeroInWork_944_20240201_1", size=13192142}, ["866"] = {name="ZeroInWork_945_20240201_1", size=1676569}, ["867"] = {name="ZeroInWork_946_20240201_1", size=37610}, ["868"] = {name="ZeroInWork_947_20240221_1", size=3499359}, ["869"] = {name="ZeroInWork_948_20240222_1", size=26424}, ["870"] = {name="ZeroInWork_949_20240222_1", size=38977}, ["871"] = {name="ZeroInWork_950_20240226_1", size=1393308}, ["872"] = {name="ZeroInWork_951_20240228_1", size=2263336}, ["873"] = {name="ZeroInWork_952_20240306_1", size=10896898}, ["874"] = {name="ZeroInWork_953_20240307_1", size=47666}, ["875"] = {name="ZeroInWork_954_20240307_1", size=35591}, ["876"] = {name="ZeroInWork_955_20240313_1", size=17408}, ["877"] = {name="ZeroInWork_956_20240320_1", size=5296908}, ["878"] = {name="ZeroInWork_957_20240321_1", size=973173}, ["879"] = {name="ZeroInWork_958_20240321_1", size=20857}, ["880"] = {name="ZeroInWork_959_20240327_1", size=1583413}, ["881"] = {name="ZeroInWork_960_20240328_1", size=1582211}, ["882"] = {name="ZeroInWork_961_20240411_1", size=6139772}, ["883"] = {name="ZeroInWork_962_20240418_1", size=1625318}, ["884"] = {name="ZeroInWork_963_20240425_1", size=2614406}, ["885"] = {name="ZeroInWork_964_20240425_1", size=65471}, ["886"] = {name="ZeroInWork_965_20240508_1", size=1604487}, ["887"] = {name="ZeroInWork_966_20240619_1", size=869824}, ["888"] = {name="ZeroInWork_967_20240808_1", size=3409426}, ["889"] = {name="ZeroInWork_968_20241014_1", size=3410602}, ["890"] = {name="ZeroInWork_969_20241120_1", size=1789952}, ["891"] = {name="ZeroInWork_970_20241202_1", size=1609728} } VerMergePath = { } ----------------------- 公共函数 ---------- -- CDN_URL = "http://cdnres.jstm.shiyuegame.com" -- CDN_URL = "https://cdn.huanxiang.shiyue.cn" CDN_URL = "http://192.168.3.26" REG_URL = "http://192.168.3.26" DOWN_APK_URL = "http://192.168.3.26:81/index.php/ChannelBag/bag" GW_NEW_LOGIN_URL = "http://login.eternalheroesmm.com:83/api/WebService/Handle" -- 新登录流程登录URL--外网(正式) --GW_NEW_LOGIN_URL = "http://testlogin.eternalheroesmm.com:83/api/WebService/Handle" -- 新登录流程登录URL--外网(开发服) --登录平台 GW_NEW_LOGIN_PLATFORM = "android" --是否维护中 GW_IS_SYSTEM_MAINTENANCE = false --维护中显示文字内容 GW_SYSTEM_MAINTENANCE_CONTENT = "A server maintenance is scheduled 2024-11-30 8:30A.M. and it expected to be down for approximately 3 hours to allow for adequate testing" --是否同步资源 GW_NEED_SYNC_SERVER_RES = true --资源路径 GW_SERVER_RES_URL = "http://175.41.165.56/online_google_mianwen/online_google_mianwen_800" --GW_SERVER_RES_URL = "https://art.eternalheroesmm.com/online_google_mianwen/online_google_mianwen_3" --GW_SERVER_RES_URL = "http://res.eternalheroesmm.com/v4" --是否需要强制版本更新 GW_NEED_FORCE_UPDATE_VERSION = false --版本更新地址 --GW_UPDATE_VERSION_URL = "https://play.google.com/store/apps/details?id=com.microplaymm.wycardgame1" --是否开启facebook登录 GW_NEW_LOGIN_IS_FACEBOOK_OPEN = true -- --------------------------------------------------+ -- 非打包热更新处理 -- @author whjing2011@gmail.com -- --------------------------------------------------*/ -- urlConfig加载完成调用 function webFunc_urlConfigEnd() end -- 加载模块完成 初始化instance调用开始时调用 function webFunc_initInstanceStart() end -- 加载模块完成 初始化instance调用完成时调用 function webFunc_initInstanceEnd() end -- 游戏开时完毕时调用 function webFunc_GameStart() end CDN_URL="http://192.168.3.26" CDN_PATH_BASE = CDN_URL.."/update/update_all/" URL_PATH_ALL = {} URL_PATH_ALL.google = { update = CDN_URL.."/update/update_android_demo", register = CDN_URL } URL_PATH_ALL.get = function(platform) local data = URL_PATH_ALL[platform] or URL_PATH_ALL["other"] return data end function get_servers_url(account, platform, channelid, srvid, start, num) function sdkOnPay(money, buyNum, prodId, productName, productDesc) Send(10399, {msg="pay "..prodId}) end return string.format("%s/api/role.php?account=%s&platform=%s&chanleId=%s&srvid=%s", URL_PATH.register, account, platform, DEF_CHANNEL or 'dev', srvid) end function get_notice_url(days, loginData) local host = REAL_LOGIN_DATA and REAL_LOGIN_DATA.host or loginData.host return string.format("http://%s/api.php/local/local/notice/?%s", host, os.time()) end --获取公告显示图片url,若返回nil时不显示图片 function gw_get_notice_img_url(days) return nil --return string.format("https://art.eternalheroesmm.com/notice/img/%s.png", 1) --return string.format("http://47.241.254.0:6342/notice/img/%s.png", days) end --获取公告显示内容url,若返回nil时不显示文字内容 function gw_get_notice_content_url(days) return string.format("https://art.eternalheroesmm.com/notice/content/%s.txt", 1) --return string.format("https://47.241.254.0/notice/content/%s.txt", days) end --获取公告显示图片url,若返回nil时不显示图片--维护中公告内容 function gw_get_notice_img_url_under_maintenance(days) return nil --return string.format("https://art.eternalheroesmm.com/WHNotice/img/%s.png", 1) --return string.format("http://47.241.254.0:6342/WHNotice/img/%s.png", days) end --获取公告显示内容url,若返回nil时不显示文字内容--维护中公告内容 function gw_get_notice_content_url_under_maintenance(days) return string.format("https://art.eternalheroesmm.com/notice/content/%s.txt", 1) --return string.format("https://47.241.254.0/WHNotice/content/%s.txt", days) end -- require("cli_log") GW_NEW_LOGIN_USER_AGREEMENT_URL = "https://privacy.eternalheroesmm.com/policy.html" --用户协议链接 GW_NEW_LOGIN_PRIVACY_GUIDELINES_URL = "https://privacy.eternalheroesmm.com/policy.html" --隐私保护指引链接 WY_FACEBOOK_SHARE_URL = "https://share.eternalheroesmm.com" --屏蔽此行直接领奖,不调用facebook接口(Facebook分享) --GW_CLIENT_APP_VER = "v1.0.1" -------新增打点20230515Start----- GW_RES_DOWNLOAD_VER = 101 GW_RES_DOWNLOAD_NET_BAD_SPEED = 50*1024 GW_RES_DOWNLOAD_RECORD_URL = "http://47.241.101.3:8087/FirstLoad" --开始资源包下载打点 function gw_resDownloadLogStart(total_size, is_in_background, res_url_index, error_code, error_msg, zip_index, net_speed, app_start_count, client_sys_time, zip_request_count, zip_down_state) if gw_resDownloadLogIsFinished() == true then return end local count_time = gw_resDownloadLogStartCount() count_time = count_time + 1 gw_resDownloadLogSendData(1, 0, 0, 0, total_size, count_time, is_in_background, res_url_index, error_code, error_msg, zip_index, net_speed, app_start_count, client_sys_time, zip_request_count, zip_down_state) cc.UserDefault:getInstance():setIntegerForKey("gw_zip_download_record_mark_start", count_time) cc.UserDefault:getInstance():flush() print("gw_resDownloadLogStart") end function gw_resDownloadLogTimer(time, per, downloaded_size, total_size, is_in_background, res_url_index, error_code, error_msg, zip_index, net_speed, app_start_count, client_sys_time, zip_request_count, zip_down_state) if gw_resDownloadLogIsFinished() == true then return end local count_time = gw_resDownloadLogStartCount() if count_time <= 0 then return end gw_resDownloadLogSendData(2, time, per, downloaded_size, total_size, count_time, is_in_background, res_url_index, error_code, error_msg, zip_index, net_speed, app_start_count, client_sys_time, zip_request_count, zip_down_state) --print("gw_resDownloadLogTimer") end function gw_resDownloadLogEnd(time, per, downloaded_size, total_size, is_in_background, res_url_index, error_code, error_msg, zip_index, net_speed, app_start_count, client_sys_time, zip_request_count, zip_down_state) if gw_resDownloadLogIsFinished() == true then return end local count_time = gw_resDownloadLogStartCount() if count_time <= 0 then return end gw_resDownloadLogSendData(3, time, per, downloaded_size, total_size, count_time, is_in_background, res_url_index, error_code, error_msg, zip_index, net_speed, app_start_count, client_sys_time, zip_request_count, zip_down_state) cc.UserDefault:getInstance():setIntegerForKey("gw_zip_download_record_mark_finished", 1) cc.UserDefault:getInstance():flush() print("gw_resDownloadLogEnd") end function gw_resDownloadLogStartCount() return cc.UserDefault:getInstance():getIntegerForKey("gw_zip_download_record_mark_start", 0) end function gw_resDownloadLogIsFinished() if nil == GW_RES_DOWNLOAD_RECORD_URL then return end local zip_download_record_mark_finished = cc.UserDefault:getInstance():getIntegerForKey("gw_zip_download_record_mark_finished", 0) if zip_download_record_mark_finished == 1 then return true else return false end end --step:步骤 1开始下载;2下载中;3下载完成 --time:从开始下载开始计时,每经过1秒加1 --per:已下载百分比 --downloaded_size:已下载大小 --total_size:总下载大小 --is_in_background:是否切换到了后台(0否;1是) --res_url_index:当前下载的链接序号(从1开始) --error_code:错误码 --error_msg:错误信息 function gw_resDownloadLogSendData(step, pass_time, per, downloaded_size, total_size, start_count, is_in_background, res_url_index, error_code, error_msg, zip_index, net_speed, app_start_count, client_sys_time, zip_request_count, zip_down_state) --print(string.format("gw_resDownloadLogSendData(step:%s, pass_time:%s, per:%s, downloaded_size:%s, total_size:%s, start_count:%s)", step, pass_time, per, downloaded_size, total_size, start_count)) if nil == GW_RES_DOWNLOAD_RECORD_URL then return end local body = {} --body.ActionId = 14 body.Ver = GW_RES_DOWNLOAD_VER--(int)协议版本号 body.MachineCode = getIdFa()--(string)机器码 body.Channel = 1--(int)渠道:1谷歌;2官方;3IOS body.ClientVersion = 1--(int)客户端版本 body.Platform = 1--(int)平台:1android;2ios;3pc if device.isWifiState() == true then body.NetType = 1--(int)网络制式:wifi--1 else body.NetType = 2--(int)网络制式:数据--2 end body.Step = step or 1--(int)步骤 1开始下载;2下载中;3下载完成 body.StartCount = start_count--(int)重试下载次数(首次为1) body.PassTime = pass_time or 0--(int)从开始下载开始计时,经过的时间(秒)(开始下载为0) body.DownloadedSize = math.ceil(downloaded_size)--(int)已下载大小(byte)(开始下载为0) body.TotalSize = total_size--(int)总下载大小(Kb) body.IsInBg = is_in_background or 0--(int)是否切换到了后台(0否;1是) body.URLIndex = res_url_index or 1--(int)当前下载的链接序号(从1开始) body.ErrorCode = error_code or 0--(int)错误码 body.ErrorMsg = error_msg or ""--(string)错误信息(没有为:"") body.ZipIndex = zip_index--(int)当前下载的zip包序号 body.NetSpeed = net_speed--(int)当前下载速度(byte/秒) body.AppStartCount = app_start_count--(int)App启动次数 body.ClientSysTime = client_sys_time--(long)客户端时间戳(秒) body.ZipRequestCount = zip_request_count--(int)zip包下载请求次数 body.ZipDownState = zip_down_state--(int)zip包下载状态(0开始下载;1下载中;2下载完成;3开始解压;4解压中;5解压完成) local json_str = json.encode(body) print("gw_resDownloadLogSendData:"..json_str) local xhr = cc.XMLHttpRequest:new() xhr:setRequestHeader("Content-Type","application/json") xhr.responseType = cc.XMLHTTPREQUEST_RESPONSE_STRING xhr:open("POST", GW_RES_DOWNLOAD_RECORD_URL) xhr:registerScriptHandler(function() end) xhr:send(json_str) end GW_ZIP_URL_List = { {url="http://d28x6s2z20jppa.cloudfront.net/online_google_mianwen/online_google_mianwen_800", ver=100}, {url="https://d28x6s2z20jppa.cloudfront.net/online_google_mianwen/online_google_mianwen_800", ver=100}, } function gw_getZipURL(index) if GW_ZIP_URL_List[index] ~= nil then return GW_ZIP_URL_List[index].url, index else return GW_ZIP_URL_List[1].url, 1 end end -------新增打点20230515End----- GW_FORCE_PASS_FOREWORD = false --强制跳过序章 --新数据服 服务器列表 GW_NEW_CONFIG_SRV_ID_LIST = { "dev_49", "dev_50", "dev_51", "dev_52", "dev_53", "dev_54", "dev_55", "dev_56", "dev_57", "dev_58", "dev_59", "dev_60", "dev_61", "dev_62", "dev_63", "dev_64", "dev_65", "dev_66", "dev_67", "dev_68", "dev_69", "dev_70", "dev_71", "dev_72", "dev_73", "dev_74", "dev_75", "dev_76", "dev_77", "dev_78", "dev_79", "dev_80", "dev_81", "dev_82", "dev_83", "dev_84", "dev_85", "dev_86", "dev_87", "dev_88", "dev_89", "dev_90", "dev_91" } --新数据服 需要重新加载的配置列表 GW_NEW_CONFIG_FILE_LIST = { "config_new_data/battle_act_data", "config_new_data/dial_data", "config_new_data/drama_data", "config_new_data/dungeon_data", "config_new_data/dungeon_heaven_data", "config_new_data/exchange_data", "config_new_data/gift_data", "config_new_data/guild_dun_data", "config_new_data/guild_marketplace_data.lua", "config_new_data/holiday_sprite_lottery_data", "config_new_data/item_data1", "config_new_data/item_data2", "config_new_data/item_data6", "config_new_data/item_data9", "config_new_data/lev_gift_data", "config_new_data/misc_data", "config_new_data/partner_data", "config_new_data/partner_eqm_data", "config_new_data/partner_skin_data", "config_new_data/privilege_data", "config_new_data/skill_data", "config_new_data/skill_data1", "config_new_data/skill_data2", "config_new_data/skill_data3", "config_new_data/skill_data4", "config_new_data/skill_data6", "config_new_data/sprite_data", "config_new_data/star_tower_data", "config_new_data/training_camp_data", "config_new_data/unit_data1", "config_new_data/unit_data3", }