Merge branch 'dev' of http://git.juzugame.com/b6-client/b6-lua into dev
This commit is contained in:
commit
71eaaecb56
@ -659,6 +659,7 @@ function BIReport:postGemGet(num, getType, itemId)
|
|||||||
type = getType,
|
type = getType,
|
||||||
coin_num = num,
|
coin_num = num,
|
||||||
coin_type = BIReport.COIN_TYPE[itemId],
|
coin_type = BIReport.COIN_TYPE[itemId],
|
||||||
|
coin_all = DataManager.BagData.ItemData:getItemNumById(itemId),
|
||||||
}
|
}
|
||||||
self:report(EVENT_NAME_COIN_GET, args)
|
self:report(EVENT_NAME_COIN_GET, args)
|
||||||
end
|
end
|
||||||
|
|||||||
@ -2,12 +2,4 @@ local VersionCompatible = {}
|
|||||||
|
|
||||||
local CLIENT_VERSION = CS.BF.BFMain.CLIENT_VERSION or 0
|
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
|
return VersionCompatible
|
||||||
|
|||||||
@ -351,10 +351,10 @@ function First:requestAddress(callback, times, totalTimes)
|
|||||||
platform = "iOS"
|
platform = "iOS"
|
||||||
end
|
end
|
||||||
loginCenterUrl = loginCenterUrl .. "?platform=" .. CS.System.Uri.EscapeDataString(platform)
|
loginCenterUrl = loginCenterUrl .. "?platform=" .. CS.System.Uri.EscapeDataString(platform)
|
||||||
-- lua这边直接构建好参数
|
|
||||||
for k, v in pairs(args) do
|
for k, v in pairs(args) do
|
||||||
loginCenterUrl = loginCenterUrl .. "&" .. k .. "=" .. CS.System.Uri.EscapeDataString(v)
|
loginCenterUrl = loginCenterUrl .. "&" .. k .. "=" .. CS.System.Uri.EscapeDataString(v)
|
||||||
end
|
end
|
||||||
|
-- 最后增加一个随机参数规避网络缓存的问题,保证每次都是新的请求
|
||||||
local guid = CS.BF.BFMain.Instance.SDKMgr.BFLoginSDKMgr:GetNewPlayerGuid()
|
local guid = CS.BF.BFMain.Instance.SDKMgr.BFLoginSDKMgr:GetNewPlayerGuid()
|
||||||
loginCenterUrl = loginCenterUrl .. "&random=" .. CS.System.Uri.EscapeDataString(guid)
|
loginCenterUrl = loginCenterUrl .. "&random=" .. CS.System.Uri.EscapeDataString(guid)
|
||||||
CS.BF.BFMain.Instance.SDKMgr.BFLoginSDKMgr:GetWithURL(loginCenterUrl, function (req, rsp)
|
CS.BF.BFMain.Instance.SDKMgr.BFLoginSDKMgr:GetWithURL(loginCenterUrl, function (req, rsp)
|
||||||
|
|||||||
@ -399,71 +399,6 @@ if NOT_PUBLISH then
|
|||||||
Logger.printTable(map)
|
Logger.printTable(map)
|
||||||
end
|
end
|
||||||
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
|
end
|
||||||
|
|
||||||
Game._releaseOnApplicationFocus = Game.onApplicationFocus
|
Game._releaseOnApplicationFocus = Game.onApplicationFocus
|
||||||
|
|||||||
@ -380,28 +380,6 @@ function GFunc.getPerByW3(ratio)
|
|||||||
return ratio*0.0001
|
return ratio*0.0001
|
||||||
end
|
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)
|
function GFunc.getPerStr(key, str)
|
||||||
if key == GConst.BattleConst.BUFF_NAME.ATKP_ADD or
|
if key == GConst.BattleConst.BUFF_NAME.ATKP_ADD or
|
||||||
key == GConst.BattleConst.BUFF_NAME.ATKP_COLOR_ADD or
|
key == GConst.BattleConst.BUFF_NAME.ATKP_COLOR_ADD or
|
||||||
@ -600,17 +578,9 @@ function GFunc.showItemNotEnough(itemId)
|
|||||||
end
|
end
|
||||||
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)
|
function GFunc.checkCost(id, num, showToast, giftType)
|
||||||
if num <= 0 then
|
if num <= 0 then
|
||||||
-- BIReport:postDataException(id, num, giftType)
|
return true
|
||||||
-- return false
|
|
||||||
end
|
end
|
||||||
local count = DataManager.BagData.ItemData:getItemNumById(id)
|
local count = DataManager.BagData.ItemData:getItemNumById(id)
|
||||||
if count < num then
|
if count < num then
|
||||||
@ -623,14 +593,6 @@ function GFunc.checkCost(id, num, showToast, giftType)
|
|||||||
end
|
end
|
||||||
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)
|
function GFunc.addRewards(rewards, itemGetType)
|
||||||
if rewards == nil then
|
if rewards == nil then
|
||||||
@ -959,39 +921,27 @@ function GFunc.miningTipsMovePosY(obj, delay,callBack)
|
|||||||
end
|
end
|
||||||
|
|
||||||
function GFunc.dataEncrypt(data)
|
function GFunc.dataEncrypt(data)
|
||||||
if not VersionCompatible:supportDataEncryptVersion() then
|
|
||||||
return data
|
|
||||||
end
|
|
||||||
local numStr = CS.Security.XXTEA.Encrypt(tostring(data), GConst.SECRET_KEY)
|
local numStr = CS.Security.XXTEA.Encrypt(tostring(data), GConst.SECRET_KEY)
|
||||||
return numStr
|
return numStr
|
||||||
end
|
end
|
||||||
|
|
||||||
function GFunc.dataDecrypt(data)
|
function GFunc.dataDecrypt(data)
|
||||||
if not VersionCompatible:supportDataEncryptVersion() then
|
|
||||||
return data
|
|
||||||
end
|
|
||||||
local numStr = CS.Security.XXTEA.Decrypt(data, GConst.SECRET_KEY)
|
local numStr = CS.Security.XXTEA.Decrypt(data, GConst.SECRET_KEY)
|
||||||
return tonumber(numStr)
|
return tonumber(numStr)
|
||||||
end
|
end
|
||||||
|
|
||||||
function GFunc.getTickCount()
|
function GFunc.getTickCount()
|
||||||
if not VersionCompatible:supportDataEncryptVersion() then
|
|
||||||
return 0
|
|
||||||
end
|
|
||||||
return math.floor(UnityTime.realtimeSinceStartup)
|
return math.floor(UnityTime.realtimeSinceStartup)
|
||||||
end
|
end
|
||||||
|
|
||||||
function GFunc.IsGotServerTime()
|
function GFunc.IsGotServerTime()
|
||||||
if not VersionCompatible:supportDataEncryptVersion() then
|
|
||||||
return true
|
|
||||||
end
|
|
||||||
if not CS.BF.BFMain.IsGotServerTime then
|
if not CS.BF.BFMain.IsGotServerTime then
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
|
|
||||||
---得到展示奖励的图集名称,图片资源id
|
---得到展示奖励的图集名称,图片资源id
|
||||||
function GFunc.getFrameRes(type, id)
|
function GFunc.getFrameRes(type, id)
|
||||||
if type == GConst.REWARD_TYPE.REWARD_NONE then
|
if type == GConst.REWARD_TYPE.REWARD_NONE then
|
||||||
return
|
return
|
||||||
@ -1034,7 +984,7 @@ function GFunc.getFrameRes(type, id)
|
|||||||
return atlasPath, GConst.HERO_FRAME[ GConst.QUALITY[qlt] ] or "frame_1", qlt
|
return atlasPath, GConst.HERO_FRAME[ GConst.QUALITY[qlt] ] or "frame_1", qlt
|
||||||
end
|
end
|
||||||
|
|
||||||
---得到展示奖励的图集名称,图片资源id
|
---得到展示奖励的图集名称,图片资源id
|
||||||
function GFunc.getQuality(type, id)
|
function GFunc.getQuality(type, id)
|
||||||
if type == GConst.REWARD_TYPE.REWARD_NONE then
|
if type == GConst.REWARD_TYPE.REWARD_NONE then
|
||||||
return
|
return
|
||||||
@ -1084,7 +1034,7 @@ function GFunc.getQuality(type, id)
|
|||||||
return qlt
|
return qlt
|
||||||
end
|
end
|
||||||
|
|
||||||
---得到展示奖励的图集名称,图片资源id
|
---得到展示奖励的图集名称,图片资源id
|
||||||
function GFunc.getRewardIconRes(type, id)
|
function GFunc.getRewardIconRes(type, id)
|
||||||
if type == GConst.REWARD_TYPE.REWARD_NONE then
|
if type == GConst.REWARD_TYPE.REWARD_NONE then
|
||||||
return
|
return
|
||||||
@ -1143,7 +1093,7 @@ function GFunc.getLegacyIconRes(legacyId)
|
|||||||
return GConst.ATLAS_PATH.ICON_LEGACY, tostring(config.icon)
|
return GConst.ATLAS_PATH.ICON_LEGACY, tostring(config.icon)
|
||||||
end
|
end
|
||||||
|
|
||||||
---得到展示奖励的图集名称,图片资源id
|
---得到展示奖励的图集名称,图片资源id
|
||||||
function GFunc.getRewardName(type, id)
|
function GFunc.getRewardName(type, id)
|
||||||
if type == GConst.REWARD_TYPE.REWARD_NONE then
|
if type == GConst.REWARD_TYPE.REWARD_NONE then
|
||||||
return
|
return
|
||||||
@ -1162,23 +1112,6 @@ function GFunc.getRewardName(type, id)
|
|||||||
end
|
end
|
||||||
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)
|
function GFunc.compareVersionThan(version1, version2, include)
|
||||||
if not version1 or not version2 then
|
if not version1 or not version2 then
|
||||||
return false
|
return false
|
||||||
@ -1266,14 +1199,6 @@ function GFunc.getArray()
|
|||||||
return array
|
return array
|
||||||
end
|
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)
|
function GFunc.getTable(struct)
|
||||||
local t = {}
|
local t = {}
|
||||||
if struct then
|
if struct then
|
||||||
@ -1503,6 +1428,7 @@ function GFunc.getCalcMinVal(arr)
|
|||||||
end
|
end
|
||||||
return min
|
return min
|
||||||
end
|
end
|
||||||
|
|
||||||
---计算最大值
|
---计算最大值
|
||||||
function GFunc.getCalcMaxVal(arr)
|
function GFunc.getCalcMaxVal(arr)
|
||||||
local max = arr[1] or 0
|
local max = arr[1] or 0
|
||||||
@ -1588,14 +1514,6 @@ function GFunc.checkTableValueSame(standardTable, compareTable, debug)
|
|||||||
return true
|
return true
|
||||||
end
|
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)
|
function GFunc.showCurrencyFlyAction(rewards, pos)
|
||||||
local flyPos = {}
|
local flyPos = {}
|
||||||
if not pos then
|
if not pos then
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user