This commit is contained in:
puxuan 2025-09-28 20:04:42 +08:00
parent 0736e58c5f
commit 9a9254de99
21 changed files with 2356 additions and 1028 deletions

View File

@ -308,6 +308,9 @@ BIReport.GIFT_TYPE = {
SHOP_GEM = "shop_gem",
SHOP_GOLD = "shop_gold",
-- SHOP_EMBLEM = "shop_emblem",
-- 高级战令
BOUNTY_PRO_REWARD = "bounty_pro_reward",
}
BIReport.COIN_TYPE = {
@ -399,6 +402,15 @@ BIReport.ACT_SPRINT_TYPE = {
TREE = "Tree",
}
BIReport.VIDEO_AD_OPT_TYPE = {
CLICK = "click",
PLAY_SUCCESS = "play_success",
PLAY_FAIL = "play_fail",
GET_REWARD = "get_reward",
LOAD_RUSULT = "load_result",
GET_REWARD_SKIP_AD = "get_reward_skip_ad",
}
-- b6
local EVENT_NAME_EXIT = "client_exit"
local EVENT_NAME_FIGHT = "client_fight"
@ -431,6 +443,7 @@ local EVENT_NAME_MISCELLANEOUS_OPT = "event_name_miscellaneous_opt" -- 一些杂
local EVENT_BOX_OPEN = "client_box_open"
local EVENT_ACT_OPT = "client_act_opt"
local EVENT_NAME_RUNES = "client_runes"
local EVENT_NAME_PAY_ORDER_REPEAT = "client_pay_order_repeat"
BIReport.TASK_OPT = {
TASK_REWARD = "TaskReward",
@ -472,6 +485,51 @@ function BIReport:clearAccountId()
CS.BF.BFMain.Instance.SDKMgr.BFThirdReportSDKMgr:ClearThinkingAnalyticsAccountId()
end
function BIReport:TAUserAdd(args)
-- 测试包和编辑器模式不上报
if not Platform:getIsPublishChannel() or EDITOR_MODE then
self:printArgsStr("TAUserAdd", args)
return
end
-- 审核/白名单模式不上报
if CS.BF.BFMain.IsShenhe or CS.BF.BFMain.IsWhite then
return
end
if args and type(args) == "table" then
CS.ThinkingAnalytics.ThinkingAnalyticsAPI.UserAdd(args)
end
end
function BIReport:TAUserSet(args)
-- 测试包和编辑器模式不上报报
if not Platform:getIsPublishChannel() or EDITOR_MODE then
self:printArgsStr("TAUserSet", args)
return
end
-- 审核/白名单模式不上报
if CS.BF.BFMain.IsShenhe or CS.BF.BFMain.IsWhite then
return
end
if args and type(args) == "table" then
CS.ThinkingAnalytics.ThinkingAnalyticsAPI.UserSet(args)
end
end
function BIReport:TAUserSetOnce(args)
-- 测试包和编辑器模式不上报报
if not Platform:getIsPublishChannel() or EDITOR_MODE then
self:printArgsStr("TAUserSetOnce", args)
return
end
-- 审核/白名单模式不上报
if CS.BF.BFMain.IsShenhe or CS.BF.BFMain.IsWhite then
return
end
if args and type(args) == "table" then
CS.ThinkingAnalytics.ThinkingAnalyticsAPI.UserSetOnce(args)
end
end
function BIReport:report(name, args)
self:printArgsStr(name, args)
-- 内网dev包和编辑器模式不上报
@ -897,6 +955,52 @@ function BIReport:postFirstRechargeEvent(id)
CS.BF.BFMain.Instance.SDKMgr.BFLoginSDKMgr.FBSdk:LogAppEvent("fb_package_" .. cfg.price, json.encode(args))
end
function BIReport:postRechargeEvent(id)
-- 只有外网正式渠道真机包才上报
if not Platform:getIsPublishChannel() or EDITOR_MODE then
return
end
-- 审核/白名单模式不上报
if CS.BF.BFMain.IsShenhe or CS.BF.BFMain.IsWhite then
return
end
local postRechargeID = {
[3] = true, -- 2.99
[5] = true, -- 4.99
[10] = true, -- 9.99
[13] = true, -- 19.99
[15] = true, -- 29.99
[16] = true, -- 49.99
}
if not postRechargeID[id] then
return
end
local cfg = ConfigManager:getConfig("recharge")[id]
if not cfg then
return
end
self:postFirebaseLog("gg_package_" .. cfg.price, {})
end
function BIReport:postPurchaseAmountEvent(postAmount)
-- 只有外网正式渠道真机包才上报
if not Platform:getIsPublishChannel() or EDITOR_MODE then
return
end
-- 审核/白名单模式不上报
if CS.BF.BFMain.IsShenhe or CS.BF.BFMain.IsWhite then
return
end
if postAmount == 1 then
self:postFirebaseLog("purchase_1", {})
CS.BF.BFMain.Instance.SDKMgr.BFThirdReportSDKMgr:PostAppsflyerEvent("purchase_1", json.encode({}))
end
if postAmount == 5 then
self:postFirebaseLog("purchase_5", {})
CS.BF.BFMain.Instance.SDKMgr.BFThirdReportSDKMgr:PostAppsflyerEvent("purchase_5", json.encode({}))
end
end
-- 上报24小时内部分章节第一次失败的用户
function BIReport:postFirstDayGradeFailEvent(chapterId)
-- 只有外网正式渠道真机包才上报
@ -1351,91 +1455,172 @@ function BIReport:postAdRewardGet(adsType)
self:report(EVENT_NAME_AD_OPT, args)
end
-- 支付sdk初始化成功
function BIReport:postPayInitSuccess()
-- 支付sdk初始化状态
function BIReport:postPayInitStatus(optType, desc)
local args = {
event_type = BIReport.PAY_OPT_TYPE.INIT_SUC,
opt_type = optType,
desc = desc or GConst.EMPTY_STRING,
}
self:report(EVENT_NAME_PAY_OPT, args)
end
-- 支付sdk初始化失败
function BIReport:postPayInitFailed(failedDesc)
-- 创建订单
function BIReport:postPayCreateOrder(giftType, id, rechargeId, uuid, isFromBattle, purchaseType)
local args = {
pay_failed_desc = failedDesc or GConst.EMPTY_STRING,
event_type = BIReport.PAY_OPT_TYPE.INIT_FAILED,
opt_type = BIReport.PAY_OPT_TYPE.CREATE_ORDER,
gift_type = giftType,
commodity_id = id,
uuid_string = uuid,
recharge_id = rechargeId,
from_battle = isFromBattle,
purchase_type = purchaseType,
}
self:report(EVENT_NAME_PAY_OPT, args)
end
-- 点击商品购买按钮
function BIReport:postPayClick(giftType, id, rechargeId)
function BIReport:postPayClick(giftType, id, rechargrId, payDouble, isFromBattle, purchaseType)
-- Commodity_ID 商品ID 点击商品按钮时 String 商品ID
-- Commodity_State 商品状态 String Normal=正常Doubled=奖励翻倍
-- IsNew 是否是新用户 Boolean 是否为当天新用户True = 是False = 否
local args = {
opt_type = BIReport.PAY_OPT_TYPE.CLICK,
gift_type = giftType,
commodity_id = id,
recharge_id = rechargeId,
event_type = BIReport.PAY_OPT_TYPE.CLICK,
commodity_state = payDouble,
recharge_id = rechargrId,
from_battle = isFromBattle,
purchase_type = purchaseType,
}
self:report(EVENT_NAME_PAY_OPT, args)
end
-- 跳转购买界面
function BIReport:postPayTurn(giftType, id, rechargeId)
function BIReport:postPayTurn(giftType, id, rechargrId, payDouble, isFromBattle, purchaseType)
-- Commodity_ID 商品ID 跳转到支付界面时 String 商品ID
-- Commodity_State 商品状态 String Normal=正常Doubled=奖励翻倍
-- IsNew 是否是新用户 Boolean 是否为当天新用户True = 是False = 否
local args = {
opt_type = BIReport.PAY_OPT_TYPE.BUY,
gift_type = giftType,
commodity_id = id,
recharge_id = rechargeId,
event_type = BIReport.PAY_OPT_TYPE.BUY,
commodity_state = payDouble,
recharge_id = rechargrId,
from_battle = isFromBattle,
purchase_type = purchaseType,
}
self:report(EVENT_NAME_PAY_OPT, args)
end
-- 取消购买
function BIReport:postPayCancel(productId, orderId, rechargeId, giftType, id)
function BIReport:postPayCancel(productId, orderId, rechargeId, giftType, giftId, isFromBattle, purchaseType)
local args = {
pay_product_id = productId,
pay_order_id = orderId,
opt_type = BIReport.PAY_OPT_TYPE.CANCEL,
product_id = productId,
order_id = orderId,
recharge_id = rechargeId,
gift_type = giftType,
commodity_id = id,
event_type = BIReport.PAY_OPT_TYPE.CANCEL,
commodity_id = giftId,
from_battle = isFromBattle,
purchase_type = purchaseType
}
self:report(EVENT_NAME_PAY_OPT, args)
end
-- 购买失败
function BIReport:postPayFailed(productId, orderId, rechargeId, failedType, giftType, id)
function BIReport:postPayFailed(productId, orderId, rechargeId, failedType, giftType, giftId, isFromBattle, purchaseType)
local args = {
pay_product_id = productId,
pay_order_id = orderId,
opt_type = BIReport.PAY_OPT_TYPE.FAILED,
product_id = productId,
order_id = orderId,
recharge_id = rechargeId,
pay_failed_type = failedType,
failed_type = failedType,
gift_type = giftType,
commodity_id = id,
event_type = BIReport.PAY_OPT_TYPE.FAILED,
commodity_id = giftId,
from_battle = isFromBattle,
purchase_type = purchaseType
}
self:report(EVENT_NAME_PAY_OPT, args)
end
-- -- 获得购买物品
function BIReport:postPayGet(giftType, id, rechargeId, orderId, originOrderId, buyNum, rewards)
-- 未完成订单
function BIReport:postPayResendOrder(productId, orderId)
local args = {
opt_type = BIReport.PAY_OPT_TYPE.RESEND,
product_id = productId,
order_id = orderId
}
self:report(EVENT_NAME_PAY_OPT, args)
end
-- 消耗订单
function BIReport:postPayConsumeOrder(productId, debugInfo)
local args = {
opt_type = BIReport.PAY_OPT_TYPE.CONSUME,
product_id = productId,
debug_info = debugInfo
}
self:report(EVENT_NAME_PAY_OPT, args)
end
function BIReport:postPayDoUncompleteOrder(productId, transactionID, orderId)
local args = {
opt_type = BIReport.PAY_OPT_TYPE.UNCOMPLETEORDER,
product_id = productId,
transaction_id = transactionID,
orderId = orderId
}
self:report(EVENT_NAME_PAY_OPT, args)
end
-- 本地找不到信息,尝试向服务器请求补单(IOS专用)
function BIReport:postPayTryReissueOrder(productId, orderId)
local args = {
opt_type = BIReport.PAY_OPT_TYPE.TRY_REISSUE_ORDER,
product_id = productId,
order_id = orderId,
platform = VersionCompatible:getPayPlatform(),
-- streamer = PayManager:getPayStreamer()
}
self:report(EVENT_NAME_PAY_OPT, args)
end
-- 获得购买物品
function BIReport:postPayGet(giftType, id, rechargrId, payDouble, orderId, originOrderId, buyNum, rewards, isFromBattle, isDaiJinJuan, purchaseType)
-- Commodity_ID 商品ID 获得支付回调发放购买物品时 String 商品ID
-- GiftType 礼包类型 String Gife表内的ICON名称
-- BuyNum 购买次数 Int 购买物品次数
-- CommodityItem 奖励物品 String 获得奖类型|数量
-- Dill_ID 返回物品订单号 String 返回货品订单号
-- MaxChapter 最大章节 Int 已解锁的最大章节
-- Commodity_State 商品状态 String Normal=正常Doubled=奖励翻倍
-- IsNew 是否是新用户 Boolean 是否为当天新用户True = 是False = 否
payDouble = payDouble or BIReport.PAY_DOUBLE.NORMAL
local itemStr = GFunc.getRewardsStr(rewards)
local args = {
opt_type = BIReport.PAY_OPT_TYPE.REWARD,
gift_type = giftType,
commodity_id = id,
buy_num = buyNum,
origin_order_id = tostring(originOrderId),
recharge_id = rechargeId,
event_type = BIReport.PAY_OPT_TYPE.REWARD,
commodity_state = payDouble,
commodity_item = itemStr,
buy_count = buyNum,
uuid_string = orderId,
origin_order_id_new = tostring(originOrderId),
recharge_id = rechargrId,
from_battle = isFromBattle,
dai_jin_juan_pay = isDaiJinJuan,
purchase_type = purchaseType,
platform = VersionCompatible:getPayPlatform(),
}
if GFunc.isShenhe() then
args.event_type = BIReport.PAY_OPT_TYPE.APPLE_REVIEW_REWARD
args.opt_type = BIReport.PAY_OPT_TYPE.APPLE_REVIEW_REWARD
elseif GFunc.isInWhitelist() then
args.event_type = BIReport.PAY_OPT_TYPE.WHITELIST_REWARD
args.opt_type = BIReport.PAY_OPT_TYPE.WHITELIST_REWARD
end
self:report(EVENT_NAME_PAY_OPT, args)
if EDITOR_MODE then
if not giftType or not id or not rechargeId then
if not giftType or not id or not rechargrId then
local params = {
content = "BI Report postPayGet has no basic params",
boxType = GConst.MESSAGE_BOX_TYPE.MB_OK,
@ -1447,6 +1632,25 @@ function BIReport:postPayGet(giftType, id, rechargeId, orderId, originOrderId, b
end
end
-- 重复订单
function BIReport:postRepeatPayOrder(productId, originOrderId, orderId, isFromBattle)
local args = {
product_id = productId,
origin_order_id = tostring(originOrderId),
order_id = orderId,
from_battle = isFromBattle
}
self:report(EVENT_NAME_PAY_ORDER_REPEAT, args)
end
function BIReport:postPayUIShow(giftType, giftId)
local args = {
gift_type = giftType,
commodity_id = giftId,
}
self:report(EVENT_NAME_PAY_UI_SHOW, args)
end
-- 登录成功
function BIReport:postAccountLoginFinish(loginType)
local args = {
@ -1628,17 +1832,6 @@ function BIReport:postPlayerLvUp(fromLevel, toLevel)
self:report(EVENT_NAME_PLAYER_LV_UP, args)
end
-- 内购相关界面展示,包括弹出/主动打开(如果是打开商城页签,钻石礼包只上报id2,章节礼包只上报首个可购买章节id)
-- giftType为BIReport.GIFT_TYPE
function BIReport:postPayUIShow(giftType, giftId, showType)
local args = {
gift_type = giftType,
commodity_id = giftId,
show_type = showType
}
self:report(EVENT_NAME_PAY_UI_SHOW, args)
end
function BIReport:postBountyLevelUp(bountyType, level, exp, season)
local args = {
event_type = BIReport.BOUNTY_OPT_TYPE.BOUNTY_LEVEL_UP,

View File

@ -139,6 +139,9 @@ function DataManager:initWithServerData(data)
self.BagData:init(data.bag)
self.TutorialData:init(data.guide)
self.MailData:init(data.mail_info)
self.PaymentData:initData(data.stat)
self.PaymentData:initActGift(data.gift)
-- self.BountyData:init(data.bounty)
self.ArenaBountyData:init(data.arena_bounty)
self.ArenaData:initGiftInfo(data.act_arena_gift, true)
@ -314,11 +317,10 @@ function DataManager:scheduleGlobal()
end
end
if Time:getServerTime() > self.crossDayTS and GFunc.IsGotServerTime() then
if Time:getServerTime() > self.crossDayTS then
self.crossDayTS = Time:getDayOverTimeStamp()
self.weekOverTime = Time:getWeekOverTimeStamp()
self.monthOverTime = Time:getMonthOverTimeStamp()
self.loginCount = self.loginCount + 1
-- 跨天先刷新活动时间
DataManager.ActTimeData:refreshActTime(true)
Logger.logHighlight("跨天===========================================================================")

View File

@ -32,10 +32,21 @@ PayManager.PURCHARSE_ACT_TYPE = {
-- RUNES_GIFT = 21,
-- TOURN_WAVE_GIFT = 23,
-- TOURN_ARENA_GIFT = 24,
BOUNTY = 3,
GIFT_POP_CHAPTER = 10, -- 章节礼包
ACT_COMMON = 11,-- 活动礼包通用11,具体礼包类型使用activity表中的act_type
ACT_SEVEN_DAY = 15, -- 七天乐
}
PayManager.ACT_COMMON_TYPE = {
-- ACT_SUMMON_HERO_GIFT = 1,
ACT_SPRINT_SUMMON_GIFT = 2,
-- ACT_SPRINT_BOX_GIFT = 3,
-- ACT_SPRINT_SUMMON_GIFT_V2 = 4,
-- ACT_SPRINT_BOX_GIFT_V2 = 5,
-- ACT_SPRINT_TREE_GIFT = 6,
}
PayManager.PURCHARSE_TYPE_CONFIG = {
[PayManager.PURCHARSE_TYPE.ACT_GIFT] = "act_gift",
[PayManager.PURCHARSE_TYPE.SHOP_GEM] = "mall_treasure",
@ -45,7 +56,9 @@ PayManager.PURCHARSE_TYPE_CONFIG = {
PayManager.BI_ITEM_GET_TYPE = {
[PayManager.PURCHARSE_TYPE.ACT_GIFT] = {
[PayManager.PURCHARSE_ACT_TYPE.BOUNTY] = BIReport.ITEM_GET_TYPE.BOUNTY,
[PayManager.PURCHARSE_ACT_TYPE.GIFT_POP_CHAPTER] = BIReport.ITEM_GET_TYPE.GIFT_POP_CHAPTER,
[PayManager.PURCHARSE_ACT_TYPE.ACT_COMMON] = {},
-- [PayManager.PURCHARSE_ACT_TYPE.FIRST_RECHARGE] = BIReport.ITEM_GET_TYPE.FIRST_RECHARGE,
-- [PayManager.PURCHARSE_ACT_TYPE.COIN_GIFT] = BIReport.ITEM_GET_TYPE.COIN_GIFT,
-- [PayManager.PURCHARSE_ACT_TYPE.INTRODUCTORY_GIFT] = BIReport.ITEM_GET_TYPE.INTRODUCTORY_GIFT,
@ -76,7 +89,9 @@ PayManager.BI_ITEM_GET_TYPE = {
PayManager.BI_GIFT_TYPE = {
[PayManager.PURCHARSE_TYPE.ACT_GIFT] = {
[PayManager.PURCHARSE_ACT_TYPE.BOUNTY] = BIReport.GIFT_TYPE.BOUNTY_PRO_REWARD,
[PayManager.PURCHARSE_ACT_TYPE.GIFT_POP_CHAPTER] = BIReport.GIFT_TYPE.GIFT_POP_CHAPTER,
[PayManager.PURCHARSE_ACT_TYPE.ACT_COMMON] = {},
-- [PayManager.PURCHARSE_ACT_TYPE.FIRST_RECHARGE] = BIReport.GIFT_TYPE.FIRST_RECHARGE,
-- [PayManager.PURCHARSE_ACT_TYPE.COIN_GIFT] = BIReport.GIFT_TYPE.COIN_GIFT,
-- [PayManager.PURCHARSE_ACT_TYPE.INTRODUCTORY_GIFT] = BIReport.GIFT_TYPE.INTRODUCTORY_GIFT,
@ -105,6 +120,35 @@ PayManager.BI_GIFT_TYPE = {
[PayManager.PURCHARSE_TYPE.SHOP_GEM] = BIReport.GIFT_TYPE.SHOP_GEM,
}
function PayManager:getActCommonTypeByActId(id)
local actType
local cfg = ConfigManager:getConfig("activity")
for actId, info in pairs(cfg) do
local actGiftIds = info.act_gift
if actGiftIds then
for _, giftId in ipairs(actGiftIds) do
if giftId == id then
actType = info.act_type
break
end
end
end
end
-- 一些特殊活动特殊处理
if actType == nil then
local cfg = ConfigManager:getConfig("act_bounty")
for actId, info in pairs(cfg) do
if id == info.reward_pro_pay and info.activity then
local cfg = ConfigManager:getConfig("activity")[info.activity]
if cfg and cfg.act_type then
actType = cfg.act_type
end
end
end
end
return actType
end
function PayManager:getItemGetType(purchaseType, id)
local cfgName = PayManager.PURCHARSE_TYPE_CONFIG[purchaseType]
if not cfgName then
@ -117,7 +161,15 @@ function PayManager:getItemGetType(purchaseType, id)
end
local subType = cfg[id].type
if subType then
if subType == PayManager.PURCHARSE_ACT_TYPE.ACT_COMMON then
local commonType = self:getActCommonTypeByActId(id)
if commonType then
return typeMap[cfg[id].type][commonType]
end
return
else
return typeMap[cfg[id].type]
end
else
if type(typeMap) ~= "table" then
return typeMap
@ -137,7 +189,15 @@ function PayManager:getGiftType(purchaseType, id)
end
local subType = cfg[id].type
if subType then
if subType == PayManager.PURCHARSE_ACT_TYPE.ACT_COMMON then
local commonType = self:getActCommonTypeByActId(id)
if commonType then
return typeMap[cfg[id].type][commonType]
end
return
else
return typeMap[cfg[id].type]
end
else
if type(typeMap) ~= "table" then
return typeMap
@ -169,7 +229,8 @@ function PayManager:getPackageRechargeId(purchaseType, id)
return cfg[id].recharge_id
end
function PayManager:purchasePackage(id, purchaseType)
function PayManager:purchasePackage(id, purchaseType, freeShowRewards, doubleType, isFromBattle)
local isFromBattle = isFromBattle or false -- 标记是否是战斗中购买
local cfgName = PayManager.PURCHARSE_TYPE_CONFIG[purchaseType]
if not cfgName then
return
@ -187,62 +248,213 @@ function PayManager:purchasePackage(id, purchaseType)
if rechargeCfg == nil then
return
end
productId = rechargeCfg.payId
BIReport:postPayClick(giftType, id, rechargeId)
productId = rechargeCfg[VersionCompatible:getRechargePayId()]
BIReport:postPayClick(giftType, id, rechargeId, doubleType, isFromBattle, purchaseType)
self:showPayselectUI(rechargeId, function(useDaiJinJuan)
if not useDaiJinJuan then
self:checkAndPay(productId, id, purchaseType, rechargeId, doubleType, freeShowRewards, isFromBattle)
else
self:reqGiftPay(productId, id, purchaseType, rechargeId, doubleType, freeShowRewards, isFromBattle, true)
end
end)
else
self:checkAndPay(productId, id, purchaseType, rechargeId, doubleType, freeShowRewards, isFromBattle)
end
self:checkAndPay(productId, id, purchaseType, rechargeId)
end
function PayManager:requestRewards(purchaseToken, orderId, originOrderId, productId, notShowRewardsBox, callback)
self:sendMsgToServer(purchaseToken, orderId, originOrderId, productId, function(binder, msgData)
if msgData.status == 0 then
function PayManager:requestRewards(purchaseToken, orderId, originOrderId, productId, notShowRewardsBox, callback, cmdId, payDouble, isFromBattle, isSpecialOrder, wayCode)
local args = SDKManager:getPurchaseArgs(purchaseToken, orderId, originOrderId, productId)
if isSpecialOrder then
args = SDKManager:getPurchaseArgs2(purchaseToken, orderId, originOrderId, productId)
end
self:sendMessage(ProtoMsgType.FromMsgEnum.GiftPaidResultReq, args, function(binder, result)
if result.err_code ~= GConst.ERROR_STR.SUCCESS then
if result.status == 1008 then -- 重复订单,消耗此订单
if CS.UnityEngine.Application.platform == CS.UnityEngine.RuntimePlatform.Android then
if purchaseToken then
SDKManager:consumePurchase(purchaseToken)
end
elseif CS.UnityEngine.Application.platform == CS.UnityEngine.RuntimePlatform.IPhonePlayer then
if productId then
SDKManager:consumePurchase(productId, nil, "repeat consume")
SDKManager:delIosOrder(productId)
end
if originOrderId ~= "gm" then
SDKManager:delIosPayInfo(originOrderId)
end
else
if purchaseToken then
SDKManager:consumePurchase(purchaseToken)
end
end
Logger.logError("重复验证")
BIReport:postRepeatPayOrder(productId, originOrderId, orderId, isFromBattle)
if callback then
callback(false)
end
elseif result.status == 1003 then -- 订单异常
local params = {
content = I18N:getGlobalText(I18N.GlobalConst.PAY_FAILED_DESC_1),
boxType = GConst.MESSAGE_BOX_TYPE.MB_OK,
okText = I18N:getGlobalText(I18N.GlobalConst.BTN_TEXT_OK),
}
GFunc.showMessageBox(params)
if callback then
callback(false)
end
elseif result.status == 1001 then -- 订单异常
-- 支付失败,服务器未找到此订单,所以消耗此订单,直接算掉单
if CS.UnityEngine.Application.platform == CS.UnityEngine.RuntimePlatform.Android then
if purchaseToken then
SDKManager:consumePurchase(purchaseToken)
GFunc.showToast(I18N:getGlobalText(I18N.GlobalConst.PAY_FAILED_DESC_1))
end
elseif CS.UnityEngine.Application.platform == CS.UnityEngine.RuntimePlatform.IPhonePlayer then
if productId then
SDKManager:consumePurchase(productId, nil, "repeat consume")
SDKManager:delIosOrder(productId)
GFunc.showToast(I18N:getGlobalText(I18N.GlobalConst.PAY_FAILED_DESC_1))
end
if originOrderId ~= "gm" then
SDKManager:delIosPayInfo(originOrderId)
end
end
else
-- Logger.logError("支付验证失败:%s", result.status)
self:retrySendPayRecord(purchaseToken, orderId, originOrderId, productId, notShowRewardsBox, callback, cmdId, payDouble, isFromBattle, isSpecialOrder, wayCode)
end
return
end
local showRewards = not notShowRewardsBox
if DataManager.TutorialData and DataManager.TutorialData:getIsInTutorial() then -- 引导时不弹
showRewards = false
end
if showRewards then
if not EDITOR_MODE and not ModuleManager.AccountManager:getIsBinded() then -- 没绑定账户信息,提示去绑定
ModuleManager.AccountManager:showBindUI()
-- if not EDITOR_MODE and not DataManager.PlayerData:isBinded() then -- 没绑定账户信息,提示去绑定
-- ModuleManager.AccountManager:showBindUI()
-- end
if result.rewards and table.nums(result.rewards) > 0 then
local unlockIds = {}
for k, v in ipairs(result.rewards) do
if v.type == GConst.REWARD_TYPE.ITEM then
local cfg = ConfigManager:getConfig("item")[v.item.id]
if cfg.type == GConst.ItemConst.ITEM_TYPE.FORCE then
if DataManager.ForceData:getForceIsNew(v.item.id) then
table.insert(unlockIds, v.item.id)
DataManager.ForceData:setForceIsNew(v.item.id, true)
end
if msgData.rewards and table.nums(msgData.rewards) > 0 then
GFunc.showRewardBox(msgData.rewards)
end
end
end
GFunc.showRewardBox(result.rewards, {unlockIds = unlockIds})
end
end
local biPayGetInfo = {}
table.foreach(msgData.gift, function(i, gift)
local cfgName = PayManager.PURCHARSE_TYPE_CONFIG[gift.act_type]
local changeRechargeMap = {}
local oneKeyRechargeId = 0
local oneKeyGiftId = 0
-- 打包购买
table.foreach(result.gift, function(i, gift)
local cfgName = PayManager.PURCHARSE_TYPE_CONFIG[gift.gift_type]
local cfgInfo = ConfigManager:getConfig(cfgName)[gift.id]
local rechargeId = cfgInfo.recharge_id
local beforCount = DataManager.PlayerData:getPayCounts(rechargeId)
DataManager.PlayerData:addPayment(rechargeId)
DataManager.ShopData:addPayment(rechargeId) -- 降档版本
DataManager.ShopData:updateGiftInfo(gift)
if cfgInfo.one_key then
oneKeyRechargeId = rechargeId
oneKeyGiftId = gift.id
end
end)
table.foreach(result.gift, function(i, gift)
local cfgName = PayManager.PURCHARSE_TYPE_CONFIG[gift.gift_type]
local cfgInfo = ConfigManager:getConfig(cfgName)[gift.id]
local rechargeId = cfgInfo.recharge_id
DataManager.PaymentData:updateGiftInfo(gift, result.rewards)
if oneKeyGiftId <= 0 or oneKeyGiftId == gift.id then
local beforCount = DataManager.PaymentData:getPayCount()[rechargeId] or 0
DataManager.PaymentData:addPayment(rechargeId)
table.insert(biPayGetInfo, {
giftType = gift.act_type,
giftType = gift.gift_type,
giftId = gift.id,
rechargeId = cfgInfo.recharge_id
})
if beforCount <= 0 then
BIReport:postFirstRechargeEvent(rechargeId)
end
BIReport:postRechargeEvent(rechargeId)
changeRechargeMap[rechargeId] = (changeRechargeMap[rechargeId] or 0) + 1
end
end)
-- 支付分成比例,不同支付方式不一样
-- if payProportion == nil then
-- payProportion = 1
-- elseif type(payProportion) ~= "number" then
-- payProportion = 1
-- end
for _, info in ipairs(biPayGetInfo) do
local giftType = PayManager:getGiftType(info.giftType, info.giftId)
BIReport:postPayGet(giftType, info.giftId, info.rechargeId, orderId, originOrderId, 1, msgData.rewards or {})
local giftType = self:getGiftType(info.giftType, info.giftId)
BIReport:postPayGet(giftType, info.giftId, info.rechargeId, payDouble, orderId, originOrderId, 1, result.rewards or {}, isFromBattle, nil, info.giftType)
local rechargeCfg = ConfigManager:getConfig("recharge")[info.rechargeId]
if rechargeCfg then
BIReport:postPurchase(rechargeCfg.price, rechargeCfg.payId, originOrderId, orderId)
if VersionCompatible:getIsPackageRU() and wayCode then
self:calcDukPayProportion(rechargeCfg, wayCode, function (price)
BIReport:postPurchase(nil, price, rechargeCfg.price, rechargeCfg[VersionCompatible:getRechargePayId()], originOrderId, orderId, rechargeCfg)
end)
elseif VersionCompatible:getIsPackageRUHW() and wayCode then
self:calcHWPayProportion(rechargeCfg.price, wayCode, function (price)
BIReport:postPurchase(nil, price, rechargeCfg.price, rechargeCfg[VersionCompatible:getRechargePayId()], originOrderId, orderId, rechargeCfg)
end)
else
if productId then
local currencyCode = SDKManager:getPriceCurrencyCode(productId)
local price = SDKManager:getProductPriceAmountMicros(productId) or rechargeCfg.price
if price <= 0 then
currencyCode = nil
price = rechargeCfg.price
end
BIReport:postPurchase(currencyCode, price, rechargeCfg.price, rechargeCfg[VersionCompatible:getRechargePayId()], originOrderId, orderId, rechargeCfg)
else
BIReport:postPurchase(nil, rechargeCfg.price, rechargeCfg.price, rechargeCfg[VersionCompatible:getRechargePayId()], originOrderId, orderId, rechargeCfg)
end
end
end
end
if oneKeyRechargeId > 0 then
changeRechargeMap = {}
changeRechargeMap[oneKeyRechargeId] = 1
end
if changeRechargeMap then
local score = 0
local changeCount = 0
local cfg = ConfigManager:getConfig("recharge")
for id, count in pairs(changeRechargeMap) do
local info = cfg[id]
if info then
if info.score then
score = score + info.score * count
changeCount = changeCount + count
end
end
end
if score > 0 then
ModuleManager.TaskManager:addTaskProgress(GConst.TaskConst.TASK_TYPE.RECHARGE_NUM, score)
ModuleManager.TaskManager:addTaskProgress(GConst.TaskConst.TASK_TYPE.RECHARGE_NUM_2, score)
end
end
-- 支付上报
local data = {}
data.pay_money = DataManager.PlayerData:getTotalPayAmount()
data.pay_count = DataManager.PlayerData:getPayCount()
CS.ThinkingAnalytics.ThinkingAnalyticsAPI.UserSet(data)
data.pay_money = DataManager.PaymentData:getPayTotal()
data.pay_count = DataManager.PaymentData:getAllPayCount()
BIReport:TAUserSet(data)
-- 支付验证成功后消耗此订单
if CS.UnityEngine.Application.platform == CS.UnityEngine.RuntimePlatform.Android then
@ -251,79 +463,375 @@ function PayManager:requestRewards(purchaseToken, orderId, originOrderId, produc
end
elseif CS.UnityEngine.Application.platform == CS.UnityEngine.RuntimePlatform.IPhonePlayer then
if productId then
SDKManager:consumePurchase(productId)
SDKManager:consumePurchase(productId, nil, "success consume")
SDKManager:delIosOrder(productId)
end
if originOrderId ~= "gm" then
SDKManager:delIosPayInfo(originOrderId)
end
end
elseif msgData.status == 1008 then -- 验证异常,但是需要消耗订单
if CS.UnityEngine.Application.platform == CS.UnityEngine.RuntimePlatform.Android then
else
if purchaseToken then
SDKManager:consumePurchase(purchaseToken)
end
elseif CS.UnityEngine.Application.platform == CS.UnityEngine.RuntimePlatform.IPhonePlayer then
if productId then
SDKManager:consumePurchase(productId)
SDKManager:delIosOrder(productId)
end
if originOrderId ~= "gm" then
SDKManager:delIosPayInfo(originOrderId)
end
end
Logger.logError("重复验证")
else
Logger.logError("支付验证失败:%s", msgData.status)
local params = {
content = I18N:getGlobalText(I18N.GlobalConst.PAY_FAILED_DESC_1),
boxType = GConst.MESSAGE_BOX_TYPE.MB_OK,
okText = I18N:getGlobalText(I18N.GlobalConst.BTN_TEXT_OK),
}
GFunc.showMessageBox(params)
end
if callback then
callback()
callback(true)
end
end)
end
function PayManager:checkAndPay(productId, id, purchaseType, rechargeId)
-- 三方礼包处理
function PayManager:requestThirdGiftRewards(gifts)
local changeRechargeMap = {}
local gem = 0
table.foreach(gifts, function(i, gift)
local cfgName = PayManager.PURCHARSE_TYPE_CONFIG[gift.gift_type]
local cfgInfo = ConfigManager:getConfig(cfgName)[gift.id]
local rechargeId = cfgInfo.recharge_id
if gift.gift_type == PayManager.PURCHARSE_TYPE.SHOP_GEM then
local isDouble = DataManager.PaymentData:getGemStoreDoubleCount(gift.id) > 0
gem = gem + cfgInfo.reward[1].num
if isDouble then
gem = gem + cfgInfo.reward[1].num
end
end
local beforCount = DataManager.PaymentData:getPayCount()[rechargeId] or 0
DataManager.PaymentData:addPayment(rechargeId)
DataManager.PaymentData:updateGiftInfo(gift)
changeRechargeMap[rechargeId] = (changeRechargeMap[rechargeId] or 0) + 1
end)
if gem > 0 then
DataManager.GiftRoutineData:addScore(gem)
end
-- if changeRechargeMap then
-- local score = 0
-- local changeCount = 0
-- local cfg = ConfigManager:getConfig("recharge")
-- for id, count in pairs(changeRechargeMap) do
-- local info = cfg[id]
-- if info then
-- if info.score then
-- score = score + info.score * count
-- changeCount = changeCount + count
-- end
-- end
-- end
-- 支付上报
local data = {}
data.pay_money = DataManager.PaymentData:getPayTotal()
data.pay_count = DataManager.PaymentData:getAllPayCount()
BIReport:TAUserSet(data)
end
-- 三方礼包处理
function PayManager:requestThirdJollyMaxGiftRewards(gifts)
table.foreach(gifts, function(i, gift)
local cfgName = PayManager.PURCHARSE_TYPE_CONFIG[gift.gift_type]
local cfgInfo = ConfigManager:getConfig(cfgName)[gift.id]
DataManager.PaymentData:updateJollyMaxGiftInfo(gift)
end)
-- 支付上报
local data = {}
data.pay_money = DataManager.PaymentData:getPayTotal()
data.pay_count = DataManager.PaymentData:getAllPayCount()
BIReport:TAUserSet(data)
end
function PayManager:checkAndPay(productId, id, purchaseType, rechargeId, payDouble, freeShowRewards, isFromBattle)
-- 检查是否可以支付
SDKManager:checkPay(productId, function(code)
if code == 0 then
self:sendMessage(ProtoMsgType.FromMsgEnum.ActPayReq, {id = id, act_type = purchaseType}, function(binder, msgData)
if msgData.status == 0 then
if msgData.uuid and msgData.uuid ~= GConst.EMPTY_STRING then
local giftType = PayManager:getGiftType(purchaseType, id)
BIReport:postPayTurn(giftType, id, rechargeId)
SDKManager:pay(productId, msgData.uuid, rechargeId, giftType, purchaseType, id, function(purchaseToken, orderId, originOrderId)
if purchaseToken and orderId then
self:requestRewards(purchaseToken, orderId, originOrderId, productId)
end
end)
else -- 没有支付信息,直接发奖
if table.nums(msgData.rewards) > 0 then
GFunc.showRewardBox(msgData.rewards)
end
local giftData = {}
giftData.act_type = msgData.act_type
giftData.id = msgData.id
giftData.buy_count = DataManager.ShopData:getGiftBoughtNum(msgData.act_type, msgData.id) + 1
giftData.latest_buy_at = Time:getServerTime() * 1000 -- 服务器都是毫秒
DataManager.ShopData:updateGiftInfo(giftData)
end
else
Logger.logError("预支付失败")
end
end)
self:reqGiftPay(productId, id, purchaseType, rechargeId, payDouble, freeShowRewards, isFromBattle)
end
end)
end
function PayManager:sendMsgToServer(purchaseToken, uuid, originOrderId, productId, callback)
local args = SDKManager:getPurchaseArgs(purchaseToken, uuid, originOrderId, productId)
self:sendMessage(ProtoMsgType.FromMsgEnum.ActPaidResultReq, args, callback)
function PayManager:reqGiftPay(productId, id, purchaseType, rechargeId, payDouble, freeShowRewards, isFromBattle, useDaiJinJuan)
self:sendMessage(ProtoMsgType.FromMsgEnum.GiftPayReq, {id = id, gift_type = purchaseType, voucher = useDaiJinJuan == true}, function(sender, result)
if result.err_code ~= GConst.ERROR_STR.SUCCESS then
Logger.logError("预支付失败")
return
end
local giftType = PayManager:getGiftType(purchaseType, id)
if result.uuid and result.uuid ~= GConst.EMPTY_STRING then
BIReport:postPayCreateOrder(giftType, id, rechargeId, result.uuid, isFromBattle, purchaseType)
local giftType = PayManager:getGiftType(purchaseType, id)
BIReport:postPayTurn(giftType, id, rechargeId, payDouble, isFromBattle, purchaseType)
SDKManager:pay(productId, result.uuid, rechargeId, giftType, purchaseType, id, function(purchaseToken, orderId, originOrderId)
if purchaseToken and orderId then
local notShowRewardBox = freeShowRewards == false -- 原本传的是nil默认必须展示奖励弹窗现在改成能控制
self:requestRewards(purchaseToken, orderId, originOrderId, productId, notShowRewardBox, nil, nil, payDouble, isFromBattle)
end
end, freeShowRewards)
else -- 没有支付信息,直接发奖
if freeShowRewards or useDaiJinJuan then
if table.nums(result.rewards) > 0 then
GFunc.showRewardBox(result.rewards)
end
end
local giftData = {}
giftData.gift_type = result.gift_type
giftData.id = result.id
giftData.buy_count = DataManager.PaymentData:getGiftBoughtNum(result.gift_type, result.id) + 1
giftData.latest_buy_at = Time:getServerTime() -- * 1000 -- 服务器都是毫秒
DataManager.PaymentData:updateGiftInfo(giftData, result.rewards)
if useDaiJinJuan then -- 代金卷也要上报
local biPayGetInfo = {}
local changeRechargeMap = {}
local cfgName = PayManager.PURCHARSE_TYPE_CONFIG[result.gift_type]
local cfgInfo = ConfigManager:getConfig(cfgName)[result.id]
local rechargeId = cfgInfo.recharge_id
-- local beforCount = DataManager.PaymentData:getPayCount()[rechargeId] or 0
-- DataManager.PaymentData:addPayment(rechargeId)
table.insert(biPayGetInfo, {
giftType = result.gift_type,
giftId = result.id,
rechargeId = cfgInfo.recharge_id
})
-- if beforCount <= 0 then
-- BIReport:postFirstRechargeEvent(rechargeId)
-- end
-- BIReport:postRechargeEvent(rechargeId)
changeRechargeMap[rechargeId] = (changeRechargeMap[rechargeId] or 0) + 1
for _, info in ipairs(biPayGetInfo) do
local giftType = self:getGiftType(info.giftType, info.giftId)
BIReport:postPayGet(giftType, info.giftId, info.rechargeId, payDouble, "", "", 1, result.rewards or {}, isFromBattle, useDaiJinJuan, info.giftType)
-- local rechargeCfg = ConfigManager:getConfig("recharge")[info.rechargeId]
-- if rechargeCfg then
-- BIReport:postPurchase(nil, rechargeCfg.price, rechargeCfg[VersionCompatible:getRechargePayId()], nil, nil)
-- end
end
-- 暂时屏蔽上报
if changeRechargeMap then
local score = 0
local changeCount = 0
local cfg = ConfigManager:getConfig("recharge")
for id, count in pairs(changeRechargeMap) do
local info = cfg[id]
if info then
if info.score then
score = score + info.score * count
changeCount = changeCount + count
end
end
end
if score > 0 then
-- ModuleManager.TaskManager:addTaskProgress(GConst.TaskConst.TASK_TYPE.X_RECHARGE_SCORE, {num = score})
end
if changeCount > 0 then
-- ModuleManager.TaskManager:addTaskProgress(GConst.TaskConst.TASK_TYPE.X_TOTAL_RECHARGE, {num = changeCount})
end
end
-- 支付上报
local data = {}
data.pay_money = DataManager.PaymentData:getPayTotal()
data.pay_count = DataManager.PaymentData:getAllPayCount()
BIReport:TAUserSet(data)
end
end
end)
end
function PayManager:retrySendPayRecord(purchaseToken, orderId, originOrderId, productId, notShowRewardsBox, callback, cmdId, payDouble, isFromBattle, isSpecialOrder, wayCode)
if self.retryPaySid then
SchedulerManager:unscheduleGlobal(self.retryPaySid)
end
self.retryPaySid = SchedulerManager:performWithDelayGlobal(function()
self.retryPaySid = nil
if not NetManager:getIsBusy() then
return self:requestRewards(purchaseToken, orderId, originOrderId, productId, notShowRewardsBox, callback, cmdId, payDouble, isFromBattle, isSpecialOrder, wayCode)
end
return self:retrySendPayRecord(purchaseToken, orderId, originOrderId, productId, notShowRewardsBox, callback, cmdId, payDouble, isFromBattle, isSpecialOrder, wayCode)
end, 5)
end
function PayManager:showPayselectUI(rechargeId, callback)
local num = DataManager.BagData.ItemData:getItemNumById(GConst.ItemConst.ITEM_ID_ACT_DAIJINJUAN)
if num <= 0 then
callback(false)
return
end
if DataManager.PaymentData:getDefaultPayWay() == DataManager.PaymentData.PAY_WAY.DIRECTE then
callback(false)
return
end
local rechargeCfg = ConfigManager:getConfig("recharge")[rechargeId]
if rechargeCfg and rechargeCfg.vouchers and rechargeCfg.vouchers.num <= 0 then
callback(false)
return
end
UIManager:showUI("app/ui/shop/pay_select_ui", {rechargeId = rechargeId, callback = callback})
end
--@region dukpay payProportion
-- 更新公式为:应结算美元(去所有分成)= (商品售价RUB-该笔手续费)/结算汇率
-- 目前的实际公式为:(商品售价RUB-该笔手续费)/87.42, 其中cardSBPTinkoff单笔支付手续费小于5RUB时按照5RUB计算
function PayManager:calcDukPayProportion(rechargeCfg, wayCode, callback)
local price = rechargeCfg.price_ru
local serviceCharge = 0
if wayCode == "BANK_CARD" then
serviceCharge = price * 0.04
if serviceCharge < 5 then
serviceCharge = 5
end
elseif wayCode == "SBP" then
serviceCharge = price * 0.025
if serviceCharge < 5 then
serviceCharge = 5
end
elseif wayCode == "SBER_PAY" then
serviceCharge = price * 0.055
elseif wayCode == "TINKOFF_PAY" then
serviceCharge = price * 0.045
if serviceCharge < 5 then
serviceCharge = 5
end
elseif wayCode == "YOOMONEY" then
serviceCharge = price * 0.055
end
local finalPrice = (price - serviceCharge)/87.42
callback(finalPrice)
end
--@endregion
--@region hw payProportion
function PayManager:calcHWPayProportion(price, wayCode, callback)
-- ((金额*0.96- 5RUB*汇率(个别支付方式没有))*0.935*0.8
local finalPrice = price
if not wayCode then
callback(finalPrice)
return
end
-- 花币
local way1 = {
["0"] = true,
["21"] = true,
["81"] = true,
}
-- Voucher
local way2 = {
["19"] = true,
["45"] = true,
["49"] = true,
}
-- 手机话费
local way3 = {
["6"] = true,
["23"] = true,
["70"] = true,
}
-- 银行卡/信用卡
local way4 = {
["3"] = true,
["4"] = true,
["13"] = true,
["16"] = true,
["17"] = true,
["20"] = true,
["24"] = true,
["31"] = true,
["32"] = true,
["33"] = true,
["34"] = true,
["35"] = true,
["36"] = true,
["37"] = true,
["38"] = true,
["39"] = true,
["40"] = true,
["41"] = true,
["42"] = true,
["43"] = true,
["44"] = true,
["46"] = true,
["47"] = true,
["48"] = true,
["61"] = true,
["62"] = true,
["63"] = true,
["64"] = true,
["65"] = true,
["66"] = true,
["67"] = true,
["68"] = true,
["69"] = true,
["71"] = true,
["72"] = true,
["73"] = true,
["74"] = true,
["75"] = true,
["76"] = true,
["77"] = true,
["78"] = true,
["79"] = true,
["80"] = true,
["82"] = true,
["83"] = true,
["84"] = true,
["85"] = true,
["86"] = true,
["88"] = true,
["89"] = true,
["90"] = true,
["93"] = true,
["94"] = true,
["95"] = true,
["97"] = true,
["98"] = true,
["99"] = true,
["100"] = true,
["102"] = true,
["103"] = true,
["105"] = true,
["106"] = true,
["108"] = true,
["109"] = true,
["110"] = true,
["113"] = true,
}
-- 此单结算金额=(99-99*4%-99*16.67%)*85%*【0.011*(1-1.5%)】-10*【0.011*(1-1.5%)】=0.61 USD四舍五入小数点保留后两位
local rate = 0.7
if Time:getServerTime() >= 1740787200 then
rate = 0.85
end
if way1[wayCode] then
finalPrice = (price * (1 - 0.07 - 0.1667) * rate - 10) * (0.011 * 0.985)
elseif way2[wayCode] then
finalPrice = (price * (1 - 0.025 - 0.1667) * rate - 10) * (0.011 * 0.985)
elseif way3[wayCode] then
finalPrice = (price * (1 - 0.1 - 0.1667) * rate - 10) * (0.011 * 0.985)
elseif way4[wayCode] then
finalPrice = (price * (1 - 0.04 - 0.1667) * rate - 10) * (0.011 * 0.985)
else
callback(finalPrice)
return
end
finalPrice = math.floor(finalPrice * 1000)
local a = finalPrice % 10
if a >= 5 then
finalPrice = ((finalPrice + 10) // 10) / 100
else
finalPrice = (finalPrice // 10) / 100
end
callback(finalPrice)
end
--@endregion
return PayManager

View File

@ -1,36 +1,26 @@
local Platform = {}
local bfGateInfo = CS.BF.BFPlatform.GetCurrentGateInfo()
Platform.bfGateInfo = bfGateInfo
---- 获取包名
function Platform:getIdentifier()
if not Platform:getIsPublishChannel() and VersionCompatible:supportSimulatedPackageName() then
return CS.BF.BFMain.DPPackageName
end
return CS.UnityEngine.Application.identifier
end
---- 是否是内网
---- 是否是内网开发
function Platform:getIsDevChannel()
return CS.BF.BFPlatform.IsDevChannel()
return IS_DEV
end
---- 是否是release
function Platform:getIsReleaseChannel()
return CS.BF.BFPlatform.IsReleaseChannel()
---- 是否是外网测试
function Platform:getIsTestChannel()
return IS_TEST
end
---- 是否是发布渠道
---- 是否是正式发布包
function Platform:getIsPublishChannel()
return CS.BF.BFPlatform.IsPublishChannel()
end
---- 获取主链接域名
function Platform:getMainDomain()
return bfGateInfo.mainDomain
end
---- 获取主链接端口
function Platform:getMainPort()
return bfGateInfo.mainPort
return IS_PUBLISH
end
-- 平台
@ -97,4 +87,69 @@ function Platform:getPlatformStr()
return self.platformStr
end
-- 判断是否是T3地区
function Platform:getPlatformIsT3()
local systemLanguage = CS.UnityEngine.Application.systemLanguage
local isAndroid = self:isAndroidPlatform()
local isT3 = false
-- 测试模式打开
if EDITOR_MODE then
return true
end
-- 需要Android 且 T3地区 才会开放,目前按照系统语言来处理
if isAndroid then
-- 除美国、日本、韩国、台湾、德国、法国、英国、加拿大、澳大利亚以外的的地区为T3。
isT3 = true
if systemLanguage == CS.UnityEngine.SystemLanguage.English then -- 英语(美国/英国/加拿大/澳大利亚)
isT3 = false
elseif systemLanguage == CS.UnityEngine.SystemLanguage.Japanese then -- 日语(日本)
isT3 = false
elseif systemLanguage == CS.UnityEngine.SystemLanguage.Korean then -- 韩语(韩国)
isT3 = false
elseif systemLanguage == CS.UnityEngine.SystemLanguage.ChineseTraditional then -- 繁体(台湾)
isT3 = false
elseif systemLanguage == CS.UnityEngine.SystemLanguage.German then -- 德语(德国)
isT3 = false
elseif systemLanguage == CS.UnityEngine.SystemLanguage.French then -- 法语(法国/加拿大)
isT3 = false
end
else
return false
end
return isT3
end
function Platform:getPlatformIsThirdPay()
local systemLanguage = CS.UnityEngine.Application.systemLanguage
local isAndroid = self:isAndroidPlatform()
local isThirdPay = false
-- unity模式 并且是越南语的 情况下 打开三方支付
if EDITOR_MODE and I18N:getCurLanguage() == GConst.LANGUAGE.VIETNAMESE then
return true
end
if isAndroid and not CS.BF.BFMain.IsShenhe then
-- if systemLanguage == CS.UnityEngine.SystemLanguage.Russian then
-- isThirdPay = true
-- end
-- if self:getIdentifier() == "" then
-- isThirdPay = true
-- end
end
return isThirdPay
end
function Platform:getAdvertisingID()
if not self.advertisingID then
self.advertisingID = "none"
-- self.advertisingID = CS.BF.AdvertisingIDManager.GetAdvertisingID()
end
return self.advertisingID
end
return Platform

View File

@ -157,6 +157,7 @@ if NOT_PUBLISH then
[SDKManager.tryLoadRewardedAdDelay] = true,
[ScrollRectBase.refillCells] = true,
[DataManager.scheduleGlobal] = true,
[DataManager.doCrossDay] = true,
[NetManager.performWithDelayGlobal] = true,
[NetManager.scheduleGlobal] = true,
}

View File

@ -11,7 +11,9 @@ SDKManager.BF_LOGIN_TYPE = {
FACEBOOK = 3,
TEST = 4,
GOOGLE = 5,
APPLE = 6
APPLE = 6,
VKID = 7,
FACEBOOK_LIMITED = 8,
}
SDKManager.BF_LOGIN_RESULT = {
@ -34,13 +36,20 @@ SDKManager.LOGIN_TYPE = {
[4] = "test",
[5] = "google",
[6] = "apple",
[7] = "vk",
[8] = "facebook_limited"
}
-- 支付方式
SDKManager.PAY_TYPE = {
NONE = 0,
GOOGLE = 1,
APPLE = 2,
IOS = 2,
Coda = 3,
RuStore = 4,
ENJOY = 5,
DUKPAY = 6,
HW = 7,
DEBUG = 10,
DEPRECATED_APPLE = 11,
}
@ -63,17 +72,40 @@ function SDKManager:init()
-- 标记状态
self.isLogining = false
self.isLogouting = false
self.isWatchingAD = false
self.isThirdPay = false
if Platform:getPlatformIsThirdPay() then
self.isThirdPay = true
end
self.iosPayInfos = LocalData:getIosPayInfo()
self.iosOrders = LocalData:getIosOrders()
-- lazy init
local SDKMgr = CS.BF.BFMain.Instance.SDKMgr
self:initPay()
self:initPayListener()
-- 初始化AF的广告回传SDK
CS.BF.BFMain.Instance.SDKMgr.BFThirdReportSDKMgr:InitAppsFlyerAdRevenue()
self:initAdsListener()
-- 拿到firebasetoken
self:initFireBaseToken()
-- self:initFireBaseToken()
-- 尝试拿取AF的ConversionData
-- self:tryGetAFConversionData()
-- 初始化deeplink
if VersionCompatible:supportDeepLink() then
self:initDeepLink()
end
self:tryGetAFConversionData()
end
function SDKManager:refreshThirdPay()
self.isThirdPay = false
if Platform:getPlatformIsThirdPay() then
self.isThirdPay = true
end
end
-- 支付相关接口 ********************************************************************** 开始
@ -125,8 +157,8 @@ function SDKManager:queryProducts(callback)
end
-- 处理未完成的订单
function SDKManager:doUncompleteOrder(callback, productId)
SDKPayMgr:doUncompleteOrder(callback, productId)
function SDKManager:doUncompleteOrder(callback, productId, freeShowRewards)
SDKPayMgr:doUncompleteOrder(callback, productId, freeShowRewards)
end
-- sdk接口 得到特定商品的price
@ -158,9 +190,14 @@ function SDKManager:getPurchaseArgs(purchaseToken, uuid, channelOrderId, product
return SDKPayMgr:getPurchaseArgs(purchaseToken, uuid, channelOrderId, productId)
end
-- ios补单专用
function SDKManager:getPurchaseArgs2(purchaseToken, uuid, channelOrderId, productId)
return SDKPayMgr:getPurchaseArgs2(purchaseToken, uuid, channelOrderId, productId)
end
-- sdk将已完成的订单消耗掉
function SDKManager:consumePurchase(token, callback)
SDKPayMgr:consumePurchase(token, callback)
function SDKManager:consumePurchase(token, callback, debugInfo)
SDKPayMgr:consumePurchase(token, callback, debugInfo)
end
-- 检查是否可以支付
@ -174,8 +211,8 @@ function SDKManager:checkPay(productId, callback)
end
-- 支付
function SDKManager:pay(productId, orderId, rechargeId, giftType, purchaseType, giftId, callback)
SDKPayMgr:pay(productId, orderId, rechargeId, giftType, purchaseType, giftId, callback)
function SDKManager:pay(productId, orderId, rechargeId, giftType, purchaseType, giftId, callback, freeShowRewards)
SDKPayMgr:pay(productId, orderId, rechargeId, giftType, purchaseType, giftId, callback, freeShowRewards)
end
function SDKManager:doUncompletePay(callback)
@ -215,75 +252,94 @@ end
function SDKManager:initFireBaseToken()
CS.BF.BFMain.Instance.SDKMgr.BFLoginSDKMgr:GetFirebaseToken(function(token)
self.firebaseToken = token
CS.BF.BFMain.Instance.SDKMgr.BFThirdReportSDKMgr:AdjustSetDeviceToken(token)
end)
end
function SDKManager:getFirebaseToken()
CS.BF.BFMain.Instance.SDKMgr.BFLoginSDKMgr:GetFirebaseToken(function(token)
self.firebaseToken = token
end)
return self.firebaseToken
end
function SDKManager:doNextFrame(callback)
SchedulerManager:performWithDelayGlobal(callback, 0)
end
--- 广告
function SDKManager:isAdLoaded()
if VersionCompatible:getIsPackageRUHW() then
if CS.UnityEngine.Application.platform == CS.UnityEngine.RuntimePlatform.Android then
-- return CS.BF.BFMain.Instance.SDKMgr.BFIronSourceSDKMgr.AdLoaded
return CS.BF.BFMain.Instance.SDKMgr.BFHWAdSDKMgr.AdLoaded
elseif EDITOR_MODE then
return true
elseif CS.UnityEngine.Application.platform == CS.UnityEngine.RuntimePlatform.IPhonePlayer then
else
return false
end
else
if CS.UnityEngine.Application.platform == CS.UnityEngine.RuntimePlatform.Android or
CS.UnityEngine.Application.platform == CS.UnityEngine.RuntimePlatform.IPhonePlayer then
return CS.AdManager.Instance:IsRewardedAdReady()
elseif EDITOR_MODE then
return true
end
return false
end
return true
end
function SDKManager:tryLoadRewardedAdDelay()
-- if self.adDelaySid then
-- SchedulerManager:unscheduleGlobal(self.adDelaySid)
-- self.adDelaySid = nil
-- end
-- self.adDelaySid = SchedulerManager:performWithDelayGlobal(function()
-- self.adDelaySid = nil
-- CS.BF.BFMain.Instance.SDKMgr.BFIronSourceSDKMgr:TryLoadRewardedAd()
-- end, 5)
if self.adDelaySid then
SchedulerManager:unscheduleGlobal(self.adDelaySid)
self.adDelaySid = nil
end
self.adDelaySid = SchedulerManager:performWithDelayGlobal(function()
self.adDelaySid = nil
if VersionCompatible:getIsPackageRUHW() then
CS.BF.BFMain.Instance.SDKMgr.BFHWAdSDKMgr:TryLoadRewardedAd()
end
end, 5)
end
function SDKManager:tryLoadInterstitialAdDelay()
if self.interstitialAdDelaySid then
SchedulerManager:unscheduleGlobal(self.interstitialAdDelaySid)
self.interstitialAdDelaySid = nil
end
self.interstitialAdDelaySid = SchedulerManager:performWithDelayGlobal(function()
self.interstitialAdDelaySid = nil
end, 5)
end
function SDKManager:initAdsListener()
if CS.UnityEngine.Application.platform == CS.UnityEngine.RuntimePlatform.Android then
-- CS.BF.BFMain.Instance.SDKMgr.BFIronSourceSDKMgr:SetAdShowCallback(function(code)
-- -- code 为0 表示广告播放成功
-- if code == 0 then
-- BIReport:postAdPlaySuccess(self.adsClickType)
-- else
-- self:tryLoadRewardedAdDelay()
-- end
-- end)
-- CS.BF.BFMain.Instance.SDKMgr.BFIronSourceSDKMgr:SetAdLoadedCallback(function(code)
-- -- code 为0 表示广告加载成功
-- if code ~= 0 then
-- self:tryLoadRewardedAdDelay()
-- end
-- end)
-- CS.BF.BFMain.Instance.SDKMgr.BFIronSourceSDKMgr:SetAdEarnedRewardCallback(function(code, result)
-- if self.adCallback then
-- if DataManager.PlayerData then
-- DataManager.PlayerData:addAdCount()
-- local data = {}
-- data.ads_num = DataManager.PlayerData:getAdCount()
-- CS.ThinkingAnalytics.ThinkingAnalyticsAPI.UserSet(data)
-- end
-- self:adRewradAd()
-- self.adCallback()
-- BIReport:postAdRewardGet(self.adsClickType)
-- self.adsClickType = nil
-- self.adCallback = nil
-- end
-- end)
-- CS.BF.BFMain.Instance.SDKMgr.BFIronSourceSDKMgr:SetAdRevenuePaidEventCallback(function (result)
-- if result and result ~= GConst.EMPTY_STRING then
-- BIReport:postIronSourceAdRevenue(result)
-- end
-- end)
elseif CS.UnityEngine.Application.platform == CS.UnityEngine.RuntimePlatform.IPhonePlayer then
if VersionCompatible:getIsPackageRUHW() then
CS.BF.BFMain.Instance.SDKMgr.BFHWAdSDKMgr:SetAdShowCallback(function (code)
-- code 为0 表示广告播放成功
if code == 0 then
BIReport:postVideoAdOpt(BIReport.VIDEO_AD_OPT_TYPE.PLAY_SUCCESS, self.adsClickType)
else
self:tryLoadRewardedAdDelay()
end
end)
CS.BF.BFMain.Instance.SDKMgr.BFHWAdSDKMgr:SetAdLoadedCallback(function (code)
-- code 为0 表示广告加载成功
if code ~= 0 then
self:tryLoadRewardedAdDelay()
end
end)
CS.BF.BFMain.Instance.SDKMgr.BFHWAdSDKMgr:SetAdEarnedRewardCallback(function (code, result)
if self.adCallback then
self:adRewradAd()
self.adCallback()
self.isWatchingAD = false -- 标记看广告
BIReport:postVideoAdOpt(BIReport.VIDEO_AD_OPT_TYPE.GET_REWARD, self.adsClickType)
self.adsClickType = nil
self.adCallback = nil
end
end)
else
if CS.UnityEngine.Application.platform == CS.UnityEngine.RuntimePlatform.Android or
CS.UnityEngine.Application.platform == CS.UnityEngine.RuntimePlatform.IPhonePlayer then
-- 初始化一下
local adManager = CS.AdManager.Instance
adManager:SetAdRevenuePaidEventCallback(function (result)
@ -293,37 +349,10 @@ function SDKManager:initAdsListener()
end)
end
end
function SDKManager:showFullScreenAds(adsClickType, adCallback)
if EDITOR_MODE then
if not adsClickType then
local params = {
content = "SDKManager showFullScreenAds has no adsClickType",
boxType = GConst.MESSAGE_BOX_TYPE.MB_OK,
okText = I18N:getGlobalText(I18N.GlobalConst.BTN_TEXT_OK),
}
GFunc.showMessageBox(params)
Logger.log("SDKManager showFullScreenAds has no adsClickType")
end
end
BIReport:postAdClick(adsClickType)
-- if EDITOR_MODE then
if true then
if DataManager.PlayerData then
DataManager.PlayerData:addAdCount()
local data = {}
data.ads_num = DataManager.PlayerData:getAdCount()
CS.ThinkingAnalytics.ThinkingAnalyticsAPI.UserSet(data)
end
self:adRewradAd()
if adCallback then
adCallback()
end
return true
end
if NetManager:isNotReachable() then
-- 没有网
function SDKManager:showFullScreenAds(adsClickType, adCallback, ignoreShowMessageBox)
if NetManager:isNotReachable() then -- 没有网
GFunc.showToast(I18N:getGlobalText(I18N.GlobalConst.NO_NETWORK))
return false
end
@ -331,58 +360,171 @@ function SDKManager:showFullScreenAds(adsClickType, adCallback)
GFunc.showToast(I18N:getGlobalText(I18N.GlobalConst.NETWORK_ERROE_1))
return false
end
-- if DataManager.MallActData:skipAd() then
-- self:adRewradAd(true)
-- if adCallback then
-- adCallback()
-- end
-- return true
-- end
if CS.UnityEngine.Application.platform == CS.UnityEngine.RuntimePlatform.Android then
-- if not CS.BF.BFMain.Instance.SDKMgr.BFIronSourceSDKMgr.AdLoaded then
-- GFunc.showToast(I18N:getGlobalText(I18N.GlobalConst.NO_ADS))
-- return false
-- end
-- CS.BF.BFMain.Instance.SDKMgr.BFIronSourceSDKMgr:SetAdPlacement(adsClickType)
-- CS.BF.BFMain.Instance.SDKMgr.BFIronSourceSDKMgr.AdLoaded = false
-- self.adCallback = adCallback
-- self.adsClickType = adsClickType
-- CS.BF.BFMain.Instance.SDKMgr.BFIronSourceSDKMgr:ShowFullScreenAds()
BIReport:postVideoAdOpt(BIReport.VIDEO_AD_OPT_TYPE.CLICK, adsClickType)
if DataManager.PaymentData:getIsSkipAd() then
self:adRewradAd()
if adCallback then
adCallback()
end
BIReport:postVideoAdOpt(BIReport.VIDEO_AD_OPT_TYPE.GET_REWARD_SKIP_AD, adsClickType)
return true
elseif CS.UnityEngine.Application.platform == CS.UnityEngine.RuntimePlatform.IPhonePlayer then
end
if not ignoreShowMessageBox and DataManager.PrivilegeCardData:getIsOpen(GConst.ShopConst.PRIVILEGE_CARD_ID.AD_CARD) then
-- local params = {}
-- params.content = I18N:getGlobalText(I18N.GlobalConst.ADS_DESC_13)
-- params.boxType = GConst.MESSAGE_BOX_TYPE.MB_OK_CANCEL
-- params.showToday = GConst.MESSAGE_BOX_SHOW_TODAY.MONTHLY_CARD_AD
-- params.okText = I18N:getGlobalText(I18N.GlobalConst.SKIN_FORCE_DESC_8)
-- params.cancelText = I18N:getGlobalText(I18N.GlobalConst.AD_FREE_DESC_9)
-- params.notShowCallCancel = true
-- params.okFunc = function()
-- self:_showFullScreenAds(adsClickType, adCallback)
-- end
-- GFunc.showMessageBox(params)
local params = {}
params.content = I18N:getGlobalText(I18N.GlobalConst.ADS_DESC_13)
params.showToday = GConst.MESSAGE_BOX_SHOW_TODAY.MONTHLY_CARD_AD
params.okFunc = function()
if DataManager.PaymentData:getIsSkipAd() then
self:adRewradAd()
if adCallback then
adCallback()
end
BIReport:postVideoAdOpt(BIReport.VIDEO_AD_OPT_TYPE.GET_REWARD_SKIP_AD, adsClickType)
return
end
self:_showFullScreenAds(adsClickType, adCallback)
end
GFunc.showAdMesssageBox(params)
else
self:_showFullScreenAds(adsClickType, adCallback)
end
return true
end
function SDKManager:_showFullScreenAds(adsClickType, adCallback)
if EDITOR_MODE then
self:adRewradAd()
if adCallback then
adCallback()
end
return true
end
if VersionCompatible:getIsPackageRUHW() then
if not CS.BF.BFMain.Instance.SDKMgr.BFHWAdSDKMgr.AdLoaded then
GFunc.showToast(I18N:getGlobalText(I18N.GlobalConst.NO_ADS))
return false
end
-- CS.BF.BFMain.Instance.SDKMgr.BFHWAdSDKMgr:SetAdPlacement(adsClickType)
CS.BF.BFMain.Instance.SDKMgr.BFHWAdSDKMgr.AdLoaded = false
self.adCallback = adCallback
self.adsClickType = adsClickType
CS.BF.BFMain.Instance.SDKMgr.BFHWAdSDKMgr:ShowFullScreenAds()
self.isWatchingAD = true -- 标记看广告
else
if CS.UnityEngine.Application.platform == CS.UnityEngine.RuntimePlatform.Android or
CS.UnityEngine.Application.platform == CS.UnityEngine.RuntimePlatform.IPhonePlayer then
if not CS.AdManager.Instance:IsRewardedAdReady() then
GFunc.showToast(I18N:getGlobalText(I18N.GlobalConst.NO_ADS))
return false
end
self.adsClickType = adsClickType
BIReport:postAdPlaySuccess(self.adsClickType)
BIReport:postVideoAdOpt(BIReport.VIDEO_AD_OPT_TYPE.PLAY_SUCCESS, self.adsClickType)
CS.AdManager.Instance:ShowRewardedAd(function (code)
if code == 0 then
if DataManager.PlayerData then
DataManager.PlayerData:addAdCount()
local data = {}
data.ads_num = DataManager.PlayerData:getAdCount()
CS.ThinkingAnalytics.ThinkingAnalyticsAPI.UserSet(data)
if not self.watchAdCount then
self.watchAdCount = 1
end
self:adRewradAd()
if adCallback then
adCallback()
end
BIReport:postAdRewardGet(self.adsClickType)
self.isWatchingAD = false -- 标记看广告
BIReport:postVideoAdOpt(BIReport.VIDEO_AD_OPT_TYPE.GET_REWARD, self.adsClickType)
self.adsClickType = nil
end
end)
self.isWatchingAD = true -- 标记看广告
return true
end
end
return true
end
function SDKManager:getIsWatchingAD()
return self.isWatchingAD
end
function SDKManager:clearWatchAdCount()
self.watchAdCount = nil
end
function SDKManager:adRewradAd(noReport)
ModuleManager.TaskManager:addTaskProgress(GConst.TaskConst.TASK_TYPE.X_WATCH_AD)
-- 看广告
ModuleManager.TaskManager:addTaskProgress(GConst.TaskConst.TASK_TYPE.AD_WATCH_NUM)
if not noReport then
DataManager.PlayerData:addAdCount()
BIReport:postAdEvent()
end
end
function SDKManager:showInterstitial(interstitialAdType, adCallback)
if EDITOR_MODE then
if not interstitialAdType then
local params = {
content = "SDKManager showInterstitial has no adsClickType",
boxType = GConst.MESSAGE_BOX_TYPE.MB_OK,
okText = I18N:getGlobalText(I18N.GlobalConst.BTN_TEXT_OK),
}
GFunc.showMessageBox(params)
Logger.log("SDKManager showInterstitial has no adsClickType")
end
end
BIReport:postInterstitialAdOpt(BIReport.INTERSTITIAL_AD_OPT_TYPE.SHOW, interstitialAdType)
if EDITOR_MODE then
if adCallback then
adCallback()
end
return
end
if CS.UnityEngine.Application.platform == CS.UnityEngine.RuntimePlatform.Android or
CS.UnityEngine.Application.platform == CS.UnityEngine.RuntimePlatform.IPhonePlayer then
if not CS.AdManager.Instance:IsInterstitialReady() then
if adCallback then
adCallback()
end
return
end
BIReport:postInterstitialAdOpt(BIReport.INTERSTITIAL_AD_OPT_TYPE.SUCCESS, interstitialAdType)
self.isWatchingAD = true
CS.AdManager.Instance:ShowInterstitial(function(code)
self.isWatchingAD = false
if adCallback then
adCallback()
adCallback = nil
end
end)
elseif EDITOR_MODE then
if adCallback then
adCallback()
adCallback = nil
end
end
end
--- 广告
-- function SDKManager:getProjectId()
-- return CS.BF.BFMain.ProjectId
-- end
-- function SDKManager:getEnv()
-- return CS.BF.BFMain.ProjectEnv
-- end
function SDKManager:getServerList(callback)
local postData = {
project_id = "c1",
@ -419,9 +561,9 @@ function SDKManager:login(callback, loginType)
Logger.log("三方当前正在登陆中")
return
end
self.isLogining = true
self:_login(function(code, msg)
Logger.log("login finish:%s %s", code, msg)
if code == SDKManager.BF_LOGIN_RESULT.Success then
if not msg then
self.isLogining = false
@ -437,6 +579,7 @@ function SDKManager:login(callback, loginType)
self.isLogining = false
return
end
local userId = loginResult.UserId
local token = loginResult.Token
local params = {}
@ -452,6 +595,18 @@ function SDKManager:login(callback, loginType)
id = tostring(userId),
token = tostring(token)
}
elseif loginType == SDKManager.BF_LOGIN_TYPE.FACEBOOK then
params = {
type = "facebook",
id = tostring(userId),
token = tostring(token)
}
elseif loginType == SDKManager.BF_LOGIN_TYPE.VKID then
params = {
type = "vkid",
id = tostring(userId),
token = tostring(token)
}
end
if callback then
callback(params)
@ -462,8 +617,28 @@ function SDKManager:login(callback, loginType)
end, loginType)
end
function SDKManager:getLoginTypeFacebook()
-- if Platform:isIosPlatform() then
-- return NetManager.LOGIN_TYPE.FACEBOOK_LIMITED
-- else
return NetManager.LOGIN_TYPE.FACEBOOK
-- end
end
function SDKManager:getServerLoginType(loginType)
-- if Platform:isIosPlatform() then
-- if loginType == SDKManager.BF_LOGIN_TYPE.FACEBOOK then
-- return SDKManager.LOGIN_TYPE[SDKManager.BF_LOGIN_TYPE.FACEBOOK_LIMITED]
-- else
-- return SDKManager.LOGIN_TYPE[loginType]
-- end
-- else
return SDKManager.LOGIN_TYPE[loginType]
-- end
end
function SDKManager:_logout(callback, loginType)
if loginType == SDKManager.BF_LOGIN_TYPE.FACEBOOK or loginType == SDKManager.BF_LOGIN_TYPE.GOOGLE then
if loginType == SDKManager.BF_LOGIN_TYPE.FACEBOOK or loginType == SDKManager.BF_LOGIN_TYPE.GOOGLE or loginType == SDKManager.BF_LOGIN_TYPE.VKID then
CS.BF.BFMain.Instance.SDKMgr.BFLoginSDKMgr:SetLuaLogoutCallback(callback)
CS.BF.BFMain.Instance.SDKMgr.BFLoginSDKMgr:Logout(loginType)
else
@ -478,9 +653,12 @@ function SDKManager:logout(callback, loginType)
Logger.log("当前正在登出中")
return
end
self.isLogouting = true
self:_logout(function(code, msg)
if code == SDKManager.BF_LOGIN_RESULT.Success then
if (code == SDKManager.BF_LOGIN_RESULT.Success) then
if callback then
callback()
end
@ -488,7 +666,9 @@ function SDKManager:logout(callback, loginType)
if msg and msg ~= "" then
local jData = json.decode(msg)
if jData then
Logger.logError("登出失败 result:%s type:%s msg:%s", code, jData.loginType, jData.msg)
local type = jData.loginType
local msg = jData.msg
Logger.logError("登出失败 result:%s type:%s msg:%s", code, type, msg)
else
Logger.logError("登出失败 result:%s", code)
end
@ -503,4 +683,105 @@ function SDKManager:logout(callback, loginType)
end, loginType)
end
function SDKManager:tryGetAFConversionData()
-- if CS.BF.BFMain.Instance.SDKMgr.BFThirdReportSDKMgr:IsGetConversionDataOver() then
-- BIReport:postDebugInfo(BIReport.DEBUG_INFO_TYPE.AF_CONVERSION_DATA, CS.BF.BFMain.Instance.SDKMgr.BFThirdReportSDKMgr:GetAFConversionData())
-- end
end
function SDKManager:tryPostAFRequestResponse()
-- if CS.BF.BFMain.Instance.SDKMgr.BFThirdReportSDKMgr:IsGetAFOnRequestResponse() then
-- local msg = string.format("code:%s, msg:%s", CS.BF.BFMain.Instance.SDKMgr.BFThirdReportSDKMgr:GetAFOnRequestResponseStatusCode(), CS.BF.BFMain.Instance.SDKMgr.BFThirdReportSDKMgr:GetAFOnRequestResponseErrorDescription())
-- BIReport:postDebugInfo(BIReport.DEBUG_INFO_TYPE.AF_ON_REQUEST_RESPONSE, msg)
-- end
end
function SDKManager:getAFConversionObj()
-- if self._afConversionObj == nil then
-- if CS.BF.BFMain.Instance.SDKMgr.BFThirdReportSDKMgr:IsGetConversionDataOver() then
-- local data = CS.BF.BFMain.Instance.SDKMgr.BFThirdReportSDKMgr:GetAFConversionData()
-- if data and data ~= "" then
-- self._afConversionObj = json.decode(data)
-- end
-- end
-- end
-- return self._afConversionObj
end
-- 是否显示GDPR条例
function SDKManager:isPrivacyOptionsRequired()
return false
-- if EDITOR_MODE then
-- return false
-- end
-- if not VersionCompatible:getIsSupportGDPR() then
-- return false
-- end
-- if CS.UnityEngine.Application.platform == CS.UnityEngine.RuntimePlatform.Android then
-- return CS.AdManager.Instance:IsPrivacyOptionsRequired()
-- elseif CS.UnityEngine.Application.platform == CS.UnityEngine.RuntimePlatform.IPhonePlayer then
-- return CS.AdManager.Instance:IsPrivacyOptionsRequired()
-- else
-- return false
-- end
end
-- 展示GDPR隐私条款
function SDKManager:showPrivacyOptionsForm()
-- if not VersionCompatible:getIsSupportGDPR() then
-- return
-- end
-- if CS.UnityEngine.Application.platform == CS.UnityEngine.RuntimePlatform.Android then
-- CS.AdManager.Instance:ShowPrivacyOptionsForm()
-- elseif CS.UnityEngine.Application.platform == CS.UnityEngine.RuntimePlatform.IPhonePlayer then
-- CS.AdManager.Instance:ShowPrivacyOptionsForm()
-- end
end
function SDKManager:requestStoreReview()
if VersionCompatible:supportRuStoreReview() then
CS.BF.BFMain.Instance.SDKMgr.BFNativeSDKMgr:RuRequestStoreReview()
else
CS.BF.BFMain.Instance.SDKMgr.BFNativeSDKMgr:RequestStoreReview()
end
end
--@region dukpay
function SDKManager:initDukpayOrders(orders)
if SDKPayMgr.initUncompleteOrders then
SDKPayMgr:initUncompleteOrders(orders)
end
end
function SDKManager:onServerPushDukpay(data)
if data and SDKPayMgr.handleCompleteOrder then
SDKPayMgr:handleCompleteOrder(data.order)
end
end
--@endregion
-- 初始化deeplink
function SDKManager:initDeepLink()
-- 注册监听
CS.BF.BFMain.Instance.SDKMgr.DeepLinkMgr:SetLuaDeepLinkActiveCallback(function(deeplinkUrl)
local deeplinkParams
if deeplinkUrl and deeplinkUrl ~= "" then
deeplinkParams = GFunc.getUrlParams(deeplinkUrl)
end
if deeplinkParams then
Logger.printTable(deeplinkParams)
end
end)
end
-- 获取deeplink url
function SDKManager:getDeepLinkUrl()
if VersionCompatible:supportDeepLink() then
return CS.BF.BFMain.Instance.SDKMgr.DeepLinkMgr:GetDeepLinkURL()
else
return ""
end
end
return SDKManager

View File

@ -40,11 +40,15 @@ end
function SDKPayDefaultManager:getPurchaseArgs(purchaseToken, uuid, channelOrderId, productId)
local args = {
channel = self:getSDKPayType(),
params = {uuid, productId}
params = {tostring(uuid), tostring(productId)}
}
return args
end
function SDKPayDefaultManager:getPurchaseArgs2(purchaseToken, uuid, channelOrderId, productId)
return self:getPurchaseArgs(purchaseToken, uuid, channelOrderId, productId)
end
-- 获取支付方式,目前只有google支付
function SDKPayDefaultManager:getIsSupportSDKPay()
return false
@ -72,7 +76,7 @@ function SDKPayDefaultManager:doUncompleteOrder(callback, productId)
end
-- sdk将已完成的订单消耗掉
function SDKPayDefaultManager:consumePurchase(token, callback)
function SDKPayDefaultManager:consumePurchase(token, callback, debugInfo)
end
return SDKPayDefaultManager

View File

@ -45,10 +45,11 @@ function SDKPayGoogleManager:queryProducts(callback)
local inAppList = {} -- 内购类
local subsList = {} -- 订阅list
for _, rechargeInfo in ipairs(rechargeCfg) do
local payId = rechargeInfo[VersionCompatible:getRechargePayId()]
if rechargeInfo.subscribe then
table.insert(subsList, rechargeInfo.payId)
table.insert(subsList, payId)
else
table.insert(inAppList, rechargeInfo.payId)
table.insert(inAppList, payId)
end
end
self.products = {}
@ -221,7 +222,13 @@ function SDKPayGoogleManager:getProductPriceAmountMicros(skuId)
if self.products and #self.products > 0 then
for _, data in ipairs(self.products) do
if data.sku == skuId then
return data.priceAmountMicros
--[[string (int64 format)
//100 1.99 priceAmountMicros 1990000]]
local value = tonumber(data.priceAmountMicros or 0)
if value then
value = value / 1000000
end
return value or 0
end
end
end
@ -270,14 +277,14 @@ function SDKPayGoogleManager:checkPay(productId, callback)
callback(0)
elseif code == 1 then -- 指定的productId存在支付状态中的订单
local params = {
content = I18N:getGlobalText(I18N.GlobalConst.SETTING_DESC_23),
content = I18N:getGlobalText(I18N.GlobalConst.SETTINGS_DESC_38),
boxType = GConst.MESSAGE_BOX_TYPE.MB_OK,
okText = I18N:getGlobalText(I18N.GlobalConst.BTN_TEXT_OK),
}
GFunc.showMessageBox(params)
elseif code == 2 then -- 指定的productId存在未完成的订单消耗失败的情况
local params = {
content = I18N:getGlobalText(I18N.GlobalConst.SETTING_DESC_23),
content = I18N:getGlobalText(I18N.GlobalConst.SETTINGS_DESC_38),
boxType = GConst.MESSAGE_BOX_TYPE.MB_OK,
okText = I18N:getGlobalText(I18N.GlobalConst.BTN_TEXT_OK),
}
@ -296,14 +303,14 @@ function SDKPayGoogleManager:checkPay(productId, callback)
callback(0)
elseif code == 1 then -- 指定的productId存在支付状态中的订单
local params = {
content = I18N:getGlobalText(I18N.GlobalConst.SETTING_DESC_23),
content = I18N:getGlobalText(I18N.GlobalConst.SETTINGS_DESC_38),
boxType = GConst.MESSAGE_BOX_TYPE.MB_OK,
okText = I18N:getGlobalText(I18N.GlobalConst.BTN_TEXT_OK),
}
GFunc.showMessageBox(params)
elseif code == 2 then -- 指定的productId存在未完成的订单消耗失败的情况
local params = {
content = I18N:getGlobalText(I18N.GlobalConst.SETTING_DESC_23),
content = I18N:getGlobalText(I18N.GlobalConst.SETTINGS_DESC_38),
boxType = GConst.MESSAGE_BOX_TYPE.MB_OK,
okText = I18N:getGlobalText(I18N.GlobalConst.BTN_TEXT_OK),
}
@ -355,12 +362,12 @@ function SDKPayGoogleManager:doGooglePay(productId, orderId, rechargeId, giftTyp
end
elseif code == 1 then
-- 支付取消
GFunc.showToast(I18N:getGlobalText(I18N.GlobalConst.SETTING_DESC_25))
BIReport:postPayCancel(productId, orderId, rechargeId, giftType, giftId)
GFunc.showToast(I18N:getGlobalText(I18N.GlobalConst.SETTINGS_DESC_37))
BIReport:postPayCancel(productId, orderId, rechargeId, giftType, giftId, false, purchaseType)
else
-- 支付失败
Logger.log("pay failed")
BIReport:postPayFailed(productId, orderId, rechargeId, msg or GConst.EMPTY_STRING, giftType, giftId)
BIReport:postPayFailed(productId, orderId, rechargeId, msg or GConst.EMPTY_STRING, giftType, giftId, false, purchaseType)
end
end)
end

View File

@ -17,51 +17,61 @@ function SDKPayiOSManager:initPay(callback)
if callback then
callback()
end
BIReport:postPayInitSuccess()
BIReport:postPayInitStatus(BIReport.PAY_OPT_TYPE.INIT_SUC)
else
Logger.log(errorStr)
BIReport:postPayInitFailed(errorStr)
BIReport:postPayInitStatus(BIReport.PAY_OPT_TYPE.INIT_FAILED, errorStr)
end
end
CS.BF.BFMain.Instance.SDKMgr.IosPaySDKMgr.buyCallback = function(isSuccess, result, errorStr)
local reportPayParams
if result and result.transactionID and self.iosPayInfos and self.iosPayInfos[result.transactionID] then
reportPayParams = self.iosPayInfos[result.transactionID]
end
BIReport:postDebugInfo(BIReport.DEBUG_INFO_TYPE.PAY, "buyCallback(init) -- success:" .. tostring(isSuccess))
if isSuccess then
if self.handleUncompleteIosOrder then
local payParams = self.iosPayInfos[result.transactionID]
local needConsumePurchase = true
if payParams ~= nil and payParams.order then
PayManager:requestRewards(result.receipt, payParams.order, result.transactionID, payParams.productId)
needConsumePurchase = false
end
if needConsumePurchase then
self:delIosPayInfo(result.transactionID)
self:delIosOrder(result.definition.id)
self:consumePurchase(result.definition.id)
local giftId = tonumber(payParams.giftId)
local purchaseType = tonumber(payParams.purchaseType)
local giftType = PayManager:getGiftType(purchaseType, giftId)
local rechargeId = PayManager:getPackageRechargeId(purchaseType, giftId)
BIReport:postPayFailed(result.definition.id, result.transactionID, rechargeId, "error order", giftType, giftId)
end
else
PayManager:requestRewards(result.receipt, nil, result.transactionID, result.definition.id, nil, nil, nil, nil, nil, true)
BIReport:postPayTryReissueOrder(result.definition.id, result.transactionID)
end
BIReport:postDebugInfo(BIReport.DEBUG_INFO_TYPE.PAY, "buyCallback(init) -- payParams is not nil:" .. tostring(payParams ~= nil))
else
local purchaseType
if reportPayParams then
purchaseType = tonumber(reportPayParams.purchaseType)
end
-- 回调时机太早的话,就先保存起来,等后续补单的时候一起补
local order = self.iosOrders[result.definition.id]
if order then
self:saveIosPayInfo(result.transactionID, result.receipt, order.order, result.definition.id, order.purchaseType, order.giftId)
self:delIosOrder(result.definition.id)
else
-- 之前没有记录只能算掉单了
self:delIosPayInfo(result.transactionID)
self:delIosOrder(result.definition.id)
self:consumePurchase(result.definition.id)
BIReport:postPayFailed(result.definition.id, result.transactionID, nil, "not have order")
BIReport:postPayFailed(result.definition.id, result.transactionID, nil, "not have order", nil, nil, nil, purchaseType)
self:saveIosPayInfo(result.transactionID, result.receipt, nil, result.definition.id)
end
BIReport:postDebugInfo(BIReport.DEBUG_INFO_TYPE.PAY, "buyCallback(init) -- order is not nil:" .. tostring(order ~= nil))
end
if result then
BIReport:postPayResendOrder(result.definition and result.definition.id, result.transactionID)
else
BIReport:postPayResendOrder()
end
else
local purchaseType
if reportPayParams then
purchaseType = tonumber(reportPayParams.purchaseType)
end
if errorStr and errorStr ~= "" then
BIReport:postPayFailed(result.definition.id, result.transactionID, nil, errorStr)
BIReport:postPayFailed(result.definition.id, result.transactionID, nil, errorStr, nil, nil, nil, purchaseType)
else
BIReport:postPayFailed(result.definition.id, result.transactionID, nil, "1")
BIReport:postPayFailed(result.definition.id, result.transactionID, nil, "1", nil, nil, nil, purchaseType)
end
end
end
@ -69,7 +79,8 @@ function SDKPayiOSManager:initPay(callback)
local rechargeCfg = ConfigManager:getConfig("recharge")
local products = {}
for i,v in ipairs(rechargeCfg) do
table.insert(products, {productId = v.payId, type = CS.UnityEngine.Purchasing.ProductType.Consumable})
local payId = v[VersionCompatible:getRechargePayId()]
table.insert(products, {productId = payId, type = CS.UnityEngine.Purchasing.ProductType.Consumable})
end
CS.BF.BFMain.Instance.SDKMgr.IosPaySDKMgr:Init(products)
end
@ -81,10 +92,13 @@ function SDKPayiOSManager:queryProducePrice()
local rechargeCfg = ConfigManager:getConfig("recharge")
self.products = {}
for _, v in ipairs(rechargeCfg) do
local price = CS.BF.BFMain.Instance.SDKMgr.IosPaySDKMgr:GetLocalizedPrice(v.payId)
local payId = v[VersionCompatible:getRechargePayId()]
local price = CS.BF.BFMain.Instance.SDKMgr.IosPaySDKMgr:GetLocalizedPrice(payId)
local currencyCode = CS.BF.BFMain.Instance.SDKMgr.IosPaySDKMgr:GetLocalizedIsoCurrencyCode(payId)
local priceAmountMicros = CS.BF.BFMain.Instance.SDKMgr.IosPaySDKMgr:GetLocalizedPriceAmount(payId)
if price and price ~= "" then
Logger.log("product = %s, price = %s", v.payId, price)
table.insert(self.products, {sku = v.payId, price = price})
Logger.log("product = %s, price = %s", payId, price)
table.insert(self.products, {sku = payId, price = price, priceCurrencyCode = currencyCode, priceAmountMicros = priceAmountMicros})
end
end
return self.products
@ -103,6 +117,7 @@ function SDKPayiOSManager:doUncompleteOrder(callback, productId)
local orders = self.iosPayInfos
if orders == nil then
self.handleUncompleteOrder = false
BIReport:postDebugInfo(BIReport.DEBUG_INFO_TYPE.PAY, "doUncompleteOrder orders == nil")
return callback and callback()
end
local uncompleteList = {}
@ -111,6 +126,7 @@ function SDKPayiOSManager:doUncompleteOrder(callback, productId)
end
if #uncompleteList <= 0 then
self.handleUncompleteOrder = false
BIReport:postDebugInfo(BIReport.DEBUG_INFO_TYPE.PAY, "doUncompleteOrder #uncompleteList <= 0")
return callback and callback()
end
local index = 1
@ -125,15 +141,24 @@ function SDKPayiOSManager:doUncompleteOrder(callback, productId)
index = index + 1
handleOrder(uncompleteList[index])
end)
BIReport:postPayDoUncompleteOrder(uncompleteOrder.productId, uncompleteOrder.transactionID, uncompleteOrder.order)
elseif uncompleteOrder.transactionID then
PayManager:requestRewards(uncompleteOrder.receipt, nil, uncompleteOrder.transactionID, uncompleteOrder.productId, true, function()
index = index + 1
handleOrder(uncompleteList[index])
end, nil, nil, nil, true)
BIReport:postPayTryReissueOrder(uncompleteOrder.productId, uncompleteOrder.transactionID)
else
SDKManager:delIosPayInfo(uncompleteOrder.transactionID)
SDKManager:delIosOrder(uncompleteOrder.productId)
self:consumePurchase(uncompleteOrder.productId, function()
index = index + 1
handleOrder(uncompleteList[index])
end)
end, "handle order")
BIReport:postPayDoUncompleteOrder(uncompleteOrder.productId, uncompleteOrder.transactionID)
end
end
BIReport:postDebugInfo(BIReport.DEBUG_INFO_TYPE.PAY, "doUncompleteOrder handleOrder:" .. tostring(#uncompleteList))
handleOrder(uncompleteList[index])
end
@ -204,6 +229,15 @@ function SDKPayiOSManager:getPurchaseArgs(purchaseToken, uuid, channelOrderId, p
return args
end
-- 异常订单时,使用该参数通知服务器校验
function SDKPayiOSManager:getPurchaseArgs2(purchaseToken, uuid, channelOrderId, productId)
local args = {
channel = SDKManager.PAY_TYPE.IOS,
params = {channelOrderId}
}
return args
end
-- 获取支付方式,目前只有google支付
function SDKPayiOSManager:getIsSupportSDKPay()
return true
@ -227,7 +261,7 @@ function SDKPayiOSManager:checkPay(productId, callback)
elseif code == 1 then
-- 指定的productId存在支付状态中的订单
local params = {
content = I18N:getGlobalText(I18N.GlobalConst.SETTING_DESC_23),
content = I18N:getGlobalText(I18N.GlobalConst.SETTINGS_DESC_38),
boxType = GConst.MESSAGE_BOX_TYPE.MB_OK,
okText = I18N:getGlobalText(I18N.GlobalConst.BTN_TEXT_OK),
}
@ -235,7 +269,7 @@ function SDKPayiOSManager:checkPay(productId, callback)
elseif code == 2 then
-- 指定的productId存在未完成的订单消耗失败的情况
local params = {
content = I18N:getGlobalText(I18N.GlobalConst.SETTING_DESC_23),
content = I18N:getGlobalText(I18N.GlobalConst.SETTINGS_DESC_38),
boxType = GConst.MESSAGE_BOX_TYPE.MB_OK,
okText = I18N:getGlobalText(I18N.GlobalConst.BTN_TEXT_OK),
}
@ -254,17 +288,19 @@ function SDKPayiOSManager:pay(productId, orderId, rechargeId, giftType, purchase
end
-- sdk将已完成的订单消耗掉
function SDKPayiOSManager:consumePurchase(productId, callback)
function SDKPayiOSManager:consumePurchase(productId, callback, debugInfo)
CS.BF.BFMain.Instance.SDKMgr.IosPaySDKMgr:ConsumePurchase(productId)
if callback then
callback(0)
end
BIReport:postPayConsumeOrder(productId, debugInfo)
end
function SDKPayiOSManager:doIosPay(productId, orderId, rechargeId, giftType, purchaseType, giftId, callback)
self.blockTouch = true
UIManager:showWaitPay()
CS.BF.BFMain.Instance.SDKMgr.IosPaySDKMgr.buyCallback = function(isSuccess, result, errorStr)
BIReport:postDebugInfo(BIReport.DEBUG_INFO_TYPE.PAY, "buyCallback(pay) -- success:" .. tostring(isSuccess) .. " blockTouch:" .. tostring(self.blockTouch))
if self.blockTouch then
self.blockTouch = false
UIManager:hideWaitPay()
@ -279,9 +315,9 @@ function SDKPayiOSManager:doIosPay(productId, orderId, rechargeId, giftType, pur
end
else
if errorStr and errorStr ~= "" then
BIReport:postPayFailed(productId, orderId, rechargeId, errorStr, giftType, giftId)
BIReport:postPayFailed(productId, orderId, rechargeId, errorStr, giftType, giftId, nil, purchaseType)
else
BIReport:postPayFailed(productId, orderId, rechargeId, "1", giftType, giftId)
BIReport:postPayFailed(productId, orderId, rechargeId, "1", giftType, giftId, nil, purchaseType)
end
end
self:delIosOrder(productId)
@ -296,20 +332,26 @@ function SDKPayiOSManager:doIosPay(productId, orderId, rechargeId, giftType, pur
local order = self.iosOrders[result.definition.id]
if order then
PayManager:requestRewards(result.receipt, order.order, result.transactionID, result.definition.id)
elseif result.transactionID then -- 服务器检验
PayManager:requestRewards(result.receipt, nil, result.transactionID, result.definition.id, nil, nil, nil, nil, nil, true)
BIReport:postPayTryReissueOrder(result.definition.id, result.transactionID)
else
self:delIosPayInfo(result.transactionID)
self:delIosOrder(result.definition.id)
self:consumePurchase(result.definition.id)
self:consumePurchase(result.definition.id, nil, "pay consume")
if payParams then
local giftId = tonumber(payParams.giftId)
local purchaseType = tonumber(payParams.purchaseType)
local giftType = PayManager:getGiftType(purchaseType, giftId)
local rechargeId = PayManager:getPackageRechargeId(purchaseType, giftId)
BIReport:postPayFailed(result.definition.id, result.transactionID, rechargeId, "error order", giftType, giftId)
BIReport:postPayFailed(result.definition.id, result.transactionID, rechargeId, "error order", giftType, giftId, nil, purchaseType)
end
end
end
end
end
self:saveIosOrder(productId, orderId, purchaseType, giftId)
CS.BF.BFMain.Instance.SDKMgr.IosPaySDKMgr:SetApplicationUsername(orderId)
CS.BF.BFMain.Instance.SDKMgr.IosPaySDKMgr:Buy(productId, orderId)
end
@ -328,6 +370,8 @@ function SDKPayiOSManager:doUncompletePay(callback)
if self:_getIsIosInitialized() then
self.alreadyFinishUncompletePay = true
self:doUncompleteOrder()
BIReport:postDebugInfo(BIReport.DEBUG_INFO_TYPE.PAY, "doUncompletePay")
end
end

View File

@ -1,5 +1,274 @@
local VersionCompatible = {}
local CLIENT_VERSION = CS.BF.BFMain.CLIENT_VERSION or 0
local PACKAGE_NAME = "com.gearpaw.defenders.td.game"
local PACKAGE_NAME_RU = "com.gearpaw.defenders.td.game.ru"
local PACKAGE_NAME_RUSTORE = "com.fortune.td.game.rustore"
local PACKAGE_NAME_RUHW = "com.fortune.td.game.ru.hw"
--@region 版本相关
function VersionCompatible:canUpdateMailVersion()
return CLIENT_VERSION > 1
end
function VersionCompatible:supportDataEncryptVersion()
return CLIENT_VERSION > 1
end
function VersionCompatible:supportMonsterMoveReturnVersion()
return CLIENT_VERSION > 2
end
function VersionCompatible:supportDeepLink()
return CLIENT_VERSION > 3
end
--@endregion
--@region 包相关
function VersionCompatible:getIsGlobalPackage()
return Platform:getIdentifier() == PACKAGE_NAME
end
function VersionCompatible:getIsRUPackage()
return self:getIsPackageRU() or self:getIsPackageRUStore() or self:getIsPackageRUHW()
end
function VersionCompatible:getIsPackageRU()
return Platform:getIdentifier() == PACKAGE_NAME_RU
end
function VersionCompatible:getIsPackageRUStore()
return Platform:getIdentifier() == PACKAGE_NAME_RUSTORE
end
function VersionCompatible:getIsPackageRUHW()
return Platform:getIdentifier() == PACKAGE_NAME_RUHW
end
--@endregion
--@region 跳转相关
function VersionCompatible:getDiscordUrl()
return GConst.GameSettingConst.DISCORD_URL
end
function VersionCompatible:getDiscordUrlVN()
return GConst.GameSettingConst.DISCORD_URL_VN
end
function VersionCompatible:getFacebookUrl()
local currLanguage = I18N:getCurLanguage()
if currLanguage == GConst.LANGUAGE.CHINESE_TC or
currLanguage == GConst.LANGUAGE.CHINESE then
return GConst.GameSettingConst.FACEBOOK_URL_TW
else
return GConst.GameSettingConst.FACEBOOK_URL
end
end
function VersionCompatible:getVKUrl()
return GConst.GameSettingConst.VK_URL
end
--@endregion
--@region 支付相关
function VersionCompatible:getRechargePayId()
if self:getIsRUPackage() then
return "payId_ru"
end
return "payId_tw"
end
-- 获取支付渠道
function VersionCompatible:getPayPlatform()
if Platform:isAndroidPlatform() then
if self:getIsPackageRU() then
return "dukpay"
elseif self:getIsPackageRUStore() then
return "rustore"
elseif self:getIsPackageRUHW() then
return "hw"
end
end
return nil
end
--@endregion
--@region fb支持
function VersionCompatible:supportFb()
if self:getIsRUPackage() then
return false
end
return true
end
--@endregion
--@region AppsFlyerAdRevenue
function VersionCompatible:getIsSupportAFAdRevenue()
if self:getIsPackageRU()
or self:getIsPackageRUStore()
-- or Platform:getIdentifier() == PACKAGE_NAME_US
-- or Platform:getIdentifier() == PACKAGE_NAME_VN
then
return false
end
return true
end
--@endregion
--@region Firebase支持
function VersionCompatible:getIsSupportFirebase()
if self:getIsRUPackage() then
return false
end
return true
end
--@endregion
--@region VK支持
function VersionCompatible:getIsSupportVKBind()
if self:getIsRUPackage() then
return true
end
return false
end
function VersionCompatible:supportVK()
if self:getIsRUPackage() then
return true
end
return false
end
--@endregion
--@region Google支持
function VersionCompatible:getIsSupportGoogle()
if self:getIsRUPackage() then
return false
end
return true
end
--@endregion
function VersionCompatible:supportDiscord()
if self:getIsRUPackage() then
return false
end
return true
end
--@region 渠道分成
-- 不同渠道的支付上报分成比例
function VersionCompatible:getAFPayProportion()
-- rustore的分成比例
if self:getIsPackageRUStore() and Platform:isAndroidPlatform() then
return 0.62976
end
return 1
end
--@endregion
--@region 俄罗斯相关
function VersionCompatible:getIsSupportGDPR()
if self:getIsRUPackage() then
return false
end
return true
end
--@region dakpay
function VersionCompatible:supportRuDukpay()
if self:getIsPackageRU() and Platform:isAndroidPlatform() then
return true
end
return false
end
--@endregion
--@region rustore
function VersionCompatible:supportRuStorePay()
if self:getIsPackageRUStore() then
return true
end
return false
end
-- android 俄罗斯商店好评
function VersionCompatible:supportRuStoreReview()
if self:getIsPackageRUStore() and Platform:isAndroidPlatform() then
return true
end
return false
end
--@endregion
--@region hw支付
function VersionCompatible:supportRuHW()
if self:getIsPackageRUHW() and Platform:isAndroidPlatform() then
return true
end
return false
end
--@endregion
--@endregion
--@region 渠道相关
-- 是否有俄语
function VersionCompatible:getIsSupportRussian()
if EDITOR_MODE then
return true
end
return self:getIsRUPackage()
end
function VersionCompatible:getIsVnChannel()
return I18N:getCurLanguage() == GConst.LANGUAGE.VIETNAMESE
end
--@endregion
function VersionCompatible:getServiceUrl()
return GConst.GameSettingConst.SERVICE_URL
end
function VersionCompatible:getPrivacyUrl()
return GConst.GameSettingConst.PRIVACY_URL
end
--@region 深度链接相关
-- 支持日志
function VersionCompatible:supportLogInReleaseEnv()
if self:supportDeepLink() then
return CS.BF.BFMain.DPSupportLog
end
return false
end
-- 支持GM
function VersionCompatible:supportGMInReleaseEnv()
if self:supportDeepLink() then
return CS.BF.BFMain.DPSupportGM
end
return false
end
-- 支持修改包名
function VersionCompatible:supportSimulatedPackageName()
if self._supportSimulatedPackageName == nil then
if CS.BF.BFMain.DPPackageName == GConst.EMPTY_STRING then
self._supportSimulatedPackageName = false
else
if CS.BF.BFMain.DPPackageName == PACKAGE_NAME or
CS.BF.BFMain.DPPackageName == PACKAGE_NAME_RU then
self._supportSimulatedPackageName = true
else
self._supportSimulatedPackageName = false
end
end
end
return self._supportSimulatedPackageName
end
--#endregion
return VersionCompatible

View File

@ -2285,8 +2285,8 @@ local act_bounty = {
{
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=68,
["id_for_nothing"]="UAA=",
["id"]=6,
["id_for_nothing"]="UA==",
["num"]=1,
["num_for_nothing"]="Vw=="
}
@ -2295,8 +2295,8 @@ local act_bounty = {
{
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=68,
["id_for_nothing"]="UAA=",
["id"]=6,
["id_for_nothing"]="UA==",
["num"]=10,
["num_for_nothing"]="Vwg="
},
@ -2319,8 +2319,8 @@ local act_bounty = {
{
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=68,
["id_for_nothing"]="UAA=",
["id"]=6,
["id_for_nothing"]="UA==",
["num"]=1,
["num_for_nothing"]="Vw=="
}
@ -2329,8 +2329,8 @@ local act_bounty = {
{
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=68,
["id_for_nothing"]="UAA=",
["id"]=6,
["id_for_nothing"]="UA==",
["num"]=10,
["num_for_nothing"]="Vwg="
},
@ -2339,8 +2339,8 @@ local act_bounty = {
["type_for_nothing"]="Vw==",
["id"]=2,
["id_for_nothing"]="VA==",
["num"]=300,
["num_for_nothing"]="VQhc"
["num"]=600,
["num_for_nothing"]="UAhc"
}
},
["reward_pro_pay"]=1064000001
@ -2353,8 +2353,8 @@ local act_bounty = {
{
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=68,
["id_for_nothing"]="UAA=",
["id"]=6,
["id_for_nothing"]="UA==",
["num"]=1,
["num_for_nothing"]="Vw=="
}
@ -2363,8 +2363,8 @@ local act_bounty = {
{
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=68,
["id_for_nothing"]="UAA=",
["id"]=6,
["id_for_nothing"]="UA==",
["num"]=10,
["num_for_nothing"]="Vwg="
},
@ -2373,8 +2373,8 @@ local act_bounty = {
["type_for_nothing"]="Vw==",
["id"]=2,
["id_for_nothing"]="VA==",
["num"]=300,
["num_for_nothing"]="VQhc"
["num"]=600,
["num_for_nothing"]="UAhc"
}
},
["reward_pro_pay"]=1064000001
@ -2387,8 +2387,8 @@ local act_bounty = {
{
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=68,
["id_for_nothing"]="UAA=",
["id"]=6,
["id_for_nothing"]="UA==",
["num"]=1,
["num_for_nothing"]="Vw=="
}
@ -2397,8 +2397,8 @@ local act_bounty = {
{
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=68,
["id_for_nothing"]="UAA=",
["id"]=6,
["id_for_nothing"]="UA==",
["num"]=10,
["num_for_nothing"]="Vwg="
},
@ -2407,8 +2407,8 @@ local act_bounty = {
["type_for_nothing"]="Vw==",
["id"]=2,
["id_for_nothing"]="VA==",
["num"]=300,
["num_for_nothing"]="VQhc"
["num"]=600,
["num_for_nothing"]="UAhc"
}
},
["reward_pro_pay"]=1064000001
@ -2421,8 +2421,8 @@ local act_bounty = {
{
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=68,
["id_for_nothing"]="UAA=",
["id"]=6,
["id_for_nothing"]="UA==",
["num"]=1,
["num_for_nothing"]="Vw=="
}
@ -2431,8 +2431,8 @@ local act_bounty = {
{
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=68,
["id_for_nothing"]="UAA=",
["id"]=6,
["id_for_nothing"]="UA==",
["num"]=10,
["num_for_nothing"]="Vwg="
},
@ -2441,8 +2441,8 @@ local act_bounty = {
["type_for_nothing"]="Vw==",
["id"]=2,
["id_for_nothing"]="VA==",
["num"]=300,
["num_for_nothing"]="VQhc"
["num"]=600,
["num_for_nothing"]="UAhc"
}
},
["reward_pro_pay"]=1064000001
@ -2473,8 +2473,8 @@ local act_bounty = {
{
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=209,
["id_for_nothing"]="VAhV",
["id"]=20,
["id_for_nothing"]="VAg=",
["num"]=1,
["num_for_nothing"]="Vw=="
}
@ -2501,14 +2501,14 @@ local act_bounty = {
["type_for_nothing"]="Vw==",
["id"]=5,
["id_for_nothing"]="Uw==",
["num"]=10,
["num_for_nothing"]="Vwg="
["num"]=20,
["num_for_nothing"]="VAg="
},
{
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=209,
["id_for_nothing"]="VAhV",
["id"]=20,
["id_for_nothing"]="VAg=",
["num"]=1,
["num_for_nothing"]="Vw=="
}
@ -2535,14 +2535,14 @@ local act_bounty = {
["type_for_nothing"]="Vw==",
["id"]=5,
["id_for_nothing"]="Uw==",
["num"]=10,
["num_for_nothing"]="Vwg="
["num"]=20,
["num_for_nothing"]="VAg="
},
{
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=209,
["id_for_nothing"]="VAhV",
["id"]=20,
["id_for_nothing"]="VAg=",
["num"]=1,
["num_for_nothing"]="Vw=="
}
@ -2569,14 +2569,14 @@ local act_bounty = {
["type_for_nothing"]="Vw==",
["id"]=5,
["id_for_nothing"]="Uw==",
["num"]=10,
["num_for_nothing"]="Vwg="
["num"]=20,
["num_for_nothing"]="VAg="
},
{
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=209,
["id_for_nothing"]="VAhV",
["id"]=20,
["id_for_nothing"]="VAg=",
["num"]=1,
["num_for_nothing"]="Vw=="
}
@ -2609,8 +2609,8 @@ local act_bounty = {
{
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=209,
["id_for_nothing"]="VAhV",
["id"]=20,
["id_for_nothing"]="VAg=",
["num"]=1,
["num_for_nothing"]="Vw=="
}
@ -2625,26 +2625,26 @@ local act_bounty = {
{
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=68,
["id_for_nothing"]="UAA=",
["num"]=1,
["num_for_nothing"]="Vw=="
["id"]=5,
["id_for_nothing"]="Uw==",
["num"]=2,
["num_for_nothing"]="VA=="
}
},
["reward_pro"]={
{
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=68,
["id_for_nothing"]="UAA=",
["num"]=10,
["num_for_nothing"]="Vwg="
["id"]=5,
["id_for_nothing"]="Uw==",
["num"]=20,
["num_for_nothing"]="VAg="
},
{
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=209,
["id_for_nothing"]="VAhV",
["id"]=20,
["id_for_nothing"]="VAg=",
["num"]=1,
["num_for_nothing"]="Vw=="
}
@ -2659,26 +2659,26 @@ local act_bounty = {
{
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=68,
["id_for_nothing"]="UAA=",
["num"]=1,
["num_for_nothing"]="Vw=="
["id"]=5,
["id_for_nothing"]="Uw==",
["num"]=2,
["num_for_nothing"]="VA=="
}
},
["reward_pro"]={
{
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=68,
["id_for_nothing"]="UAA=",
["num"]=10,
["num_for_nothing"]="Vwg="
["id"]=5,
["id_for_nothing"]="Uw==",
["num"]=20,
["num_for_nothing"]="VAg="
},
{
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=209,
["id_for_nothing"]="VAhV",
["id"]=20,
["id_for_nothing"]="VAg=",
["num"]=1,
["num_for_nothing"]="Vw=="
}
@ -2693,26 +2693,26 @@ local act_bounty = {
{
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=68,
["id_for_nothing"]="UAA=",
["num"]=1,
["num_for_nothing"]="Vw=="
["id"]=5,
["id_for_nothing"]="Uw==",
["num"]=2,
["num_for_nothing"]="VA=="
}
},
["reward_pro"]={
{
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=68,
["id_for_nothing"]="UAA=",
["num"]=10,
["num_for_nothing"]="Vwg="
["id"]=5,
["id_for_nothing"]="Uw==",
["num"]=20,
["num_for_nothing"]="VAg="
},
{
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=209,
["id_for_nothing"]="VAhV",
["id"]=20,
["id_for_nothing"]="VAg=",
["num"]=1,
["num_for_nothing"]="Vw=="
}
@ -2727,26 +2727,26 @@ local act_bounty = {
{
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=68,
["id_for_nothing"]="UAA=",
["num"]=1,
["num_for_nothing"]="Vw=="
["id"]=5,
["id_for_nothing"]="Uw==",
["num"]=2,
["num_for_nothing"]="VA=="
}
},
["reward_pro"]={
{
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=68,
["id_for_nothing"]="UAA=",
["num"]=10,
["num_for_nothing"]="Vwg="
["id"]=5,
["id_for_nothing"]="Uw==",
["num"]=20,
["num_for_nothing"]="VAg="
},
{
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=209,
["id_for_nothing"]="VAhV",
["id"]=20,
["id_for_nothing"]="VAg=",
["num"]=1,
["num_for_nothing"]="Vw=="
}
@ -2761,26 +2761,26 @@ local act_bounty = {
{
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=68,
["id_for_nothing"]="UAA=",
["num"]=1,
["num_for_nothing"]="Vw=="
["id"]=5,
["id_for_nothing"]="Uw==",
["num"]=2,
["num_for_nothing"]="VA=="
}
},
["reward_pro"]={
{
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=68,
["id_for_nothing"]="UAA=",
["num"]=10,
["num_for_nothing"]="Vwg="
["id"]=5,
["id_for_nothing"]="Uw==",
["num"]=20,
["num_for_nothing"]="VAg="
},
{
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=209,
["id_for_nothing"]="VAhV",
["id"]=20,
["id_for_nothing"]="VAg=",
["num"]=1,
["num_for_nothing"]="Vw=="
}
@ -2795,26 +2795,26 @@ local act_bounty = {
{
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=2,
["id_for_nothing"]="VA==",
["num"]=300,
["num_for_nothing"]="VQhc"
["id"]=5,
["id_for_nothing"]="Uw==",
["num"]=2,
["num_for_nothing"]="VA=="
}
},
["reward_pro"]={
{
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=2,
["id_for_nothing"]="VA==",
["num"]=2000,
["num_for_nothing"]="VAhcAw=="
["id"]=5,
["id_for_nothing"]="Uw==",
["num"]=20,
["num_for_nothing"]="VAg="
},
{
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=209,
["id_for_nothing"]="VAhV",
["id"]=20,
["id_for_nothing"]="VAg=",
["num"]=1,
["num_for_nothing"]="Vw=="
}
@ -2829,26 +2829,26 @@ local act_bounty = {
{
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=2,
["id_for_nothing"]="VA==",
["num"]=300,
["num_for_nothing"]="VQhc"
["id"]=5,
["id_for_nothing"]="Uw==",
["num"]=2,
["num_for_nothing"]="VA=="
}
},
["reward_pro"]={
{
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=2,
["id_for_nothing"]="VA==",
["num"]=2000,
["num_for_nothing"]="VAhcAw=="
["id"]=5,
["id_for_nothing"]="Uw==",
["num"]=20,
["num_for_nothing"]="VAg="
},
{
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=209,
["id_for_nothing"]="VAhV",
["id"]=20,
["id_for_nothing"]="VAg=",
["num"]=1,
["num_for_nothing"]="Vw=="
}
@ -2863,26 +2863,26 @@ local act_bounty = {
{
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=2,
["id_for_nothing"]="VA==",
["num"]=300,
["num_for_nothing"]="VQhc"
["id"]=5,
["id_for_nothing"]="Uw==",
["num"]=2,
["num_for_nothing"]="VA=="
}
},
["reward_pro"]={
{
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=2,
["id_for_nothing"]="VA==",
["num"]=2000,
["num_for_nothing"]="VAhcAw=="
["id"]=5,
["id_for_nothing"]="Uw==",
["num"]=20,
["num_for_nothing"]="VAg="
},
{
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=209,
["id_for_nothing"]="VAhV",
["id"]=20,
["id_for_nothing"]="VAg=",
["num"]=1,
["num_for_nothing"]="Vw=="
}
@ -2897,26 +2897,26 @@ local act_bounty = {
{
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=2,
["id_for_nothing"]="VA==",
["num"]=300,
["num_for_nothing"]="VQhc"
["id"]=5,
["id_for_nothing"]="Uw==",
["num"]=2,
["num_for_nothing"]="VA=="
}
},
["reward_pro"]={
{
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=2,
["id_for_nothing"]="VA==",
["num"]=2000,
["num_for_nothing"]="VAhcAw=="
["id"]=5,
["id_for_nothing"]="Uw==",
["num"]=20,
["num_for_nothing"]="VAg="
},
{
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=209,
["id_for_nothing"]="VAhV",
["id"]=20,
["id_for_nothing"]="VAg=",
["num"]=1,
["num_for_nothing"]="Vw=="
}
@ -2931,26 +2931,26 @@ local act_bounty = {
{
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=2,
["id_for_nothing"]="VA==",
["num"]=300,
["num_for_nothing"]="VQhc"
["id"]=5,
["id_for_nothing"]="Uw==",
["num"]=2,
["num_for_nothing"]="VA=="
}
},
["reward_pro"]={
{
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=2,
["id_for_nothing"]="VA==",
["num"]=2000,
["num_for_nothing"]="VAhcAw=="
["id"]=5,
["id_for_nothing"]="Uw==",
["num"]=20,
["num_for_nothing"]="VAg="
},
{
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=209,
["id_for_nothing"]="VAhV",
["id"]=20,
["id_for_nothing"]="VAg=",
["num"]=1,
["num_for_nothing"]="Vw=="
}
@ -4037,8 +4037,8 @@ local act_bounty = {
{
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=209,
["id_for_nothing"]="VAhV",
["id"]=20,
["id_for_nothing"]="VAg=",
["num"]=1,
["num_for_nothing"]="Vw=="
}
@ -4065,14 +4065,14 @@ local act_bounty = {
["type_for_nothing"]="Vw==",
["id"]=5,
["id_for_nothing"]="Uw==",
["num"]=10,
["num_for_nothing"]="Vwg="
["num"]=20,
["num_for_nothing"]="VAg="
},
{
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=209,
["id_for_nothing"]="VAhV",
["id"]=20,
["id_for_nothing"]="VAg=",
["num"]=1,
["num_for_nothing"]="Vw=="
}
@ -4099,14 +4099,14 @@ local act_bounty = {
["type_for_nothing"]="Vw==",
["id"]=5,
["id_for_nothing"]="Uw==",
["num"]=10,
["num_for_nothing"]="Vwg="
["num"]=20,
["num_for_nothing"]="VAg="
},
{
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=209,
["id_for_nothing"]="VAhV",
["id"]=20,
["id_for_nothing"]="VAg=",
["num"]=1,
["num_for_nothing"]="Vw=="
}
@ -4133,14 +4133,14 @@ local act_bounty = {
["type_for_nothing"]="Vw==",
["id"]=5,
["id_for_nothing"]="Uw==",
["num"]=10,
["num_for_nothing"]="Vwg="
["num"]=20,
["num_for_nothing"]="VAg="
},
{
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=209,
["id_for_nothing"]="VAhV",
["id"]=20,
["id_for_nothing"]="VAg=",
["num"]=1,
["num_for_nothing"]="Vw=="
}
@ -4173,8 +4173,8 @@ local act_bounty = {
{
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=209,
["id_for_nothing"]="VAhV",
["id"]=20,
["id_for_nothing"]="VAg=",
["num"]=1,
["num_for_nothing"]="Vw=="
}
@ -4189,8 +4189,8 @@ local act_bounty = {
{
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=68,
["id_for_nothing"]="UAA=",
["id"]=6,
["id_for_nothing"]="UA==",
["num"]=1,
["num_for_nothing"]="Vw=="
}
@ -4199,16 +4199,16 @@ local act_bounty = {
{
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=68,
["id_for_nothing"]="UAA=",
["id"]=6,
["id_for_nothing"]="UA==",
["num"]=10,
["num_for_nothing"]="Vwg="
},
{
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=209,
["id_for_nothing"]="VAhV",
["id"]=20,
["id_for_nothing"]="VAg=",
["num"]=1,
["num_for_nothing"]="Vw=="
}
@ -4223,8 +4223,8 @@ local act_bounty = {
{
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=68,
["id_for_nothing"]="UAA=",
["id"]=6,
["id_for_nothing"]="UA==",
["num"]=1,
["num_for_nothing"]="Vw=="
}
@ -4233,16 +4233,16 @@ local act_bounty = {
{
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=68,
["id_for_nothing"]="UAA=",
["id"]=6,
["id_for_nothing"]="UA==",
["num"]=10,
["num_for_nothing"]="Vwg="
},
{
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=209,
["id_for_nothing"]="VAhV",
["id"]=20,
["id_for_nothing"]="VAg=",
["num"]=1,
["num_for_nothing"]="Vw=="
}
@ -4257,8 +4257,8 @@ local act_bounty = {
{
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=68,
["id_for_nothing"]="UAA=",
["id"]=6,
["id_for_nothing"]="UA==",
["num"]=1,
["num_for_nothing"]="Vw=="
}
@ -4267,16 +4267,16 @@ local act_bounty = {
{
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=68,
["id_for_nothing"]="UAA=",
["id"]=6,
["id_for_nothing"]="UA==",
["num"]=10,
["num_for_nothing"]="Vwg="
},
{
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=209,
["id_for_nothing"]="VAhV",
["id"]=20,
["id_for_nothing"]="VAg=",
["num"]=1,
["num_for_nothing"]="Vw=="
}
@ -4291,8 +4291,8 @@ local act_bounty = {
{
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=68,
["id_for_nothing"]="UAA=",
["id"]=6,
["id_for_nothing"]="UA==",
["num"]=1,
["num_for_nothing"]="Vw=="
}
@ -4301,16 +4301,16 @@ local act_bounty = {
{
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=68,
["id_for_nothing"]="UAA=",
["id"]=6,
["id_for_nothing"]="UA==",
["num"]=10,
["num_for_nothing"]="Vwg="
},
{
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=209,
["id_for_nothing"]="VAhV",
["id"]=20,
["id_for_nothing"]="VAg=",
["num"]=1,
["num_for_nothing"]="Vw=="
}
@ -4325,8 +4325,8 @@ local act_bounty = {
{
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=68,
["id_for_nothing"]="UAA=",
["id"]=6,
["id_for_nothing"]="UA==",
["num"]=1,
["num_for_nothing"]="Vw=="
}
@ -4335,16 +4335,16 @@ local act_bounty = {
{
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=68,
["id_for_nothing"]="UAA=",
["id"]=6,
["id_for_nothing"]="UA==",
["num"]=10,
["num_for_nothing"]="Vwg="
},
{
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=209,
["id_for_nothing"]="VAhV",
["id"]=20,
["id_for_nothing"]="VAg=",
["num"]=1,
["num_for_nothing"]="Vw=="
}

View File

@ -6,8 +6,8 @@ local act_gift = {
{
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=3003,
["id_for_nothing"]="VQhcAA==",
["id"]=15001,
["id_for_nothing"]="Vw1cA2Q=",
["num"]=1,
["num_for_nothing"]="Vw=="
},
@ -87,8 +87,8 @@ local act_gift = {
{
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=3004,
["id_for_nothing"]="VQhcBw==",
["id"]=25001,
["id_for_nothing"]="VA1cA2Q=",
["num"]=1,
["num_for_nothing"]="Vw=="
},
@ -166,10 +166,10 @@ local act_gift = {
["recharge_id"]=10,
["reward"]={
{
["type"]=4,
["type_for_nothing"]="Ug==",
["id"]=405,
["id_for_nothing"]="UghZ",
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=5,
["id_for_nothing"]="Uw==",
["num"]=1,
["num_for_nothing"]="Vw=="
},
@ -198,10 +198,10 @@ local act_gift = {
["type"]=1,
["reward"]={
{
["type"]=4,
["type_for_nothing"]="Ug==",
["id"]=405,
["id_for_nothing"]="UghZ",
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=5,
["id_for_nothing"]="Uw==",
["num"]=1,
["num_for_nothing"]="Vw=="
},
@ -222,10 +222,10 @@ local act_gift = {
["type"]=1,
["reward"]={
{
["type"]=4,
["type_for_nothing"]="Ug==",
["id"]=405,
["id_for_nothing"]="UghZ",
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=5,
["id_for_nothing"]="Uw==",
["num"]=1,
["num_for_nothing"]="Vw=="
},
@ -804,8 +804,8 @@ local act_gift = {
{
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=49,
["id_for_nothing"]="UgE=",
["id"]=9,
["id_for_nothing"]="Xw==",
["num"]=5,
["num_for_nothing"]="Uw=="
}
@ -837,8 +837,8 @@ local act_gift = {
{
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=49,
["id_for_nothing"]="UgE=",
["id"]=9,
["id_for_nothing"]="Xw==",
["num"]=2,
["num_for_nothing"]="VA=="
}
@ -912,16 +912,16 @@ local act_gift = {
{
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=24,
["id_for_nothing"]="VAw=",
["id"]=2,
["id_for_nothing"]="VA==",
["num"]=300,
["num_for_nothing"]="VQhc"
},
{
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=210,
["id_for_nothing"]="VAlc",
["id"]=1,
["id_for_nothing"]="Vw==",
["num"]=2,
["num_for_nothing"]="VA=="
}
@ -946,18 +946,18 @@ local act_gift = {
{
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=1,
["id_for_nothing"]="Vw==",
["num"]=5000,
["num_for_nothing"]="UwhcAw=="
["id"]=2,
["id_for_nothing"]="VA==",
["num"]=300,
["num_for_nothing"]="VQhc"
},
{
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=49,
["id_for_nothing"]="UgE=",
["num"]=5,
["num_for_nothing"]="Uw=="
["id"]=1,
["id_for_nothing"]="Vw==",
["num"]=2,
["num_for_nothing"]="VA=="
}
},
["limit"]=1,
@ -973,22 +973,14 @@ local act_gift = {
["type_for_nothing"]="Vw==",
["id"]=2,
["id_for_nothing"]="VA==",
["num"]=120,
["num_for_nothing"]="Vwpc"
["num"]=300,
["num_for_nothing"]="VQhc"
},
{
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=4,
["id_for_nothing"]="Ug==",
["num"]=60,
["num_for_nothing"]="UAg="
},
{
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=49,
["id_for_nothing"]="UgE=",
["id"]=1,
["id_for_nothing"]="Vw==",
["num"]=2,
["num_for_nothing"]="VA=="
}
@ -1062,18 +1054,18 @@ local act_gift = {
{
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=1,
["id_for_nothing"]="Vw==",
["num"]=2000,
["num_for_nothing"]="VAhcAw=="
["id"]=2,
["id_for_nothing"]="VA==",
["num"]=50,
["num_for_nothing"]="Uwg="
},
{
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=211,
["id_for_nothing"]="VAld",
["num"]=3,
["num_for_nothing"]="VQ=="
["id"]=5,
["id_for_nothing"]="Uw==",
["num"]=1,
["num_for_nothing"]="Vw=="
}
},
["limit"]=1,
@ -1096,18 +1088,18 @@ local act_gift = {
{
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=1,
["id_for_nothing"]="Vw==",
["num"]=5000,
["num_for_nothing"]="UwhcAw=="
["id"]=2,
["id_for_nothing"]="VA==",
["num"]=50,
["num_for_nothing"]="Uwg="
},
{
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=68,
["id_for_nothing"]="UAA=",
["num"]=10,
["num_for_nothing"]="Vwg="
["id"]=5,
["id_for_nothing"]="Uw==",
["num"]=1,
["num_for_nothing"]="Vw=="
}
},
["limit"]=1,
@ -1123,24 +1115,16 @@ local act_gift = {
["type_for_nothing"]="Vw==",
["id"]=2,
["id_for_nothing"]="VA==",
["num"]=120,
["num_for_nothing"]="Vwpc"
["num"]=50,
["num_for_nothing"]="Uwg="
},
{
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=4,
["id_for_nothing"]="Ug==",
["num"]=60,
["num_for_nothing"]="UAg="
},
{
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=68,
["id_for_nothing"]="UAA=",
["num"]=3,
["num_for_nothing"]="VQ=="
["id"]=5,
["id_for_nothing"]="Uw==",
["num"]=1,
["num_for_nothing"]="Vw=="
}
},
["limit"]=1,
@ -1212,18 +1196,18 @@ local act_gift = {
{
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=1,
["id_for_nothing"]="Vw==",
["num"]=2000,
["num_for_nothing"]="VAhcAw=="
["id"]=2,
["id_for_nothing"]="VA==",
["num"]=50,
["num_for_nothing"]="Uwg="
},
{
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=211,
["id_for_nothing"]="VAld",
["num"]=3,
["num_for_nothing"]="VQ=="
["id"]=5,
["id_for_nothing"]="Uw==",
["num"]=1,
["num_for_nothing"]="Vw=="
}
},
["limit"]=1,
@ -1246,18 +1230,18 @@ local act_gift = {
{
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=1,
["id_for_nothing"]="Vw==",
["num"]=5000,
["num_for_nothing"]="UwhcAw=="
["id"]=2,
["id_for_nothing"]="VA==",
["num"]=50,
["num_for_nothing"]="Uwg="
},
{
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=68,
["id_for_nothing"]="UAA=",
["num"]=10,
["num_for_nothing"]="Vwg="
["id"]=5,
["id_for_nothing"]="Uw==",
["num"]=1,
["num_for_nothing"]="Vw=="
}
},
["limit"]=1,
@ -1273,24 +1257,16 @@ local act_gift = {
["type_for_nothing"]="Vw==",
["id"]=2,
["id_for_nothing"]="VA==",
["num"]=120,
["num_for_nothing"]="Vwpc"
["num"]=50,
["num_for_nothing"]="Uwg="
},
{
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=4,
["id_for_nothing"]="Ug==",
["num"]=60,
["num_for_nothing"]="UAg="
},
{
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=68,
["id_for_nothing"]="UAA=",
["num"]=3,
["num_for_nothing"]="VQ=="
["id"]=5,
["id_for_nothing"]="Uw==",
["num"]=1,
["num_for_nothing"]="Vw=="
}
},
["limit"]=1,
@ -1662,18 +1638,18 @@ local act_gift = {
{
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=24,
["id_for_nothing"]="VAw=",
["num"]=300,
["num_for_nothing"]="VQhc"
["id"]=2,
["id_for_nothing"]="VA==",
["num"]=50,
["num_for_nothing"]="Uwg="
},
{
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=210,
["id_for_nothing"]="VAlc",
["num"]=2,
["num_for_nothing"]="VA=="
["id"]=5,
["id_for_nothing"]="Uw==",
["num"]=1,
["num_for_nothing"]="Vw=="
}
},
["limit"]=1,
@ -1812,18 +1788,18 @@ local act_gift = {
{
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=1,
["id_for_nothing"]="Vw==",
["num"]=2000,
["num_for_nothing"]="VAhcAw=="
["id"]=2,
["id_for_nothing"]="VA==",
["num"]=50,
["num_for_nothing"]="Uwg="
},
{
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=211,
["id_for_nothing"]="VAld",
["num"]=3,
["num_for_nothing"]="VQ=="
["id"]=5,
["id_for_nothing"]="Uw==",
["num"]=1,
["num_for_nothing"]="Vw=="
}
},
["limit"]=1,
@ -1846,18 +1822,18 @@ local act_gift = {
{
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=1,
["id_for_nothing"]="Vw==",
["num"]=5000,
["num_for_nothing"]="UwhcAw=="
["id"]=2,
["id_for_nothing"]="VA==",
["num"]=50,
["num_for_nothing"]="Uwg="
},
{
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=68,
["id_for_nothing"]="UAA=",
["num"]=10,
["num_for_nothing"]="Vwg="
["id"]=5,
["id_for_nothing"]="Uw==",
["num"]=1,
["num_for_nothing"]="Vw=="
}
},
["limit"]=1,
@ -1873,24 +1849,16 @@ local act_gift = {
["type_for_nothing"]="Vw==",
["id"]=2,
["id_for_nothing"]="VA==",
["num"]=240,
["num_for_nothing"]="VAxc"
["num"]=50,
["num_for_nothing"]="Uwg="
},
{
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=4,
["id_for_nothing"]="Ug==",
["num"]=60,
["num_for_nothing"]="UAg="
},
{
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=68,
["id_for_nothing"]="UAA=",
["num"]=6,
["num_for_nothing"]="UA=="
["id"]=5,
["id_for_nothing"]="Uw==",
["num"]=1,
["num_for_nothing"]="Vw=="
}
},
["limit"]=1,
@ -2112,18 +2080,18 @@ local act_gift = {
{
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=24,
["id_for_nothing"]="VAw=",
["num"]=300,
["num_for_nothing"]="VQhc"
["id"]=2,
["id_for_nothing"]="VA==",
["num"]=50,
["num_for_nothing"]="Uwg="
},
{
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=210,
["id_for_nothing"]="VAlc",
["num"]=2,
["num_for_nothing"]="VA=="
["id"]=5,
["id_for_nothing"]="Uw==",
["num"]=1,
["num_for_nothing"]="Vw=="
}
},
["limit"]=1,
@ -2262,18 +2230,18 @@ local act_gift = {
{
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=1,
["id_for_nothing"]="Vw==",
["num"]=2000,
["num_for_nothing"]="VAhcAw=="
["id"]=2,
["id_for_nothing"]="VA==",
["num"]=50,
["num_for_nothing"]="Uwg="
},
{
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=211,
["id_for_nothing"]="VAld",
["num"]=3,
["num_for_nothing"]="VQ=="
["id"]=5,
["id_for_nothing"]="Uw==",
["num"]=1,
["num_for_nothing"]="Vw=="
}
},
["limit"]=1,
@ -2296,18 +2264,18 @@ local act_gift = {
{
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=1,
["id_for_nothing"]="Vw==",
["num"]=5000,
["num_for_nothing"]="UwhcAw=="
["id"]=2,
["id_for_nothing"]="VA==",
["num"]=50,
["num_for_nothing"]="Uwg="
},
{
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=68,
["id_for_nothing"]="UAA=",
["num"]=10,
["num_for_nothing"]="Vwg="
["id"]=5,
["id_for_nothing"]="Uw==",
["num"]=1,
["num_for_nothing"]="Vw=="
}
},
["limit"]=1,
@ -2323,24 +2291,16 @@ local act_gift = {
["type_for_nothing"]="Vw==",
["id"]=2,
["id_for_nothing"]="VA==",
["num"]=240,
["num_for_nothing"]="VAxc"
["num"]=50,
["num_for_nothing"]="Uwg="
},
{
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=4,
["id_for_nothing"]="Ug==",
["num"]=60,
["num_for_nothing"]="UAg="
},
{
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=68,
["id_for_nothing"]="UAA=",
["num"]=6,
["num_for_nothing"]="UA=="
["id"]=5,
["id_for_nothing"]="Uw==",
["num"]=1,
["num_for_nothing"]="Vw=="
}
},
["limit"]=1,
@ -2590,22 +2550,14 @@ local act_gift = {
["type_for_nothing"]="Vw==",
["id"]=2,
["id_for_nothing"]="VA==",
["num"]=600,
["num_for_nothing"]="UAhc"
["num"]=50,
["num_for_nothing"]="Uwg="
},
{
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=5,
["id_for_nothing"]="Uw==",
["num"]=20,
["num_for_nothing"]="VAg="
},
{
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=209,
["id_for_nothing"]="VAhV",
["num"]=1,
["num_for_nothing"]="Vw=="
}
@ -2623,24 +2575,16 @@ local act_gift = {
["type_for_nothing"]="Vw==",
["id"]=2,
["id_for_nothing"]="VA==",
["num"]=1200,
["num_for_nothing"]="VwpcAw=="
["num"]=50,
["num_for_nothing"]="Uwg="
},
{
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=5,
["id_for_nothing"]="Uw==",
["num"]=35,
["num_for_nothing"]="VQ0="
},
{
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=209,
["id_for_nothing"]="VAhV",
["num"]=2,
["num_for_nothing"]="VA=="
["num"]=1,
["num_for_nothing"]="Vw=="
}
},
["time_type"]=1,
@ -2656,24 +2600,16 @@ local act_gift = {
["type_for_nothing"]="Vw==",
["id"]=2,
["id_for_nothing"]="VA==",
["num"]=2400,
["num_for_nothing"]="VAxcAw=="
["num"]=50,
["num_for_nothing"]="Uwg="
},
{
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=5,
["id_for_nothing"]="Uw==",
["num"]=60,
["num_for_nothing"]="UAg="
},
{
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=209,
["id_for_nothing"]="VAhV",
["num"]=3,
["num_for_nothing"]="VQ=="
["num"]=1,
["num_for_nothing"]="Vw=="
}
},
["time_type"]=1,
@ -2689,24 +2625,16 @@ local act_gift = {
["type_for_nothing"]="Vw==",
["id"]=2,
["id_for_nothing"]="VA==",
["num"]=6000,
["num_for_nothing"]="UAhcAw=="
["num"]=50,
["num_for_nothing"]="Uwg="
},
{
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=5,
["id_for_nothing"]="Uw==",
["num"]=120,
["num_for_nothing"]="Vwpc"
},
{
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=209,
["id_for_nothing"]="VAhV",
["num"]=5,
["num_for_nothing"]="Uw=="
["num"]=1,
["num_for_nothing"]="Vw=="
}
},
["time_type"]=1,
@ -2722,24 +2650,16 @@ local act_gift = {
["type_for_nothing"]="Vw==",
["id"]=2,
["id_for_nothing"]="VA==",
["num"]=12000,
["num_for_nothing"]="VwpcA2U="
["num"]=50,
["num_for_nothing"]="Uwg="
},
{
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=5,
["id_for_nothing"]="Uw==",
["num"]=240,
["num_for_nothing"]="VAxc"
},
{
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=209,
["id_for_nothing"]="VAhV",
["num"]=10,
["num_for_nothing"]="Vwg="
["num"]=1,
["num_for_nothing"]="Vw=="
}
},
["time_type"]=1,

View File

@ -8,6 +8,8 @@ local Game = {
EDITOR_MODE = CS.BF.GameConst.EDITOR_MODE
DEBUG = CS.BF.GameConst.DEBUG
USE_AB = CS.BF.GameConst.USE_AB
IS_DEV = CS.BF.GameConst.BF_APP_DEV
IS_TEST = CS.BF.GameConst.BF_APP_TEST
IS_PUBLISH = CS.BF.BFPlatform.IsPublishChannel()
NOT_PUBLISH = not IS_PUBLISH

View File

@ -196,6 +196,9 @@ BIReport.ACT_SPRINT_OPT_TYPE = {
SIGN_BOUNTY = "SignBounty",
}
-- 礼包
BIReport.GIFT_TYPE.ACT_SPRINT_GIFT = "act_sprint_gift"
-- 冲刺活动
BIReport.ITEM_GET_TYPE.ACT_SPRINT_EXCHANGE = "act_sprint_exchange"
BIReport.ITEM_GET_TYPE.ACT_SPRINT_STANDARD = "act_sprint_standard"
@ -203,6 +206,9 @@ BIReport.ITEM_GET_TYPE.ACT_SPRINT_TASK = "act_sprint_task"
BIReport.ITEM_GET_TYPE.ACT_SPRINT_GIFT = "act_sprint_gift"
BIReport.ITEM_GET_TYPE.ACT_SPRINT_SIGN_BOX = "act_sprint_sign_box"
PayManager.BI_GIFT_TYPE[PayManager.PURCHARSE_TYPE.ACT_GIFT][PayManager.PURCHARSE_ACT_TYPE.ACT_COMMON][PayManager.ACT_COMMON_TYPE.ACT_SPRINT_SUMMON_GIFT] = BIReport.GIFT_TYPE.ACT_SPRINT_GIFT
PayManager.BI_ITEM_GET_TYPE[PayManager.PURCHARSE_TYPE.ACT_GIFT][PayManager.PURCHARSE_ACT_TYPE.ACT_COMMON][PayManager.ACT_COMMON_TYPE.ACT_SPRINT_SUMMON_GIFT] = BIReport.ITEM_GET_TYPE.ACT_SPRINT_GIFT
local EVENT_NAME_ACT_SPRINT = "client_act_sprint"
function BIReport:postActSprintClaimSprintReward(actId, actType, curNum, totalNum, sprintTaskRound, sprintRewardRound)

View File

@ -39,8 +39,8 @@ Example: reset_by_day]],
{
title = "设置时间",
desc = [[ type:time
Example: time 2023-3-9 18:10:59]],
type = "time"
Example: time 2025-01-01 23:59:10]],
type = "time 2025-09-28 23:59:50"
},
{
title = "重置时间差",
@ -124,5 +124,17 @@ Example: set_board_info chapter_board 0 1]],
Example: set_cur_chapter 9]],
type = "set_cur_chapter"
},
{
title = "跨周",
desc = [[:week_end
Example: week_end]],
type = "week_end"
},
{
title = "跨天",
desc = [[:day_end
Example: day_end]],
type = "day_end"
},
}
return GMConst

View File

@ -104,6 +104,21 @@ end
function GMToolUI:sendMsg(gmCommand)
if gmCommand == "" then
GFunc.showToast("GM命令不能为空")
else
-- 去掉行尾的空格
gmCommand = string.gsub(gmCommand, " *$", "")
local startId, endId = string.find(gmCommand, ";")
if startId then
gmCommand = gmCommand:gsub("; *", ";")
local args = {}
args.args = {}
local temp = string.split(gmCommand, ";")
for _, str in ipairs(temp) do
if str ~= "" then
table.insert(args.args, str)
end
end
ModuleManager.DevToolManager:dealGM(args)
else
local args = {}
args.args = string.split(gmCommand, " ")
@ -153,12 +168,6 @@ function GMToolUI:sendMsg(gmCommand)
elseif args.args[1] == "check_skill_sound" then
self:checkSkillSoundExist()
self:closeUI()
elseif args.args[1] == "time" then -- 特殊处理
local args1 = {}
args1.args = {}
args1.args[1] = args.args[1]
args1.args[2] = args.args[2] .. " " .. args.args[3]
ModuleManager.DevToolManager:dealGM(args1)
elseif args.args[1] == "set_cur_chapter" then
DataManager.ChapterData:setChapterId(tonumber(args.args[2]))
DataManager.ChapterData:setDirty()
@ -169,10 +178,25 @@ function GMToolUI:sendMsg(gmCommand)
end
end
end
end
function GMToolUI:updateTime()
-- if not DataManager.PlayerData or not DataManager.PlayerData:getServerOpenTime() then
-- return
-- end
if not DataManager.PlayerData then
return
end
local uiMap = self.root:genAllChildren()
uiMap["gm_tool_ui.time"]:setText(Time:formatTimeYMDHMS(Time:getServerTime()))
local time = Time:getServerTime() + (Time.serverTimeZone or 0) * 3600
local serverDate = Time:getTimeFormatUTC(time)
local clientDate = Time:getTimeFormat(time)
local timeStr = "时差:" .. -Time:getTimeZoneOffset() .. " " .. Time.serverTimeZone
timeStr = timeStr .. "\n\n服务器时间:\n" .. serverDate.year .. "/" .. serverDate.month .. "/" .. serverDate.day .. " " .. serverDate.hour .. ":" .. serverDate.min .. ":" .. serverDate.sec
timeStr = timeStr .. "\n\n本地时间:\n" .. clientDate.year .. "/" .. clientDate.month .. "/" .. clientDate.day .. " " .. clientDate.hour .. ":" .. clientDate.min .. ":" .. clientDate.sec
uiMap["gm_tool_ui.time"]:setText(timeStr)
-- uiMap["gm_tool_ui.create_day"]:setText("开服第 ".. DataManager.PlayerData:getServerOpenDay().." 天\n建号第 ".. DataManager.PlayerData:getCreateDay().." 天")
end
function GMToolUI:dealAddBuffGm(args)

View File

@ -39,10 +39,10 @@ function BuyVitUI:onLoadRootComplete()
self.txTitle:setText(self:getBuyTitle())
if self.buyNodes[GConst.VIT_BUY_TYPE.AD] then
self.buyNodes[GConst.VIT_BUY_TYPE.AD]:addClickListener(function()
if not GFunc.IsGotServerTime() then
GFunc.showToast(I18N:getGlobalText(I18N.GlobalConst.NEED_NET))
return
end
-- if not GFunc.IsGotServerTime() then
-- GFunc.showToast(I18N:getGlobalText(I18N.GlobalConst.NEED_NET))
-- return
-- end
SDKManager:showFullScreenAds(self:getBuyAdType(), function()
self:getBuyFunc(GConst.VIT_BUY_TYPE.AD)
end)

View File

@ -821,7 +821,7 @@ function UIManager:showWaitNet(forceRestart)
seq:AppendInterval(GConst.WAIT_NET_RSP_TIME)
seq:OnComplete(function()
-- 一段时间后还没收到回复就断开连接
NetManager:disconnectAndReconnect()
NetManager:disconnect(NetManager.MAIN_SOCKET_NAME)
end)
self.waitNetSeq = seq
elseif not self.waitNetSeq:IsPlaying() then

View File

@ -257,9 +257,9 @@ function ActivityData:initSkipPopInfo()
end
function ActivityData:getLoginPopSkipFlag()
if not GFunc.IsGotServerTime() then
return false
end
-- if not GFunc.IsGotServerTime() then
-- return false
-- end
if self.loginPopSkipFlag == nil then
self:initSkipPopInfo()
@ -282,9 +282,9 @@ function ActivityData:setLoginPopSkipFlag(value)
end
function ActivityData:getTheDayFirstLogin()
if not GFunc.IsGotServerTime() then
return false
end
-- if not GFunc.IsGotServerTime() then
-- return false
-- end
if self.theDayFirstLogin == nil then
self:initSkipPopInfo()

View File

@ -1,21 +1,21 @@
local FundLevelData = class("FundLevelData", BaseData)
FundLevelData.PRO_GIFT_IDS = {
[1] = 40102,
[2] = 40202,
[3] = 40302,
[4] = 40402,
[5] = 40502,
[6] = 40602,
[7] = 40702,
[8] = 40802,
[9] = 40902,
[10] = 41002,
[11] = 41102,
[12] = 41202,
[13] = 41302,
[14] = 41402,
[15] = 41502,
[1] = 1014000001,
[2] = 1014000101,
[3] = 1014000201,
[4] = 1014000301,
[5] = 1014000401,
[6] = 1014000501,
[7] = 1014000601,
[8] = 1014000701,
[9] = 1014000801,
[10] = 1014000901,
[11] = 1014001001,
[12] = 1014001101,
[13] = 1014001201,
[14] = 1014001301,
[15] = 1014001401,
}
function FundLevelData:ctor()
self.data.isDirty = false

View File

@ -255,9 +255,9 @@ function GiftPopData:setGiftDirty()
end
function GiftPopData:onPopGiftTime()
if not GFunc.IsGotServerTime() then
return false
end
-- if not GFunc.IsGotServerTime() then
-- return false
-- end
if not self.lastGiftPopTime then
self.lastGiftPopTime = LocalData:getPopGiftTime()