diff --git a/lua/app/common/bi_report.lua b/lua/app/common/bi_report.lua index 8bfe571f..927e70cf 100644 --- a/lua/app/common/bi_report.lua +++ b/lua/app/common/bi_report.lua @@ -659,6 +659,7 @@ function BIReport:postGemGet(num, getType, itemId) type = getType, coin_num = num, coin_type = BIReport.COIN_TYPE[itemId], + coin_all = DataManager.BagData.ItemData:getItemNumById(itemId), } self:report(EVENT_NAME_COIN_GET, args) end diff --git a/lua/app/common/version_compatible.lua b/lua/app/common/version_compatible.lua index 06e97373..4315a10f 100644 --- a/lua/app/common/version_compatible.lua +++ b/lua/app/common/version_compatible.lua @@ -2,12 +2,4 @@ local VersionCompatible = {} local CLIENT_VERSION = CS.BF.BFMain.CLIENT_VERSION or 0 -function VersionCompatible:canUpdateMailVersion() - return CLIENT_VERSION > 1 -end - -function VersionCompatible:supportDataEncryptVersion() - return CLIENT_VERSION > 1 -end - return VersionCompatible diff --git a/lua/app/first/first.lua b/lua/app/first/first.lua index 52f491a5..60e68266 100644 --- a/lua/app/first/first.lua +++ b/lua/app/first/first.lua @@ -351,10 +351,10 @@ function First:requestAddress(callback, times, totalTimes) platform = "iOS" end loginCenterUrl = loginCenterUrl .. "?platform=" .. CS.System.Uri.EscapeDataString(platform) - -- lua这边直接构建好参数 for k, v in pairs(args) do loginCenterUrl = loginCenterUrl .. "&" .. k .. "=" .. CS.System.Uri.EscapeDataString(v) end + -- 最后增加一个随机参数规避网络缓存的问题,保证每次都是新的请求 local guid = CS.BF.BFMain.Instance.SDKMgr.BFLoginSDKMgr:GetNewPlayerGuid() loginCenterUrl = loginCenterUrl .. "&random=" .. CS.System.Uri.EscapeDataString(guid) CS.BF.BFMain.Instance.SDKMgr.BFLoginSDKMgr:GetWithURL(loginCenterUrl, function (req, rsp) diff --git a/lua/app/game.lua b/lua/app/game.lua index 8d612628..2625711b 100644 --- a/lua/app/game.lua +++ b/lua/app/game.lua @@ -399,71 +399,6 @@ if NOT_PUBLISH then Logger.printTable(map) end end - - -- if Input.GetKeyDown(KeyCode.P) then - -- ModuleManager.ChapterManager:showBattleFailUI(nil, true) - -- end - -- if Input.GetKeyDown(KeyCode.G) then - -- ModuleManager.BattleManager:playBattle(ModuleManager.BattleManager.BATTLE_TYPE.DUNGEON_GOLD, {id = 1, level = 1}, function() - -- UIManager:closeAllUI() - -- ModuleManager.MaincityManager:showMainCityUI() - -- ModuleManager.BattleManager:playBattle(ModuleManager.BattleManager.BATTLE_TYPE.STAGE) - -- end) - -- end - -- if Input.GetKeyDown(KeyCode.H) then - -- ModuleManager.BattleManager:playBattle(ModuleManager.BattleManager.BATTLE_TYPE.DUNGEON_GEM, {id = 2, level = 1}, function() - -- UIManager:closeAllUI() - -- ModuleManager.MaincityManager:showMainCityUI() - -- ModuleManager.BattleManager:playBattle(ModuleManager.BattleManager.BATTLE_TYPE.STAGE) - -- end) - -- end - -- if Input.GetKeyDown(KeyCode.J) then - -- ModuleManager.BattleManager:playBattle(ModuleManager.BattleManager.BATTLE_TYPE.DUNGEON_MITHRIL, {id = 3, level = 1}, function() - -- UIManager:closeAllUI() - -- ModuleManager.MaincityManager:showMainCityUI() - -- ModuleManager.BattleManager:playBattle(ModuleManager.BattleManager.BATTLE_TYPE.STAGE) - -- end) - -- end - -- if Input.GetKeyDown(KeyCode.K) then - -- -- ModuleManager.BattleManager:playBattle(ModuleManager.BattleManager.BATTLE_TYPE.DUNGEON_ARENA, {id = 4, level = 23}, function() - -- -- UIManager:closeAllUI() - -- -- ModuleManager.MaincityManager:showMainCityUI() - -- -- ModuleManager.BattleManager:playBattle(ModuleManager.BattleManager.BATTLE_TYPE.STAGE) - -- -- end) - - -- local resultParams = { - -- level = 24, - -- score = 600000, - -- lastRank = 1, - -- newRank = 2, - -- rewards = { - -- [1] = { - -- type = 2, - -- equip = { - -- level = 0, - -- id = 10201, - -- count = 1 - -- } - -- }, - -- } - -- } - -- ModuleManager.ArenaManager:showBattleResultUI(resultParams) - -- end - -- if Input.GetKeyDown(KeyCode.K) then - -- DataManager.ArenaData:refreshSelectLegacy() - -- ModuleManager.ArenaManager:showBattleSelectLegacyUI() - -- end - - -- if EDITOR_MODE then - -- if Input.GetKeyDown(KeyCode.N) and Input.GetKey(KeyCode.RightControl) then - -- EventManager:dispatchEvent(EventManager.CUSTOM_EVENT.TRAIN_PASS_UP, {toId = 50}) -- 表现事件 - -- EventManager:dispatchEvent(EventManager.CUSTOM_EVENT.CHANGE_MAIN_CITY_PAGE, {page = 0}) - -- end - -- if Input.GetKeyDown(KeyCode.M) and Input.GetKey(KeyCode.RightControl) then - -- EventManager:dispatchEvent(EventManager.CUSTOM_EVENT.TRAIN_REBORN) -- 表现事件 - -- EventManager:dispatchEvent(EventManager.CUSTOM_EVENT.CHANGE_MAIN_CITY_PAGE, {page = 0}) - -- end - -- end end Game._releaseOnApplicationFocus = Game.onApplicationFocus diff --git a/lua/app/global/global_func.lua b/lua/app/global/global_func.lua index fe160aec..e3706260 100644 --- a/lua/app/global/global_func.lua +++ b/lua/app/global/global_func.lua @@ -380,28 +380,6 @@ function GFunc.getPerByW3(ratio) return ratio*0.0001 end --- function GFunc.getRoundingNumByW(num) --- if num <= 0 then --- return 0 --- end --- if num < 10000 then --- return GFunc.getRoundingNumByW(num*100) // 100 --- end --- local remainder = num%10000 --- if remainder < 5000 then --- return num - remainder --- elseif remainder > 5000 then --- return num - remainder + 10000 --- else --- local integer = (num - remainder)*0.0001 --- if integer%2 == 0 then --- return num - remainder --- else --- return num - remainder + 10000 --- end --- end --- end - function GFunc.getPerStr(key, str) if key == GConst.BattleConst.BUFF_NAME.ATKP_ADD or key == GConst.BattleConst.BUFF_NAME.ATKP_COLOR_ADD or @@ -600,17 +578,9 @@ function GFunc.showItemNotEnough(itemId) end end -function GFunc.showJewelryNotEnough(itemId) - local gemTextInfo = I18N:getConfig("jewelry")[itemId] - if gemTextInfo then - GFunc.showToast(I18N:getGlobalText(I18N.GlobalConst.ITEM_NOT_ENOUGH, gemTextInfo.name)) - end -end - function GFunc.checkCost(id, num, showToast, giftType) if num <= 0 then - -- BIReport:postDataException(id, num, giftType) - -- return false + return true end local count = DataManager.BagData.ItemData:getItemNumById(id) if count < num then @@ -623,14 +593,6 @@ function GFunc.checkCost(id, num, showToast, giftType) end end -function GFunc.checkCostNum(id, num, giftType) - if num <= 0 then - -- BIReport:postDataException(id, num, giftType) - return false - end - return true -end - ---- 获得奖励的统一接口 function GFunc.addRewards(rewards, itemGetType) if rewards == nil then @@ -959,39 +921,27 @@ function GFunc.miningTipsMovePosY(obj, delay,callBack) end function GFunc.dataEncrypt(data) - if not VersionCompatible:supportDataEncryptVersion() then - return data - end local numStr = CS.Security.XXTEA.Encrypt(tostring(data), GConst.SECRET_KEY) return numStr end function GFunc.dataDecrypt(data) - if not VersionCompatible:supportDataEncryptVersion() then - return data - end local numStr = CS.Security.XXTEA.Decrypt(data, GConst.SECRET_KEY) return tonumber(numStr) end function GFunc.getTickCount() - if not VersionCompatible:supportDataEncryptVersion() then - return 0 - end return math.floor(UnityTime.realtimeSinceStartup) end function GFunc.IsGotServerTime() - if not VersionCompatible:supportDataEncryptVersion() then - return true - end if not CS.BF.BFMain.IsGotServerTime then return false end return true end ----得到展示奖励的图集名称,图片资源id +---得到展示奖励的图集名称,图片资源id function GFunc.getFrameRes(type, id) if type == GConst.REWARD_TYPE.REWARD_NONE then return @@ -1034,7 +984,7 @@ function GFunc.getFrameRes(type, id) return atlasPath, GConst.HERO_FRAME[ GConst.QUALITY[qlt] ] or "frame_1", qlt end ----得到展示奖励的图集名称,图片资源id +---得到展示奖励的图集名称,图片资源id function GFunc.getQuality(type, id) if type == GConst.REWARD_TYPE.REWARD_NONE then return @@ -1084,7 +1034,7 @@ function GFunc.getQuality(type, id) return qlt end ----得到展示奖励的图集名称,图片资源id +---得到展示奖励的图集名称,图片资源id function GFunc.getRewardIconRes(type, id) if type == GConst.REWARD_TYPE.REWARD_NONE then return @@ -1143,7 +1093,7 @@ function GFunc.getLegacyIconRes(legacyId) return GConst.ATLAS_PATH.ICON_LEGACY, tostring(config.icon) end ----得到展示奖励的图集名称,图片资源id +---得到展示奖励的图集名称,图片资源id function GFunc.getRewardName(type, id) if type == GConst.REWARD_TYPE.REWARD_NONE then return @@ -1162,23 +1112,6 @@ function GFunc.getRewardName(type, id) end end - -function GFunc.performDurationDelay(obj, delay, callback) - if obj.sequence then - obj.sequence:Kill() - obj.sequence = nil - end - local sequence = obj:createBindTweenSequence() - delay = delay or 0 - delay = math.max(0, delay) - obj.sequence = sequence - - sequence:AppendInterval(delay or 0) - sequence:OnComplete(callback) - - return sequence -end - function GFunc.compareVersionThan(version1, version2, include) if not version1 or not version2 then return false @@ -1266,14 +1199,6 @@ function GFunc.getArray() return array end -function GFunc.showProbability() - local language = I18N:getCurLanguage() - if language == "ko" or language == "ja" then - return true - end - return false -end - function GFunc.getTable(struct) local t = {} if struct then @@ -1503,6 +1428,7 @@ function GFunc.getCalcMinVal(arr) end return min end + ---计算最大值 function GFunc.getCalcMaxVal(arr) local max = arr[1] or 0 @@ -1588,14 +1514,6 @@ function GFunc.checkTableValueSame(standardTable, compareTable, debug) return true end --- 获取挖矿研究得到的属性加成 -function GFunc.getMainHeroAttributeVal(key) - local mainEntity = DataManager.HeroData:getMainHeroEntity() - local allAttr = mainEntity:getAllAttr() - local result = allAttr[key] - return result -end - function GFunc.showCurrencyFlyAction(rewards, pos) local flyPos = {} if not pos then