From ce5d8a983222dc41a37a22b247df9d54f3fb4abe Mon Sep 17 00:00:00 2001 From: xiekaidong Date: Wed, 26 Apr 2023 18:12:49 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E6=97=A5=E5=BF=97=E6=89=93=E7=82=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lua/app/common/bi_report.lua | 958 ++++-------------- lua/app/common/local_data.lua | 21 +- lua/app/common/pay_manager.lua | 4 +- lua/app/global/global_func.lua | 34 +- lua/app/module/battle/battle_manager.lua | 7 +- .../battle/controller/battle_controller.lua | 43 +- .../controller/battle_controller_stage.lua | 34 + lua/app/module/chapter/chapter_manager.lua | 10 + lua/app/module/login/login_manager.lua | 15 +- lua/app/module/login/login_ui.lua | 4 + lua/app/module/maincity/maincity_manager.lua | 2 +- lua/app/server/data/server_chapter_data.lua | 16 +- lua/app/server/data/server_player_data.lua | 10 + .../server/manager/server_chapter_manager.lua | 1 + lua/app/ui/battle/battle_pause_ui.lua | 2 +- lua/app/userdata/bag/item_data.lua | 94 +- lua/app/userdata/chapter/chapter_data.lua | 22 + lua/app/userdata/player/player_data.lua | 7 + 18 files changed, 424 insertions(+), 860 deletions(-) diff --git a/lua/app/common/bi_report.lua b/lua/app/common/bi_report.lua index ee65381f..116ac844 100644 --- a/lua/app/common/bi_report.lua +++ b/lua/app/common/bi_report.lua @@ -7,44 +7,10 @@ local EVENT_NAME_TUTORIAL = "client_tutorial" local EVENT_NAME_LUA_CRASH = "client_lua_crash" local EVENT_NAME_OPEN_UI = "client_open_ui" --- BIReport.FIREBASE_UI_TYPE = { --- SHOP = "Shop", --- BUY_VIT = "BuyVit", --- QUICK_HANG_UP = "QuickHangUp", --- SUPER_TURNTABLE = "SuperTurntable", --- DAILY_GIFT = "DailyGift", --- NEW_WISH_GIFT = "NewWishGift", --- NEW_PLAYER_GIFT = "NewPlayerGift", --- BALLTE_JEWELRY_SELECT_BUFF = "BallteJewelrySelectBuff", --- BALLTE_RESURRECTION = "BallteResurrection", --- BALLTE_SELECT_BUFF = "BallteSelectBuff", --- } - --- BIReport.FIGHT_END_TYPE = { --- WIN = "Win", --- FAIL = "Fail", --- QUIT = "Quit", --- } --- BIReport.FIGHT_DEATH_TYPE = { --- SURVIVE = "Survive", --- ELITE_FAIL = "EliteFail", --- BOSS_FAIL = "BossFail", --- NORMAL_FAIL = "NormalFail", --- } - --- BIReport.SKILL_REFRESH_TYPE = { --- FREE = "Free", --- ADS = "Ads", --- GEM = "Gem", --- } - -- 所有需要上报的按钮点击事件 BIReport.CLICK_BTN_TYPE = { - EQUIP = "Equip", - DUNGEON = "Dungeon", - TRAIN = "Train", - MALL = "Mall", - SHOP = "Shop", + HOME = "Home", + HERO = "Hero", } BIReport.ADS_OPT_TYPE = { @@ -64,23 +30,6 @@ BIReport.PAY_OPT_TYPE = { INIT_FAILED = "InitFailed", } -BIReport.EQUIP_OPT_TYPE = { - EQUIP_GET = "EquipGet", - EQUIP_LV_UP = "EquipLvUp", - EQUIP_WEAR = "EquipWear", - LEGACY_GET = "LegacyGet", - LEGACY_LV_UP = "LegacyLvUp", - LEGACY_WEAR = "LegacyWear", - LEGACY_REMOVE = "LegacyRemove", -} - -BIReport.BATTLE_PASS_OPT_TYPE = { - OPEN = "Open", - TASK_CLAIM = "TaskClaim", - REWARD_CLAIM = "RewardClaim", - EXP_GET = "ExpGet", -} - BIReport.ACCOUNT_OPT_TYPE = { LOGIN_FINISH = "LoginFinish", LOGIN_FAILED = "LoginFailed", @@ -88,31 +37,9 @@ BIReport.ACCOUNT_OPT_TYPE = { BIND_FINISH = "BindFinish", } -BIReport.TASK_OPT_TYPE = { - FINISH = "Finish", - REWARD = "Reward", -} - -BIReport.MAIL_OPT_TYPE = { - OPEN = "Open", - CLAIM = "Claim", -} - -BIReport.TRAIN_OPT_TYPE = { - TRAIN = "Train", - REBORN = "Reborn", - QUICK_PASS = "QuickPass", - QUICK_PASS_UP = "QuickPassUp", -} - BIReport.CHAPTER_OPT_TYPE = { PASS = "Pass", -} - -BIReport.RUNE_OPT_TYPE = { - GET = "Get", - LV_UP = "LvUp", - WEAR = "Wear", + BOX_OPEN = "BoxOpen", } BIReport.ITEM_GET_TYPE = { @@ -129,38 +56,31 @@ BIReport.ADS_CLICK_TYPE = { BATTLE_SKILL_REFRESH = "BattleSkillRefresh" } --- BIReport.OPEN_STORE_TYPE = { --- ICON = "Icon", --- NO_GOLD = "NoGold", --- FIRST_PAY = "FirstPay", --- } - -BIReport.FIGHT_TYPE = { +BIReport.FIGHT_OPT_TYPE = { START = "Start", END = "End", + SELECT_SKILL_OPEN = "SelectSkillOpen", + SELECT_SKILL = "SelectSkill", +} + +BIReport.FIGHT_DEATH_TYPE = { + SURVIVE = "Survive", + ELITE_FAIL = "EliteFail", + BOSS_FAIL = "BossFail", + NORMAL_FAIL = "NormalFail", +} + +BIReport.FIGHT_WAVE_END_TYPE = { + WIN = "Win", + FAIL = "Fail", + QUIT = "Quit", } BIReport.BATTLE_TYPE = { ["1"] = "Stage", - ["2"] = "DungeonGold", - ["3"] = "DungeonGem", - ["4"] = "DungeonMithril", - ["5"] = "DungeonArena", } BIReport.GIFT_TYPE = { - MALL_POP_GIFT = "MallPopGift", - MALL_SKIP_AD_GIFT = "MallSkipAdGift", - MALL_SUBSCRIBE_BLESSING_GIFT = "MallSubscribeBlessingGift", - MALL_MONTH_CARD = "MallMonthCard", - MALL_LIMIT_GIFT = "MallLimitGift", - MALL_FIRST_RECHARGE_GIFT = "MallFirstRechargeGift", - MALL_CHAPTER_FUND = "MallChapterFund", - MALL_BATTLE_PASS = "MallBattlePass", - - MALL_TREASURE = "MallTreasure", - DAILY_GIFT = "DailyGift", - WEEKLY_GIFT = "WeeklyGift", } BIReport.COIN_TYPE = { @@ -168,36 +88,23 @@ BIReport.COIN_TYPE = { [2] = "Gem", } --- BIReport.MONTHLY_CARD_TYPE = { --- NONE = "None", -- 无月卡 --- SMALL = "OnlySmall", -- 小月卡 --- BIG = "OnlyBig", -- 大月卡 --- BOTH = "Both", -- 大小月卡 --- NO_TIME = "NoTime", -- 没登录无月卡数据 --- } - --- 割草 -local EVENT_NAME_EXIT = "exit" -local EVENT_NAME_FIGHT = "fight" -local EVENT_NAME_CLICK_BTN = "click_btn" -local EVENT_NAME_ITEM_GET = "item_get" -local EVENT_NAME_ITEM_USE = "item_use" -local EVENT_NAME_COIN_GET = "coin_get" -local EVENT_NAME_COIN_USE = "coin_use" -local EVENT_NAME_AD_OPT = "ads_opt" -local EVENT_NAME_PAY_OPT = "pay_opt" -local EVENT_NAME_EQUIP_OPT = "equip_opt" -local EVENT_NAME_LOGIN_FINISH = "login_finish" -local EVENT_NAME_LOGIN = "login" -local EVENT_NAME_BATTLE_PASS_OPT = "battle_pass_opt" -local EVENT_NAME_PING_SERVER = "ping_server" -local EVENT_NAME_ACCOUNT_OPT = "account_opt" -local EVENT_NAME_SUMMON = "summon" -local EVENT_NAME_TASK_OPT = "task_opt" -local EVENT_NAME_MAIL_OPT = "mail_opt" -local EVENT_NAME_TRAIN_OPT = "train_opt" -local EVENT_NAME_CHAPTER_OPT = "chapter_opt" -- 章节 -local EVENT_NAME_RUNE_OPT = "rune_opt" -- 符文 +-- b6 +local EVENT_NAME_EXIT = "client_exit" +local EVENT_NAME_FIGHT = "client_fight" +local EVENT_NAME_CLICK_BTN = "client_click_btn" +local EVENT_NAME_ITEM_GET = "client_item_get" +local EVENT_NAME_ITEM_USE = "client_item_use" +local EVENT_NAME_COIN_GET = "client_coin_get" +local EVENT_NAME_COIN_USE = "client_coin_use" +local EVENT_NAME_AD_OPT = "client_ads_opt" +local EVENT_NAME_PAY_OPT = "client_pay_opt" +local EVENT_NAME_LOGIN_FINISH = "client_login_finish" +local EVENT_NAME_LOGIN = "client_login" +local EVENT_NAME_PING_SERVER = "client_ping_server" +local EVENT_NAME_ACCOUNT_OPT = "client_account_opt" +local EVENT_NAME_CHAPTER_OPT = "client_chapter_opt" -- 章节 +local EVENT_NAME_VIT_USE = "client_vit_use" +local EVENT_NAME_VIT_GET = "client_vit_get" function BIReport:setIsNewPlayer(isNewPlayer) self.isNewPlayer = isNewPlayer @@ -214,18 +121,6 @@ function BIReport:postAdjustSimpleTrackEvent(eventName, eventValue) CS.BF.BFMain.Instance.SDKMgr.BFThirdReportSDKMgr:PostAdjustSimpleTrackEvent(eventName, json.encode(eventValue)) end --- Firebase --- function BIReport:postFirebaseLog(eventName, eventValue) --- if not Platform:getIsPublishChannel() or EDITOR_MODE then --- return --- end --- if not eventName or not eventValue then --- return --- end --- if CS.UnityEngine.Application.platform == CS.UnityEngine.RuntimePlatform.Android then --- CS.BF.BFMain.Instance.SDKMgr.BFThirdReportSDKMgr:PostFireBaseEvent(eventName, json.encode(eventValue)) --- end --- end function BIReport:updateAccountId(id) if id == nil then @@ -257,6 +152,9 @@ function BIReport:report(name, args) if args.level_id == nil then args.level_id = DataManager.ChapterData:getChapterId() end + if args.max_chapter == nil then + args.max_chapter = DataManager.ChapterData:getNextChapter(DataManager.ChapterData:getMaxChapterId()) + end end if DataManager.BagData and DataManager.BagData.ItemData then args.gold = DataManager.BagData.ItemData:getItemNumById(GConst.ItemConst.ITEM_ID_GOLD) @@ -283,23 +181,6 @@ function BIReport:postTutorialStep(id) self:report(EVENT_NAME_TUTORIAL, args) end --- 首页按钮点击 -function BIReport:postHomeBtnCilck(clickType) - -- -- Type 点击位置 点击首页按钮时 String "Shop=商店、Equip=装备界面、Home=首页、Level=关卡按钮、ChangeLevel=切换关卡、 - -- -- Talent=天赋界面、LevelBox=关卡宝箱" - -- -- IsNew 是否是新用户 Boolean 是否为当天新用户,True = 是,False = 否 - -- -- MaxChapter 最大章节 Int 已解锁的最大章节 - -- -- Chapter 章节id Int 当前停留的章节id - -- local chapterId = DataManager.StageData:getChapterId() - -- local args = { - -- type = clickType, -- 宝箱类型 - -- chapter = chapterId, -- 章节 - -- max_chapter = DataManager.StageData:getNewChapterId(), - -- } - -- self:report(EVENT_NAME_CLICK_HOME_BTN, args) - -- BIReport:printArgsStr(EVENT_NAME_CLICK_HOME_BTN, args) -end - -- Lua crash function BIReport:postLuaCrash(logString, stackTrace) local msg = logString .. stackTrace @@ -370,138 +251,6 @@ function BIReport:postFirstLoginEvent() CS.BF.BFMain.Instance.SDKMgr.BFLoginSDKMgr.FBSdk:LogAppEvent("fb_first_login", json.encode({})) end --- 上报等级提升事件,单独处理,只上报到AF和FB,不上报数数 --- function BIReport:postLvEvent(lv) --- -- 只有外网正式渠道真机包才上报 --- if not Platform:getIsPublishChannel() or EDITOR_MODE then --- return --- end --- -- 审核模式不上报 --- if CS.BF.BFMain.IsShenhe then --- return --- end --- if not lv then --- return --- end --- local postLV = { --- [1] = true, --- [2] = true, --- [3] = true, --- [5] = true, --- [10] = true, --- [15] = true, --- [20] = true, --- [30] = true, --- [40] = true, --- [50] = true, --- [60] = true, --- [70] = true, --- [80] = true, --- [90] = true, --- [100] = true, --- } --- -- CS.BF.BFMain.Instance.SDKMgr.BFThirdReportSDKMgr:PostAppsflyerEvent("af_Grade", json.encode({})) --- -- CS.BF.BFMain.Instance.SDKMgr.BFLoginSDKMgr.FBSdk:LogAppEvent("fb_Grade", json.encode({})) --- -- if not postLV[lv] then --- -- return --- -- end --- -- local args = {} --- -- CS.BF.BFMain.Instance.SDKMgr.BFThirdReportSDKMgr:PostAppsflyerEvent("af_Grade_" .. lv, json.encode(args)) --- -- CS.BF.BFMain.Instance.SDKMgr.BFLoginSDKMgr.FBSdk:LogAppEvent("fb_Grade_" .. lv, json.encode(args)) --- end - --- 上报广告播放提升事件,单独处理,只上报到AF和FB,不上报数数 --- function BIReport:postAdEvent() --- -- 只有外网正式渠道真机包才上报 --- if not Platform:getIsPublishChannel() or EDITOR_MODE then --- return --- end --- -- 审核模式不上报 --- if CS.BF.BFMain.IsShenhe then --- return --- end --- local adCount = DataManager.PlayerData:getAdCount() --- if not adCount then --- return --- end --- -- CS.BF.BFMain.Instance.SDKMgr.BFThirdReportSDKMgr:PostAppsflyerEvent("af_AdRewardAD", json.encode({})) --- -- CS.BF.BFMain.Instance.SDKMgr.BFLoginSDKMgr.FBSdk:LogAppEvent("fb_AdRewardAD", json.encode({})) --- -- local postAdCount = { --- -- [1] = true, --- -- [2] = true, --- -- [3] = true, --- -- [5] = true, --- -- [10] = true, --- -- [15] = true, --- -- [20] = true, --- -- [30] = true, --- -- [40] = true, --- -- [50] = true, --- -- [60] = true, --- -- } --- -- if not postAdCount[adCount] then --- -- return --- -- end --- -- local args = {} --- -- CS.BF.BFMain.Instance.SDKMgr.BFThirdReportSDKMgr:PostAppsflyerEvent("af_AdRewardAD_" .. adCount, json.encode(args)) --- -- CS.BF.BFMain.Instance.SDKMgr.BFLoginSDKMgr.FBSdk:LogAppEvent("fb_AdRewardAD_" .. adCount, json.encode(args)) --- end - --- 上报部分档位首次付费 --- function BIReport:postFirstRechargeEvent(id) --- -- 只有外网正式渠道真机包才上报 --- if not Platform:getIsPublishChannel() or EDITOR_MODE then --- return --- end --- -- 审核模式不上报 --- if CS.BF.BFMain.IsShenhe then --- return --- end --- local postRechargeID = { --- [1] = false, -- 0.99 --- [2] = false, -- 1.99 --- [3] = false, -- 2.99 --- [4] = true, -- 4.99 --- [5] = true, -- 9.99 --- [6] = false, -- 14.99 --- [7] = true, -- 19.99 --- [8] = false, -- 24.99 --- [9] = true, -- 29.99 --- [10] = true, -- 49.99 --- [11] = false, -- 69.99 --- [12] = false, -- 99.99 --- } --- if not postRechargeID[id] then --- return --- end --- local cfg = ConfigManager:getConfig("recharge")[id] --- if not cfg then --- return --- end --- local args = {} --- -- CS.BF.BFMain.Instance.SDKMgr.BFThirdReportSDKMgr:PostAppsflyerEvent("af_package_" .. cfg.price, json.encode(args)) --- end - --- 上报进入章节事件,单独处理,只上报到AF和FB,不上报数数 --- function BIReport:postChapterEvent(chapter) --- -- 只有外网正式渠道真机包才上报 --- if not Platform:getIsPublishChannel() or EDITOR_MODE then --- return --- end --- -- 审核模式不上报 --- if CS.BF.BFMain.IsShenhe then --- return --- end --- if not chapter then --- return --- end --- -- CS.BF.BFMain.Instance.SDKMgr.BFThirdReportSDKMgr:PostAppsflyerEvent("af_Chapter", json.encode({})) --- -- CS.BF.BFMain.Instance.SDKMgr.BFLoginSDKMgr.FBSdk:LogAppEvent("fb_Chapter", json.encode({})) --- -- local args = {} --- -- CS.BF.BFMain.Instance.SDKMgr.BFThirdReportSDKMgr:PostAppsflyerEvent("af_Chapter_" .. chapter, json.encode(args)) --- -- CS.BF.BFMain.Instance.SDKMgr.BFLoginSDKMgr.FBSdk:LogAppEvent("fb_Chapter_" .. chapter, json.encode(args)) --- end - -- 以下为数数 function BIReport:printArgsStr(eventName, args) if not EDITOR_MODE then @@ -517,6 +266,7 @@ end function BIReport:postGameLogin(isFirstLogin) local args = { first_begin = isFirstLogin, + -- LogType -- 进入类型,不处理 } self:report(EVENT_NAME_LOGIN, args) end @@ -535,37 +285,9 @@ function BIReport:postGameLoginFinish() -- MaxTrial 副本进度 -- IsNew 是否是新用户 local args = { - is_daily_first = DataManager:getIsTodayFirstLogin(), - is_first = DataManager:getIsFirstLogin(), + -- is_daily_first = DataManager:getIsTodayFirstLogin(), + -- is_first = DataManager:getIsFirstLogin(), } - local equips = DataManager.BagData.EquipData:getAllEquips() - for k,v in pairs(equips) do - if not args.my_equip then - args.my_equip = v:getId() .. ":" .. v:getLv() .. ":" .. v:getCount() - else - args.my_equip = args.my_equip .. "|" .. v:getId() .. ":" .. v:getLv() .. ":" .. v:getCount() - end - end - args.my_equip = args.my_equip or "" - - for i = 1, 4 do - local info = DataManager.DungeonData:getPassedMaxLevel(i) - if info then - if not args.my_dungeon then - args.my_dungeon = i .. ":" .. info - else - args.my_dungeon = args.my_dungeon .. "|" .. i .. ":" .. info - end - end - end - - args.my_dungeon = args.my_dungeon or "" - local info = DataManager.ArenaData:getSegment() or 0 - if not args.my_dungeon then - args.my_dungeon = "5:" .. info - else - args.my_dungeon = args.my_dungeon .. "|5:" .. info - end self:report(EVENT_NAME_LOGIN_FINISH, args) end @@ -580,158 +302,207 @@ function BIReport:postGameExit() end -- 进入战斗 -function BIReport:postFightBegin(battleType, currLevelId, maxLevelId) - -- Level_ID 进入关卡编号 - -- LevelType 进入关卡类型 - -- MaxLevel 已解锁最大关卡 - -- StartTimes 累计进入次数 - -- IsNew 是否是新用户 +function BIReport:postFightBegin(battleType, wave, chapterId, maxChapter, startTimes) + -- wave -- 波次 + -- chapterId 进入关卡编号 + -- maxChapter 已解锁最大关卡 + -- startTimes 累计进入次数 local args = { - -- level_id = currLevelId + 1, - -- max_level = maxLevelId + 1, battle_type = BIReport.BATTLE_TYPE[battleType], - event_type = BIReport.FIGHT_TYPE.START, + event_type = BIReport.FIGHT_OPT_TYPE.START, + wave_id = wave, + chapter_id = chapterId, + max_chapter = maxChapter, + start_times = startTimes, } self:report(EVENT_NAME_FIGHT, args) + self:printArgsStr(EVENT_NAME_FIGHT, args) end -function BIReport:postFightEnd(battleType, currLevelId, maxLevelId, passType) - -- Level_ID 进入关卡编号 +function BIReport:postFightEnd(battleType, chapterId, wave, duration, totalTime, eliminateCount, chapterEliminateCount, type, deathType, startTimes, isFirstWin, isFianlStep) + -- wave 进入关卡编号 -- LevelType 进入关卡类型 -- MaxLevel 已解锁最大关卡 -- StartTimes 累计进入次数 -- IsNew 是否是新用户 + local skillStr = GConst.EMPTY_STRING + local skillNum = 0 + local skillMap = DataManager.BattleData:getSelectSkillMap() + if skillMap then + for skillId, info in pairs(skillMap) do + skillStr = skillStr .. skillId .. "|" + skillNum = skillNum + (info.count or 0) + end + end + local args = { - level_id = currLevelId, - -- max_level = maxLevelId + 1, - pass_type = passType, battle_type = BIReport.BATTLE_TYPE[battleType], - event_type = BIReport.FIGHT_TYPE.END, + event_type = BIReport.FIGHT_OPT_TYPE.END, + wave_id = wave, + chapter_id = chapterId, + duration = duration, + chapter_duration = totalTime, + eliminate = eliminateCount, + chapter_eleminate = chapterEliminateCount, + skill = skillStr, + skill_num = skillNum, + type = type, -- "Win Fail Quit", + death_type = deathType, + start_times = startTimes, + is_first_win = isFirstWin, + isFianlStep = isFianlStep, } self:report(EVENT_NAME_FIGHT, args) + self:printArgsStr(EVENT_NAME_FIGHT, args) end -function BIReport:postDungeonFightBegin(battleType, currLevelId, maxLevelId) - -- Level_ID 进入关卡编号 - -- LevelType 进入关卡类型 - -- MaxLevel 已解锁最大关卡 - -- StartTimes 累计进入次数 - -- IsNew 是否是新用户 +function BIReport:postShowFightSkillSelect(battleType, skillList, chapterId, totalTime, wave) + local skillNum = 0 + local skillMap = DataManager.BattleData:getSelectSkillMap() + if skillMap then + for skillId, info in pairs(skillMap) do + skillNum = skillNum + (info.count or 0) + end + end + + local skillStr = GConst.EMPTY_STRING + if skillList then + for _, skillId in ipairs(skillList) do + skillStr = skillStr .. skillId .. "|" + end + end local args = { - level_id = currLevelId, - max_dungeon_level = maxLevelId, battle_type = BIReport.BATTLE_TYPE[battleType], - event_type = BIReport.FIGHT_TYPE.START, + event_type = BIReport.FIGHT_OPT_TYPE.SELECT_SKILL_OPEN, + wave_id = wave, + chapter_id = chapterId, + chapter_duration = totalTime, + skill = skillStr, + skill_num = skillNum, } self:report(EVENT_NAME_FIGHT, args) + self:printArgsStr(EVENT_NAME_FIGHT, args) end -function BIReport:postDungeonFightEnd(battleType, currLevelId, maxLevelId, passType) - -- Level_ID 进入关卡编号 - -- LevelType 进入关卡类型 - -- MaxLevel 已解锁最大关卡 - -- StartTimes 累计进入次数 - -- IsNew 是否是新用户 +function BIReport:postFightSkillSelect(battleType, skillList, chapterId, totalTime, wave) + local skillNum = 0 + local skillMap = DataManager.BattleData:getSelectSkillMap() + if skillMap then + for skillId, info in pairs(skillMap) do + skillNum = skillNum + (info.count or 0) + end + end + + local skillStr = GConst.EMPTY_STRING + if skillList then + for _, skillId in ipairs(skillList) do + skillStr = skillStr .. skillId .. "|" + end + end local args = { - level_id = currLevelId, - max_dungeon_level = maxLevelId, - pass_type = passType, battle_type = BIReport.BATTLE_TYPE[battleType], - event_type = BIReport.FIGHT_TYPE.END, + event_type = BIReport.FIGHT_OPT_TYPE.SELECT_SKILL, + wave_id = wave, + chapter_id = chapterId, + chapter_duration = totalTime, + skill = skillStr, + skill_num = skillNum, } self:report(EVENT_NAME_FIGHT, args) + self:printArgsStr(EVENT_NAME_FIGHT, args) end -- 首页按钮点击 -function BIReport:postBtnCilck(clickType) +function BIReport:postHomeBtnCilck(clickType) local args = { event_type = clickType, + type = BIReport.CLICK_BTN_TYPE[clickType], + chapter_id = DataManager.ChapterData:getChapterId() } self:report(EVENT_NAME_CLICK_BTN, args) + self:printArgsStr(EVENT_NAME_CLICK_BTN, args) +end + +function BIReport:postChapterOpenBox(chapterId, wave, rewards) + local rewardStr = GFunc.getRewardsStr(rewards) + local args = { + box_level = wave, + rewards = rewardStr, + chapter_id = chapterId, + type = BIReport.CHAPTER_OPT_TYPE.BOX_OPEN + } + self:report(EVENT_NAME_CHAPTER_OPT, args) + self:printArgsStr(EVENT_NAME_CHAPTER_OPT, args) end -- 道具获取 -function BIReport:postItemGet(bigNum, itemId, getType) +function BIReport:postItemGet(num, itemId, getType) -- Item 道具id -- Type 获得方式 -- MaxLevel 最大关卡 -- ItemNum 获取道具数量 -- ItemAll 获取后道具数量 -- IsNew 是否是新用户 - local itemBigNum = DataManager.BagData.ItemData:getItemBigNumById(itemId) + local allNum = DataManager.BagData.ItemData:getItemBigNumById(itemId) local args = { - item_value = bigNum.value, - item_unit = bigNum.unit, + item_value = num, item_id = itemId, - item_all_value = itemBigNum.value, - item_all_unit = itemBigNum.unit, + item_all_value = allNum, type = getType, } self:report(EVENT_NAME_ITEM_GET, args) + self:printArgsStr(EVENT_NAME_ITEM_GET, args) end -- 道具使用 -function BIReport:postItemUse(bigNum, itemId, getType) +function BIReport:postItemUse(num, itemId, getType) -- Item 道具id -- Type 消耗方式 -- MaxLevel 最大关卡 -- ItemNum 消耗道具数量 -- ItemAll 消耗后道具数量 -- IsNew 是否是新用户 - local itemBigNum = DataManager.BagData.ItemData:getItemBigNumById(itemId) + local allNum = DataManager.BagData.ItemData:getItemBigNumById(itemId) local args = { - item_value = bigNum.value, - item_unit = bigNum.unit, + item_value = num, item_id = itemId, - item_all_value = itemBigNum.value, - item_all_unit = itemBigNum.unit, + item_all_value = allNum, type = getType, } self:report(EVENT_NAME_ITEM_USE, args) + self:printArgsStr(EVENT_NAME_ITEM_USE, args) end --- 钻石增加 -function BIReport:postGemGet(bigNum, getType, itemId) - -- CoinNum 代币数量 - -- Type 获得类型 - -- CoinsType 代币类型 - -- IsNew 是否是新用户 - -- MaxLevel 最大关卡 +-- 体力获得 +function BIReport:postVitGet(num, getType) + -- Type 获得类型 获得体力时 String Ads=广告、Gold=金币 、Time=时间恢复 、Stores=商品恢复 + -- IsNew 是否是新用户 Boolean 是否为当天新用户,True = 是,False = 否 + -- EnergyNum 当前体力数 Int 获得体力数量 + -- MaxChapter 最大章节 Int 已解锁的最大章节 local args = { type = getType, - -- coin_value = bigNum.value, - -- coin_unit = bigNum.unit, - coin_type = BIReport.COIN_TYPE[itemId], + vit_num = num, + vit_all = DataManager.BagData.ItemData:getItemNumById(GConst.ItemConst.ITEM_ID_VIT), } - if itemId == GConst.ItemConst.ITEM_ID_GEM then - -- args.coin_value = BigNumOpt.bigNum2Num(bigNum) - args.coin_unit = 0 - else - args.coin_value = bigNum.value - args.coin_unit = bigNum.unit - end - self:report(EVENT_NAME_COIN_GET, args) + self:report(EVENT_NAME_VIT_GET, args) + BIReport:printArgsStr(EVENT_NAME_VIT_GET, args) end --- 钻石使用 -function BIReport:postGemUse(num, getType, itemId) - -- CoinNum 代币数量 减少代币时 Int 使用代币数量 - -- Type 使用类型 String Box=开启宝箱、复活=Revive、天赋升级=Talent、Equip=装备升级 - -- CoinsType 代币类型 String Gold=金币、Gems=钻石 - -- IsNew 是否是新用户 Boolean 是否为当天新用户,True = 是,False = 否 - -- MaxChapter 最大章节 Int 已解锁的最大章节 +-- 体力使用 +function BIReport:postVitUse(num) + -- EnergyNum 当前体力数 减少体力时 Int 使用体力数量 + -- IsNew 是否是新用户 Boolean 是否为当天新用户,True = 是,False = 否 + -- MaxChapter 最大章节 Int 已解锁的最大章节 local args = { - type = getType, - coin_num = num, - coin_type = BIReport.COIN_TYPE[itemId], - coin_all = DataManager.BagData.ItemData:getItemNumById(itemId), - -- max_chapter = DataManager.StageData:getNewChapterId(), + vit_num = num, + vit_all = DataManager.BagData.ItemData:getItemNumById(GConst.ItemConst.ITEM_ID_VIT), } - self:report(EVENT_NAME_COIN_USE, args) + self:report(EVENT_NAME_VIT_USE, args) + BIReport:printArgsStr(EVENT_NAME_VIT_USE, args) end -- 点击广告按钮 @@ -855,159 +626,6 @@ function BIReport:postPayGet(giftType, id, rechargeId, orderId, originOrderId, b end end --- 装备穿戴 -function BIReport:postEquipWear(equipPart, equipLv, equipId) - -- MaxLevel 最大关卡 - -- IsNew 是否是新用户 - -- Equip_Lv 装备等级 - -- Equip_ID 装备ID - - local args = { - equip_part = equipPart, - equip_lv = equipLv, - equip_id = equipId, - event_type = BIReport.EQUIP_OPT_TYPE.EQUIP_WEAR, - } - self:report(EVENT_NAME_EQUIP_OPT, args) -end - --- 装备升级 -function BIReport:postEquipUp(equipPart, equipLv, equipId) - -- MaxLevel 最大关卡 - -- IsNew 是否是新用户 - -- Equip_Lv 升级后装备等级 - -- Equip_ID 装备ID - -- Type 消耗类型 - - local args = { - equip_part = equipPart, - equip_lv = equipLv, - equip_id = equipId, - event_type = BIReport.EQUIP_OPT_TYPE.EQUIP_LV_UP, - } - self:report(EVENT_NAME_EQUIP_OPT, args) -end - -function BIReport:postEquipGet(equipId, getType) - -- MaxLevel 最大关卡 - -- IsNew 是否是新用户 - -- Equip_Lv 获取的装备等级 - -- Equip_ID 获取的装备ID - -- Type 获取类型 - local args = { - equip_id = equipId, - type = getType, - event_type = BIReport.EQUIP_OPT_TYPE.EQUIP_GET, - } - self:report(EVENT_NAME_EQUIP_OPT, args) -end - -function BIReport:postLegacyWear(equipPart, equipLv, equipId) - -- MaxLevel 最大关卡 - -- IsNew 是否是新用户 - -- Equip_Lv 装备等级 - -- Equip_ID 装备ID - - local args = { - equip_part = equipPart, - equip_lv = equipLv, - equip_id = equipId, - event_type = BIReport.EQUIP_OPT_TYPE.LEGACY_WEAR, - } - self:report(EVENT_NAME_EQUIP_OPT, args) -end - --- 装备升级 -function BIReport:postLegacyUp(equipPart, equipLv, equipId) - -- MaxLevel 最大关卡 - -- IsNew 是否是新用户 - -- Equip_Lv 升级后装备等级 - -- Equip_ID 装备ID - -- Type 消耗类型 - - local args = { - equip_part = equipPart, - equip_lv = equipLv, - equip_id = equipId, - event_type = BIReport.EQUIP_OPT_TYPE.LEGACY_LV_UP, - } - self:report(EVENT_NAME_EQUIP_OPT, args) -end - -function BIReport:postLegacyGet(equipId, getType) - -- MaxLevel 最大关卡 - -- IsNew 是否是新用户 - -- Equip_Lv 获取的装备等级 - -- Equip_ID 获取的装备ID - -- Type 获取类型 - local args = { - equip_id = equipId, - type = getType, - event_type = BIReport.EQUIP_OPT_TYPE.LEGACY_GET, - } - self:report(EVENT_NAME_EQUIP_OPT, args) -end - -function BIReport:postLegacyRemove(equipPart, equipId) - -- MaxLevel 最大关卡 - -- IsNew 是否是新用户 - -- Equip_Lv 获取的装备等级 - -- Equip_ID 获取的装备ID - -- Type 获取类型 - local args = { - equip_part = equipPart, - equip_id = equipId, - event_type = BIReport.EQUIP_OPT_TYPE.LEGACY_REMOVE, - } - self:report(EVENT_NAME_EQUIP_OPT, args) -end - -function BIReport:postDataException(itemId, count, getType) - -- local args = { - -- item_num = count, - -- item_id = itemId, - -- type = getType, - -- } - -- self:report(EVENT_NAME_DATA_EXCEPTION, args) - -- BIReport:printArgsStr(EVENT_NAME_DATA_EXCEPTION, args) -end - --- 战令打点 -function BIReport:postBattlePassOpen() - local args = { - event_type = BIReport.BATTLE_PASS_OPT_TYPE.OPEN, - } - self:report(EVENT_NAME_BATTLE_PASS_OPT, args) -end - -function BIReport:postBattlePassTaskClaim(id, lv, progress) - local args = { - task_id = id, - task_level = lv, - task_progress = progress, - event_type = BIReport.BATTLE_PASS_OPT_TYPE.TASK_CLAIM, - } - self:report(EVENT_NAME_BATTLE_PASS_OPT, args) -end - -function BIReport:postBattlePassRewardClaim(lv, highLv) - local args = { - task_level = lv, - task_high_lv = highLv, - event_type = BIReport.BATTLE_PASS_OPT_TYPE.REWARD_CLAIM, - } - self:report(EVENT_NAME_BATTLE_PASS_OPT, args) -end - -function BIReport:postBattlePassExpGet(getExp, lv, exp) - local args = { - task_get_exp = getExp, - task_level = lv, - task_exp = exp, - event_type = BIReport.BATTLE_PASS_OPT_TYPE.EXP_GET, - } - self:report(EVENT_NAME_BATTLE_PASS_OPT, args) -end -- 登录成功 function BIReport:postAccountLoginFinish(loginType) @@ -1028,39 +646,6 @@ function BIReport:postAccountLoginFailed(loginType, reason) self:report(EVENT_NAME_ACCOUNT_OPT, args) end --- 点击绑定 -function BIReport:postAccountBindClick(loginType) - local args = { - login_type = loginType, - event_type = BIReport.ACCOUNT_OPT_TYPE.BIND_CLICK, - } - self:report(EVENT_NAME_ACCOUNT_OPT, args) -end - --- 绑定成功 -function BIReport:postAccountBindFinish(loginType) - local args = { - login_type = loginType, - event_type = BIReport.ACCOUNT_OPT_TYPE.BIND_FINISH, - } - self:report(EVENT_NAME_ACCOUNT_OPT, args) -end - --- -- 切换账号 --- function BIReport:postAccountChange(loginType) --- local args = { --- loginType = loginType, --- } --- self:report(EVENT_NAME_ACCOUNT_CHANGE, args) --- end - --- -- 删除账号 --- function BIReport:postAccountDelete(loginType) --- local args = { --- loginType = loginType, --- } --- self:report(EVENT_NAME_ACCOUNT_DELETE, args) --- end -- 上报ping服务器地址情况 function BIReport:postPingServer(address, time, resultType) @@ -1072,192 +657,37 @@ function BIReport:postPingServer(address, time, resultType) self:report(EVENT_NAME_PING_SERVER, args) end --- -- CDKey兑换结果 --- function BIReport:postCDKeyResult(CDKeyStr, result, code) --- local args = { --- cdkey = CDKeyStr, --- success = result, --- code = code --- } --- self:report(CDKEY_EXCHANGE_RESULT, args) --- end - --- -- 网络异常 --- function BIReport:postNetFail(errorType, msgName, time, failedTime) --- local args = { --- error_type = errorType, --- message_name = msgName, --- time = time, --- failed_time = failedTime --- } --- self:report(EVENT_NAME_NET_FAIL, args) --- end - --- -- 通信成功 --- function BIReport:postNetSuccess(msgName, retryTimes, time, code) --- local args = { --- message_name = msgName, --- retry_times = retryTimes, --- time = time, --- code = code --- } --- self:report(EVENT_NAME_NET_SUCCESS, args) --- end - --- -- 重复订单 --- function BIReport:postRepeatPayOrder(productId, originOrderId, orderId) --- local args = { --- product_id = productId, --- origin_order_id = tostring(originOrderId), --- order_id = orderId --- } --- self:report(EVENT_NAME_PAY_ORDER_REPEAT, args) --- end - --- 召唤 -function BIReport:postSummonSuc(summonType, diamondType) - -- MaxLevel 最大关卡 - -- IsNew 是否是新用户 - -- Type 召唤类型 Equip=武器召唤、Defense=防具召唤、Cherish=传家宝召唤、Rune=符文召唤 - -- DiamondType 消耗钻石类型 Free=免费召唤、Ad1=当日第1次广告召唤、Ad2=第2次、Ad3=当日第3次、Daimond11=召唤11次、Diamond35=召唤35次 +-- 钻石增加 +function BIReport:postGemGet(num, getType, itemId) + -- CoinNum 代币数量 增加代币时 Int 获得代币数量 + -- Type 获得类型 String 广告=Ads、商店宝箱=Box、关卡宝箱=LevelBox、关卡奖励=LevelReward、 + -- CoinsType 代币类型 String Gold=金币、Gems=钻石 + -- IsNew 是否是新用户 Boolean 是否为当天新用户,True = 是,False = 否 + -- MaxChapter 最大章节 Int 已解锁的最大章节 local args = { - diamond_type = diamondType, - type = summonType, + type = getType, + coin_num = num, + coin_type = BIReport.COIN_TYPE[itemId], } - self:report(EVENT_NAME_SUMMON, args) + self:report(EVENT_NAME_COIN_GET, args) + BIReport:printArgsStr(EVENT_NAME_COIN_GET, args) end --- 任务 -function BIReport:postTaskFinish(taskType, taskId) - -- MaxLevel 最大关卡 - -- IsNew 是否是新用户 - -- TaskType 任务类型 - -- Task_ID 任务id - -- FinishTimes 任务完成数 - +-- 钻石使用 +function BIReport:postGemUse(num, getType, itemId) + -- CoinNum 代币数量 减少代币时 Int 使用代币数量 + -- Type 使用类型 String Box=开启宝箱、复活=Revive、天赋升级=Talent、Equip=装备升级 + -- CoinsType 代币类型 String Gold=金币、Gems=钻石 + -- IsNew 是否是新用户 Boolean 是否为当天新用户,True = 是,False = 否 + -- MaxChapter 最大章节 Int 已解锁的最大章节 local args = { - task_type = taskType, - task_id = taskId, - event_type = BIReport.TASK_OPT_TYPE.FINISH, + type = getType, + coin_num = num, + coin_type = BIReport.COIN_TYPE[itemId], + coin_all = DataManager.BagData.ItemData:getItemNumById(itemId), } - self:report(EVENT_NAME_TASK_OPT, args) -end - -function BIReport:postTaskReward(taskType, taskId) - -- MaxLevel 最大关卡 - -- IsNew 是否是新用户 - -- TaskType 任务类型 - -- Task_ID 任务id - -- FinishTimes 累计领取奖励数 - - local args = { - task_type = taskType, - task_id = taskId, - event_type = BIReport.TASK_OPT_TYPE.REWARD, - } - self:report(EVENT_NAME_TASK_OPT, args) -end - --- 邮箱 -function BIReport:postMailOpen(mailId) - -- IsNew 是否是新用户 - -- MaxLevel 最大关卡 - -- Email_ID 邮件编号 - - local args = { - mail_id = mailId, - event_type = BIReport.MAIL_OPT_TYPE.OPEN, - } - self:report(EVENT_NAME_MAIL_OPT, args) -end - -function BIReport:postMailClaim(mailId) - -- IsNew 是否是新用户 - -- MaxLevel 最大关卡 - -- Email_ID 邮件编号 - - local args = { - mail_id = mailId, - event_type = BIReport.MAIL_OPT_TYPE.CLAIM, - } - self:report(EVENT_NAME_MAIL_OPT, args) -end - --- 修炼 -function BIReport:postTrainFinish(trainType, trainLv) - -- IsNew 是否是新用户 - -- MaxLevel 最大关卡 - -- TrainLv 训练属性等级 - -- TrainType 训练类型 - - local args = { - type = tostring(trainType), - train_lv = trainLv, - event_type = BIReport.TRAIN_OPT_TYPE.TRAIN, - } - self:report(EVENT_NAME_TRAIN_OPT, args) -end - -function BIReport:postTrainReborn() - local args = { - event_type = BIReport.TRAIN_OPT_TYPE.REBORN, - } - self:report(EVENT_NAME_TRAIN_OPT, args) -end - -function BIReport:postTrainQuickPass() - local args = { - event_type = BIReport.TRAIN_OPT_TYPE.QUICK_PASS, - } - self:report(EVENT_NAME_TRAIN_OPT, args) -end - -function BIReport:postTrainQuickPassUp(level) - local args = { - train_lv = level, - event_type = BIReport.TRAIN_OPT_TYPE.QUICK_PASS, - } - self:report(EVENT_NAME_TRAIN_OPT, args) -end - --- function BIReport:postChapterPass(oldId, chapterId, passType) --- local args = { --- old_id = oldId, --- chapter_id = chapterId, --- pass_type = passType, --- event_type = BIReport.CHAPTER_OPT_TYPE.PASS, --- } - --- self:report(EVENT_NAME_CHAPTER_OPT, args) --- end - --- 符文 -function BIReport:postRuneGet(runeId) - local args = { - equip_id = runeId, - event_type = BIReport.RUNE_OPT_TYPE.GET, - } - - self:report(EVENT_NAME_RUNE_OPT, args) -end - -function BIReport:postRuneUp(runeId, runeLv) - local args = { - equip_id = runeId, - equip_lv = runeLv, - event_type = BIReport.RUNE_OPT_TYPE.LV_UP, - } - - self:report(EVENT_NAME_RUNE_OPT, args) -end - -function BIReport:postRuneWear(runeId, runeLv) - local args = { - equip_id = runeId, - equip_lv = runeLv, - event_type = BIReport.RUNE_OPT_TYPE.WEAR, - } - self:report(EVENT_NAME_RUNE_OPT, args) + self:report(EVENT_NAME_COIN_USE, args) + BIReport:printArgsStr(EVENT_NAME_COIN_USE, args) end return BIReport \ No newline at end of file diff --git a/lua/app/common/local_data.lua b/lua/app/common/local_data.lua index 966b0ffa..bc2668ee 100644 --- a/lua/app/common/local_data.lua +++ b/lua/app/common/local_data.lua @@ -14,7 +14,6 @@ local LOCAL_DATA_KEY = { LAST_LOGIN_NAME = "LAST_LOGIN_NAME", LAST_LOGIN_IP = "LAST_LOGIN_IP", ACCOUNT_INFO = "ACCOUNT_INFO", - SEND_QUEUE = "SEND_QUEUE", SDK_LOGIN_TYPE = "SDK_LOGIN_TYPE", NEED_UPDATE = "NEED_UPDATE", -- 需要更新 @@ -25,6 +24,7 @@ local LOCAL_DATA_KEY = { LAST_MAIL_ID = "LAST_MAIL_ID", IS_NEW_PLAYER = "IS_NEW_PLAYER", DISTINCT_ID = "DISTINCT_ID", + LAST_LOGIN_TIME = "LAST_LOGIN_TIME", } LocalData.KEYS = LOCAL_DATA_KEY @@ -211,21 +211,6 @@ function LocalData:getLastLoginName() return self:getString(LOCAL_DATA_KEY.LAST_LOGIN_NAME, "") end -function LocalData:saveSendQueue(sendQueue) - local str = json.encode(sendQueue) - if EDITOR_MODE then - Logger.log("---------------------剩余消息队列缓存---------------------------------") - --Logger.logHighlight(str) - print(str) - end - self:setString(LOCAL_DATA_KEY.SEND_QUEUE, str) -end - -function LocalData:getSendQueue() - local sendQueue = json.decode(self:getString(LOCAL_DATA_KEY.SEND_QUEUE, "{}")) - return sendQueue -end - function LocalData:setShakeMode(value) -- 0-close 1-open self:setInt(self:getString(LOCAL_DATA_KEY.SHAKE_MODE), value) end @@ -291,4 +276,8 @@ function LocalData:getDistinctId() return self:getString(LOCAL_DATA_KEY.DISTINCT_ID, "") end +function LocalData:setLastLoginTime() + +end + return LocalData \ No newline at end of file diff --git a/lua/app/common/pay_manager.lua b/lua/app/common/pay_manager.lua index fb1e8ae8..0f83233f 100644 --- a/lua/app/common/pay_manager.lua +++ b/lua/app/common/pay_manager.lua @@ -90,7 +90,7 @@ function PayManager:requestRewards(purchaseToken, orderId, originOrderId, giftTy if msgData.rewards and table.nums(msgData.rewards) > 0 then -- 奖励改到邮件领取 GFunc.showRewardBox(msgData.rewards) end - BIReport:postPayGet(giftType, id, rechargeId, orderId, originOrderId, 1, msgData.rewards or {}) + -- BIReport:postPayGet(giftType, id, rechargeId, orderId, originOrderId, 1, msgData.rewards or {}) local rechargeCfg = ConfigManager:getConfig("recharge")[rechargeId] if rechargeCfg then BIReport:postPurchase(rechargeCfg.price, rechargeCfg.payId, originOrderId, orderId) @@ -135,7 +135,7 @@ function PayManager:checkAndPay(productId, id, purchaseType, rechargeId) 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) + -- BIReport:postPayTurn(giftType, id, rechargeId) SDKManager:pay(productId, msgData.uuid, rechargeId, giftType, function(purchaseToken, orderId, originOrderId) if purchaseToken and orderId then self:requestRewards(purchaseToken, orderId, originOrderId, giftType, id, rechargeId) diff --git a/lua/app/global/global_func.lua b/lua/app/global/global_func.lua index 3ec52c00..d0447925 100644 --- a/lua/app/global/global_func.lua +++ b/lua/app/global/global_func.lua @@ -774,26 +774,22 @@ function GFunc.getRandomIndex(weightArr) return idx end --- function GFunc.getRewardsStr(rewards) --- if rewards == nil then --- return --- end +function GFunc.getRewardsStr(rewards) + if rewards == nil then + return + end --- local itemStr = "" --- for k, v in ipairs(rewards) do --- if v.type == GConst.REWARD_TYPE.ITEM then --- itemStr = itemStr .. v.type .. "." .. v.item.cfg_id .. "." .. v.item.count --- elseif v.type == GConst.REWARD_TYPE.EQUIP then --- itemStr = itemStr .. v.type .. "." .. v.equip.id .. "." .. v.equip.eid --- elseif v.type == GConst.REWARD_TYPE.JEWELRY then --- itemStr = itemStr .. v.type .. "." .. v.jewelry.cfg_id .. "." .. v.jewelry.count --- end --- if k ~= #rewards then --- itemStr = itemStr.. "|" --- end --- end --- return itemStr --- end + local itemStr = "" + for k, v in ipairs(rewards) do + if v.type == GConst.REWARD_TYPE.ITEM then + itemStr = itemStr .. v.type .. "." .. v.item.cfg_id .. "." .. v.item.count + end + if k ~= #rewards then + itemStr = itemStr.. "|" + end + end + return itemStr +end function GFunc.copyStr(str) CS.UnityEngine.GUIUtility.systemCopyBuffer = str diff --git a/lua/app/module/battle/battle_manager.lua b/lua/app/module/battle/battle_manager.lua index 745333da..06806919 100644 --- a/lua/app/module/battle/battle_manager.lua +++ b/lua/app/module/battle/battle_manager.lua @@ -19,6 +19,7 @@ function BattleManager:showBattleResultUI(rewards, combatReport) end function BattleManager:playBattle(battleType, params, returnFunc) + params = params or {} if self.battleController then -- 同一时间只能有一场战斗 self:clear() end @@ -28,6 +29,7 @@ function BattleManager:playBattle(battleType, params, returnFunc) end function BattleManager:_play(battleType, params) + params.battleType = battleType local controllerPath = BATTLE_CONTROLLER[battleType] or BATTLE_CONTROLLER_BASE self.battleController = require(controllerPath):create() self.battleController:init(params) @@ -41,8 +43,11 @@ function BattleManager:onSelectSkill(skillId, value, pos) self.battleController:onSelectSkill(skillId, value, pos) end -function BattleManager:endBattleAndExit() +function BattleManager:endBattleAndExit(proactivelyExit) if self.battleController then + if proactivelyExit then + self.battleController:postWaveOver(false, true) + end self.battleController:endBattleAndExit() else self:exitBattle() diff --git a/lua/app/module/battle/controller/battle_controller.lua b/lua/app/module/battle/controller/battle_controller.lua index 8543be55..8d65832f 100644 --- a/lua/app/module/battle/controller/battle_controller.lua +++ b/lua/app/module/battle/controller/battle_controller.lua @@ -153,7 +153,11 @@ function BattleController:onLinkChange() end end -function BattleController:onRoundBegin() +function BattleController:postWaveOver(atkDead, isQuit) + +end + +function BattleController:postFightStart() end @@ -178,6 +182,13 @@ end function BattleController:init(params) params = params or {} + self.battleType = params.battleType or GConst.BattleConst.BATTLE_TYPE.STAGE + self.battleStartTime = Time:getServerTime() + self.waveStartTime = Time:getServerTime() + self.eliminateCount = 0 + self.eliminateTotalCount = 0 + self.realTime = 0 + self.chapterId = self:getChapterId() self.waveIndex = 0 self.maxWaveIndex = self:getMaxWave() @@ -378,16 +389,22 @@ function BattleController:enterNextWave() local atkTeam = self.battleData:getAtkTeam() if not atkTeam or atkTeam:getIsDead() then self.victory = false + self:postWaveOver(true) self:battleEnd() return end if self.waveIndex >= self.maxWaveIndex then self.victory = true + self:postWaveOver(false) self:battleEnd() return end + if self.waveIndex ~= 0 then -- 第一波 + self:postWaveOver(false) + end + self.waveIndex = self.waveIndex + 1 if self.battleUI then self.battleUI:refreshWave(self.waveIndex) @@ -395,15 +412,20 @@ function BattleController:enterNextWave() if self.waveIndex == 1 then -- 第一波 self:generateBoard(true) else + -- 上报关卡结束 self.defTeam:prepare() end - self:enterRoundBegin() + + self.waveStartTime = Time:getServerTime() + self.eliminateCount = 0 + self.isBossWave = self.defTeam:getMainUnit().unitEntity:getIsBoss() + self:postFightStart() + self:enterRoundBegin() end function BattleController:enterRoundBegin() self.roundStep = BattleConst.BATTLE_ROUND_STEP.ON_BEGIN - self:onRoundBegin() self:enterEliminationBegin() end @@ -422,14 +444,18 @@ function BattleController:enterElimination(needDelay) end if self.battleData:useAddlvCount() then + local skillList = self:getRandomSkillList() if needDelay then self.showSelectSkillSid = ModuleManager.BattleManager:performWithDelayGlobal(function() - self.battleUI:showSelectSkillComp(self:getRandomSkillList()) + self.battleUI:showSelectSkillComp(skillList) self.showSelectSkillSid = nil end, 0.3) else - self.battleUI:showSelectSkillComp(self:getRandomSkillList()) + self.battleUI:showSelectSkillComp(skillList) end + + local totalTime = Time:getServerTime() - self.battleStartTime + BIReport:postShowFightSkillSelect(self.battleType, skillList, self.chapterId, totalTime, self.waveIndex) else self.battleUI:hideAllBoardSfxs() @@ -918,6 +944,9 @@ function BattleController:onLinkOver() self:generateInstructions(skillEntity, linkElementType, lineCount, influenceElementType, elementTypeMap) self:enterAtkStep() end) + + self.eliminateCount = self.eliminateCount + 1 + self.eliminateTotalCount = self.eliminateTotalCount + 1 end function BattleController:fillBoard() @@ -1597,6 +1626,9 @@ function BattleController:onSelectSkill(skillId, value, pos) entity:gotUpSKill(skillId) end + local totalTime = Time:getServerTime() - self.battleStartTime + BIReport:postFightSkillSelect(self.battleType, {skillId}, self.chapterId, totalTime, self.waveIndex) + local elementType = ModuleManager.HeroManager:getSkillRoguePosition(skillId) if elementType then if self.battleUI then @@ -1960,6 +1992,7 @@ function BattleController:addBattleExp(exp) end function BattleController:_tick(dt) + self.realTime = self.realTime + dt if self.isPause then return end diff --git a/lua/app/module/battle/controller/battle_controller_stage.lua b/lua/app/module/battle/controller/battle_controller_stage.lua index d121e5a3..14ad1141 100644 --- a/lua/app/module/battle/controller/battle_controller_stage.lua +++ b/lua/app/module/battle/controller/battle_controller_stage.lua @@ -181,4 +181,38 @@ function BattleControllerStage:controllBattleEnd() ModuleManager.ChapterManager:endFight(self.chapterId, self.combatReport) end +function BattleController:postWaveOver(atkDead, isQuit) + local deathType = BIReport.FIGHT_DEATH_TYPE.SURVIVE + local waveEndType = BIReport.FIGHT_WAVE_END_TYPE.WIN + if atkDead then + if self.isBossWave then + deathType = BIReport.FIGHT_DEATH_TYPE.BOSS_FAIL + else + deathType = BIReport.FIGHT_DEATH_TYPE.NORMAL_FAIL + end + waveEndType = BIReport.FIGHT_WAVE_END_TYPE.FAIL + end + + if isQuit then + waveEndType = BIReport.FIGHT_WAVE_END_TYPE.QUIT + end + + local duration = Time:getServerTime() - self.waveStartTime + local totalTime = Time:getServerTime() - self.battleStartTime + local startTimes = DataManager.ChapterData:getChapterFightCount(self.chapterId) + local isFirstWin = false + if not DataManager.ChapterData:getChapterPassed(self.chapterId) and self.victory then + isFirstWin = true + end + + local isFianlStep = self.waveIndex >= self.maxWaveIndex + + BIReport:postFightEnd(GConst.BattleConst.BATTLE_TYPE.STAGE, self.chapterId, self.waveIndex, duration, totalTime, self.eliminateCount, self.eliminateTotalCount, waveEndType, deathType, startTimes, isFirstWin, isFianlStep) +end + +function BattleControllerStage:postFightStart() + local unlockMaxChapter = DataManager.ChapterData:getNewChapterId() + BIReport:postFightBegin(GConst.BattleConst.BATTLE_TYPE.STAGE, self.waveIndex, self.chapterId, unlockMaxChapter, DataManager.ChapterData:getChapterFightCount(self.chapterId)) +end + return BattleControllerStage \ No newline at end of file diff --git a/lua/app/module/chapter/chapter_manager.lua b/lua/app/module/chapter/chapter_manager.lua index 3d0023b3..13ac8c40 100644 --- a/lua/app/module/chapter/chapter_manager.lua +++ b/lua/app/module/chapter/chapter_manager.lua @@ -15,6 +15,8 @@ function ChapterManager:openBox(chapterId, index) GFunc.showRewardBox(result.rewards) DataManager.ChapterData:init(result.chapterData, true) DataManager.ChapterData:setDirty() + + BIReport:postChapterOpenBox(chapterId, DataManager.ChapterData:getChapterBoxNum(chapterId, index), result.rewards) end end) end @@ -68,6 +70,7 @@ function ChapterManager:endFight(id, combatReport) } ServerDataManager:dataOperate(GConst.ServerDataConst.DATA_OP_BEHAVIOR.END_FIGHT, parmas, function(result) if result.status == 0 then + local maxChapter = DataManager.ChapterData:getNewChapterId() if combatReport.victory and DataManager.ChapterData:getChapterId() == DataManager.ChapterData:getMaxChapterId() + 1 then DataManager.ChapterData:goNextChapter() end @@ -79,6 +82,13 @@ function ChapterManager:endFight(id, combatReport) ModuleManager.BattleManager:showBattleResultUI(newRewards, combatReport) DataManager.ChapterData:init(result.chapterData, true) DataManager.ChapterData:setDirty() + + local newMaxChapter = DataManager.ChapterData:getNewChapterId() + if maxChapter ~= newMaxChapter then + local data = {} + data.max_chapter = newMaxChapter + CS.ThinkingAnalytics.ThinkingAnalyticsAPI.UserSet(data) + end end end) end diff --git a/lua/app/module/login/login_manager.lua b/lua/app/module/login/login_manager.lua index e7be8421..bb86c50f 100644 --- a/lua/app/module/login/login_manager.lua +++ b/lua/app/module/login/login_manager.lua @@ -21,18 +21,23 @@ function LoginManager:loginGame() -- adjust 打开应用事件识别码 BIReport:postAdjustSimpleTrackEvent("xbszrl", {}) + local serverTime = Time:getServerTime() + local todayBeginTime = serverTime - serverTime%86400 + local now = os.date('!*t', serverTime) + Time:updateByServer(serverTime, todayBeginTime) + CS.BF.BFMain.IsGotServerTime = true ServerDataManager:dataOperate(GConst.ServerDataConst.DATA_OP_BEHAVIOR.SYNC_DATA, GConst.EMPTY_TABLE, function(msgData) DataManager:initWithServerData(msgData) ConfigManager:preLoadConfig() ModuleManager.MaincityManager:firstEnterMainCity() - -- local data = {} - -- data.max_chapter = DataManager.StageData:getNewChapterId() + local data = {} + data.max_chapter = DataManager.ChapterData:getNewChapterId() -- data.ads_num = DataManager.PlayerData:getAdCount() -- data.pay_money = DataManager.PlayerData:getPaymentCount() - -- data.play_days = DataManager:getLoginCount() - -- data.now_version = Platform:getClientVersion() - -- CS.ThinkingAnalytics.ThinkingAnalyticsAPI.UserSet(data) + data.play_days = DataManager.PlayerData:getLoginDay() + data.now_version = Platform:getClientVersion() + CS.ThinkingAnalytics.ThinkingAnalyticsAPI.UserSet(data) end) end diff --git a/lua/app/module/login/login_ui.lua b/lua/app/module/login/login_ui.lua index 5033416d..dd4ae8ad 100644 --- a/lua/app/module/login/login_ui.lua +++ b/lua/app/module/login/login_ui.lua @@ -38,6 +38,10 @@ function LoginUI:onLoadRootComplete() BIReport:postGameLogin(false) end + local data = {} + data.open_num = 1 + CS.ThinkingAnalytics.ThinkingAnalyticsAPI.UserAdd(data) + local copyTx = uiMap["login_ui.copy_account_tx"] copyTx:setText(I18N:getGlobalText(I18N.GlobalConst.CLICK_COPY_ACOUNT_DESC)) copyTx:setVisible(true) diff --git a/lua/app/module/maincity/maincity_manager.lua b/lua/app/module/maincity/maincity_manager.lua index 2131c180..b041a7e2 100644 --- a/lua/app/module/maincity/maincity_manager.lua +++ b/lua/app/module/maincity/maincity_manager.lua @@ -10,9 +10,9 @@ function MaincityManager:firstEnterMainCity() DataManager.ChapterData:setChapterId(DataManager.ChapterData.MIN_CHAPTER_ID) ModuleManager.BattleManager:playBattle(GConst.BattleConst.BATTLE_TYPE.STAGE) else + BIReport:postGameLoginFinish() self:showMainCityUI(true) -- SDKManager:doUncompletePay() - -- BIReport:postFightBegin(ModuleManager.BattleManager.BATTLE_TYPE.STAGE, DataManager.ChapterData:getCurChapterId(), DataManager.ChapterData:getHistoryChapterId()) end end diff --git a/lua/app/server/data/server_chapter_data.lua b/lua/app/server/data/server_chapter_data.lua index 04da52ed..529597f0 100644 --- a/lua/app/server/data/server_chapter_data.lua +++ b/lua/app/server/data/server_chapter_data.lua @@ -8,12 +8,26 @@ function ServerChapterData:init(data) self.data.chapterFightInfo = data and data.chapterFightInfo or {} end +function ServerChapterData:enterFight(id) + local idStr = tostring(id) + if not self.data.chapterFightInfo[idStr] then + self.data.chapterFightInfo[idStr] = { + victory = false, + maxWave = 0, + fightCount = 0 + } + end + + self.data.chapterFightInfo[idStr].fightCount = (self.data.chapterFightInfo[idStr].fightCount or 0) + 1 +end + function ServerChapterData:fightChapter(id, victory, wave) local idStr = tostring(id) if not self.data.chapterFightInfo[idStr] then self.data.chapterFightInfo[idStr] = { victory = false, - maxWave = 0 + maxWave = 0, + fightCount = 0 } end diff --git a/lua/app/server/data/server_player_data.lua b/lua/app/server/data/server_player_data.lua index 15637f96..a884c989 100644 --- a/lua/app/server/data/server_player_data.lua +++ b/lua/app/server/data/server_player_data.lua @@ -1,5 +1,15 @@ local ServerPlayerData = class("ServerPlayerData", ServerBaseData) +function ServerPlayerData:init(data) + self.data.loginDay = data and data.loginDay or 0 + self.data.lastLoginTime = data and data.lastLoginTime or 0 + Logger.logHighlight(Time:getServerTime()) + if self.data.lastLoginTime < Time:getBeginningOfServerToday() then + self.data.lastLoginTime = Time:getBeginningOfServerToday() + self.data.loginDay = self.data.loginDay + 1 + end +end + function ServerPlayerData:setVit(vit) self.vit = tonumber(vit) or 0 end diff --git a/lua/app/server/manager/server_chapter_manager.lua b/lua/app/server/manager/server_chapter_manager.lua index c3b2fba8..4f7e9361 100644 --- a/lua/app/server/manager/server_chapter_manager.lua +++ b/lua/app/server/manager/server_chapter_manager.lua @@ -50,6 +50,7 @@ function ServerChapterManager:startFight(params, callback) end return end + ServerGameData.ChapterData:enterFight(params.id) result.cost = ServerGameData:addCosts({cost}) result.status = 0 if callback then diff --git a/lua/app/ui/battle/battle_pause_ui.lua b/lua/app/ui/battle/battle_pause_ui.lua index 530b8c1a..4cd94c09 100644 --- a/lua/app/ui/battle/battle_pause_ui.lua +++ b/lua/app/ui/battle/battle_pause_ui.lua @@ -42,7 +42,7 @@ function BattlePauseUI:_addListeners() okText = I18N:getGlobalText(I18N.GlobalConst.BTN_TEXT_OK), cancelText = I18N:getGlobalText(I18N.GlobalConst.BTN_TEXT_CANCEL), okFunc = function() - ModuleManager.BattleManager:endBattleAndExit() + ModuleManager.BattleManager:endBattleAndExit(true) end, } GFunc.showMessageBox(params) diff --git a/lua/app/userdata/bag/item_data.lua b/lua/app/userdata/bag/item_data.lua index 54fc8cb4..b445a933 100644 --- a/lua/app/userdata/bag/item_data.lua +++ b/lua/app/userdata/bag/item_data.lua @@ -21,16 +21,15 @@ function ItemData:init(data) data = data or {} if data.items then for _, info in pairs(data.items) do - -- if info.id == GConst.ItemConst.ITEM_ID_GEM then - -- local parmas = {} - -- parmas.gem = BigNumOpt.bigNum2Num(info.count) - -- CS.ThinkingAnalytics.ThinkingAnalyticsAPI.UserSet(parmas) - -- elseif info.id == GConst.ItemConst.ITEM_ID_GOLD then - -- local parmas = {} - -- parmas.gold_value = info.count - -- parmas.gold_unit = info.count - -- CS.ThinkingAnalytics.ThinkingAnalyticsAPI.UserSet(parmas) - -- end + if info.id == GConst.ItemConst.ITEM_ID_GEM then + local parmas = {} + parmas.gem = info.count + CS.ThinkingAnalytics.ThinkingAnalyticsAPI.UserSet(parmas) + elseif info.id == GConst.ItemConst.ITEM_ID_GOLD then + local parmas = {} + parmas.gold = info.count + CS.ThinkingAnalytics.ThinkingAnalyticsAPI.UserSet(parmas) + end if info.cfg_id == GConst.ItemConst.ITEM_ID_VIT then DataManager.PlayerData:setVit(info.count) end @@ -146,41 +145,46 @@ function ItemData:addItem(data, itemGetType) self:_addItemNumById(data.cfg_id, data.count) - -- if data.cfg_id == GConst.ItemConst.ITEM_ID_GEM or data.cfg_id == GConst.ItemConst.ITEM_ID_GOLD then - -- if data.count < 0 then - -- if data.cfg_id == GConst.ItemConst.ITEM_ID_GOLD and itemGetType == BIReport.ITEM_GET_TYPE.TRAIN_UP then - -- else - -- BIReport:postGemUse(data.count, itemGetType, data.cfg_id) - -- if data.cfg_id == GConst.ItemConst.ITEM_ID_GEM then - -- CS.ThinkingAnalytics.ThinkingAnalyticsAPI.UserAdd("gem", data.count) - -- elseif data.cfg_id == GConst.ItemConst.ITEM_ID_GOLD then - -- local goldNum = DataManager.BagData.ItemData:getItemNumById(GConst.ItemConst.ITEM_ID_GOLD) - -- local parmas = {} - -- parmas.gold = goldNum - -- CS.ThinkingAnalytics.ThinkingAnalyticsAPI.UserSet(parmas) - -- end - -- end - -- else - -- if data.cfg_id == GConst.ItemConst.ITEM_ID_GOLD and itemGetType == BIReport.ITEM_GET_TYPE.CHAPTER_DROP then - -- else - -- BIReport:postGemGet(data.count, itemGetType, data.cfg_id) - -- if data.cfg_id == GConst.ItemConst.ITEM_ID_GEM then - -- CS.ThinkingAnalytics.ThinkingAnalyticsAPI.UserAdd("gem", data.count) - -- elseif data.cfg_id == GConst.ItemConst.ITEM_ID_GOLD then - -- local goldNum = DataManager.BagData.ItemData:getItemNumById(GConst.ItemConst.ITEM_ID_GOLD) - -- local parmas = {} - -- parmas.gold = goldNum - -- CS.ThinkingAnalytics.ThinkingAnalyticsAPI.UserSet(parmas) - -- end - -- end - -- end - -- else - -- if data.count < 0 then - -- BIReport:postItemUse(data.count, data.cfg_id, itemGetType) - -- else - -- BIReport:postItemGet(data.count, data.cfg_id, itemGetType) - -- end - -- end + if data.cfg_id == GConst.ItemConst.ITEM_ID_GEM or data.cfg_id == GConst.ItemConst.ITEM_ID_GOLD then + if data.count < 0 then + BIReport:postGemUse(data.count, itemGetType, data.cfg_id) + if data.cfg_id == GConst.ItemConst.ITEM_ID_GEM then + CS.ThinkingAnalytics.ThinkingAnalyticsAPI.UserAdd("gem", data.count) + elseif data.cfg_id == GConst.ItemConst.ITEM_ID_GOLD then + local goldNum = DataManager.BagData.ItemData:getItemNumById(GConst.ItemConst.ITEM_ID_GOLD) + local parmas = {} + parmas.gold = goldNum + CS.ThinkingAnalytics.ThinkingAnalyticsAPI.UserSet(parmas) + end + else + BIReport:postGemGet(data.count, itemGetType, data.cfg_id) + if data.cfg_id == GConst.ItemConst.ITEM_ID_GEM then + CS.ThinkingAnalytics.ThinkingAnalyticsAPI.UserAdd("gem", data.count) + elseif data.cfg_id == GConst.ItemConst.ITEM_ID_GOLD then + local goldNum = DataManager.BagData.ItemData:getItemNumById(GConst.ItemConst.ITEM_ID_GOLD) + local parmas = {} + parmas.gold = goldNum + CS.ThinkingAnalytics.ThinkingAnalyticsAPI.UserSet(parmas) + end + end + if data.cfg_id == GConst.ItemConst.ITEM_ID_GEM then + CS.ThinkingAnalytics.ThinkingAnalyticsAPI.UserAdd("user_gem", data.count) + elseif data.cfg_id == GConst.ItemConst.ITEM_ID_GOLD then + CS.ThinkingAnalytics.ThinkingAnalyticsAPI.UserAdd("user_gold", data.count) + end + elseif data.cfg_id == GConst.ItemConst.ITEM_ID_VIT then + if data.count < 0 then + BIReport:postVitUse(data.count) + else + BIReport:postVitGet(data.count, itemGetType) + end + else + if data.count < 0 then + BIReport:postItemUse(data.count, data.cfg_id, itemGetType) + else + BIReport:postItemGet(data.count, data.cfg_id, itemGetType) + end + end end function ItemData:addItemNumById(id, num, itemGetType) diff --git a/lua/app/userdata/chapter/chapter_data.lua b/lua/app/userdata/chapter/chapter_data.lua index 8dd5376a..3e008d2e 100644 --- a/lua/app/userdata/chapter/chapter_data.lua +++ b/lua/app/userdata/chapter/chapter_data.lua @@ -66,6 +66,10 @@ function ChapterData:getNextChapter(chapterId) return chapterInfo.next_chapter end +function ChapterData:getNewChapterId() + return self:getNextChapter(self:getMaxChapterId()) +end + function ChapterData:isFinalChapter(chapterId) local chapterInfo = self:getChapterCfg()[chapterId] if chapterInfo == nil then @@ -170,6 +174,15 @@ function ChapterData:getChapterMaxWave(chapterId) return 0 end +function ChapterData:getChapterFightCount(chapterId) + chapterId = tostring(chapterId or self:getChapterId()) + if self.data.chapterFightInfo[chapterId] then + return self.data.chapterFightInfo[chapterId].fightCount or 0 + end + + return 0 +end + function ChapterData:getFightCost() return GFunc.getConstReward("chapter_cost") end @@ -233,4 +246,13 @@ function ChapterData:getIsHaveRewards(chapterId) return false end +function ChapterData:getChapterPassed(chapterId) + chapterId = tostring(chapterId or self:getChapterId()) + if self.data.chapterFightInfo[chapterId] then + return self.data.chapterFightInfo[chapterId].victory or false + end + + return false +end + return ChapterData \ No newline at end of file diff --git a/lua/app/userdata/player/player_data.lua b/lua/app/userdata/player/player_data.lua index f46baf79..dd365c93 100644 --- a/lua/app/userdata/player/player_data.lua +++ b/lua/app/userdata/player/player_data.lua @@ -1,6 +1,9 @@ local PlayerData = class("PlayerData", BaseData) function PlayerData:init(data) + data = data or {} + self.loginDay = data.loginDay or 1 + self.lastLoginTime = data.lastLoginTime or Time:getBeginningOfServerToday() end function PlayerData:setVit(vit) @@ -18,4 +21,8 @@ function PlayerData:getMaxVit() return self.maxVit end +function PlayerData:getLoginDay() + return self.loginDay +end + return PlayerData \ No newline at end of file From de21e5e1a88fdd773f3810e983f5139e1e74708d Mon Sep 17 00:00:00 2001 From: xiekaidong Date: Wed, 26 Apr 2023 18:25:17 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E7=95=8C=E9=9D=A2=E8=B0=83=E6=95=B4?= =?UTF-8?q?=E5=92=8Cgm=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lua/app/config/localization/localization_global_const.lua | 1 + lua/app/config/strings/cn/global.lua | 1 + lua/app/server/server_data_manager.lua | 7 +++++++ lua/app/ui/main_city/component/main_comp.lua | 2 ++ 4 files changed, 11 insertions(+) diff --git a/lua/app/config/localization/localization_global_const.lua b/lua/app/config/localization/localization_global_const.lua index 2efff20c..3007f01e 100644 --- a/lua/app/config/localization/localization_global_const.lua +++ b/lua/app/config/localization/localization_global_const.lua @@ -1,5 +1,6 @@ local LocalizationGlobalConst = { + CHAPTER_DESC_1 = "CHAPTER_DESC_1", MAIN_BTN_1 = "MAIN_BTN_1", QLT_DESC_1 = "QLT_DESC_1", QLT_DESC_2 = "QLT_DESC_2", diff --git a/lua/app/config/strings/cn/global.lua b/lua/app/config/strings/cn/global.lua index b91f5dc9..f76d5443 100644 --- a/lua/app/config/strings/cn/global.lua +++ b/lua/app/config/strings/cn/global.lua @@ -55,6 +55,7 @@ local localization_global = ["LOADING_DESC"] = "加载中.......", ["CLICK_COPY_ACOUNT_DESC"] = "点击复制用户ID", ["APP"] = "版本号:", + ["CHAPTER_DESC_1"] = "最高纪录{0}", } return localization_global \ No newline at end of file diff --git a/lua/app/server/server_data_manager.lua b/lua/app/server/server_data_manager.lua index 9caf4b33..c8b1e13f 100644 --- a/lua/app/server/server_data_manager.lua +++ b/lua/app/server/server_data_manager.lua @@ -153,6 +153,13 @@ function ServerDataManager:dealGM(params, callback) if not id then return end + local cfg = ConfigManager:getConfig("chapter") + for id, info in ipairs(cfg) do + local maxWave = info.box_num[#info.box_num] + if maxWave then + ServerGameData.ChapterData:fightChapter(id, true, maxWave) + end + end ServerGameData.ChapterData.data.maxChapterId = id end diff --git a/lua/app/ui/main_city/component/main_comp.lua b/lua/app/ui/main_city/component/main_comp.lua index 200d763a..b7507b45 100644 --- a/lua/app/ui/main_city/component/main_comp.lua +++ b/lua/app/ui/main_city/component/main_comp.lua @@ -16,6 +16,7 @@ end function MainComp:initChapter() self.chapterImg = self.uiMap["main_comp.chapter.img"] self.chapterNameTx = self.uiMap["main_comp.chapter.name_tx"] + self.chapterWavetx = self.uiMap["main_comp.chapter.record_tx"] self.leftArrow = self.uiMap["main_comp.chapter.left_arrow"] local leftArrowBtn = self.uiMap["main_comp.chapter.left_arrow.btn"] leftArrowBtn:addClickListener(function() @@ -88,6 +89,7 @@ function MainComp:refreshChapter(force) if chapterI18NInfo then self.chapterNameTx:setText(chapterI18NInfo.name) end + self.chapterWavetx:setText(I18N:getGlobalText(I18N.GlobalConst.CHAPTER_DESC_1, DataManager.ChapterData:getChapterMaxWave())) local slider = self.uiMap["main_comp.chapter.progress_bg.slider"] if not self.boxObjs then