From 5eff2c3633159aea4abcc94538a37f7a9afd1e02 Mon Sep 17 00:00:00 2001 From: xiekaidong Date: Thu, 10 Aug 2023 18:41:24 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=8A=E6=8A=A5=E5=92=8C=E5=AE=B9=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lua/app/common/bi_report.lua | 14 +++++++-- lua/app/net/net_manager.lua | 2 +- lua/app/userdata/battle/battle_base_data.lua | 30 +++++++++++--------- 3 files changed, 29 insertions(+), 17 deletions(-) diff --git a/lua/app/common/bi_report.lua b/lua/app/common/bi_report.lua index 864e8f7b..8e3de99c 100644 --- a/lua/app/common/bi_report.lua +++ b/lua/app/common/bi_report.lua @@ -376,6 +376,7 @@ function BIReport:report(name, args) if DataManager.DungeonData then args.dungeon_progress = DataManager.DungeonData:getDungeonBIStr() end + args.game_version = DataManager.PlayerData:getGameVersion() end args.current_version = CS.BF.BFMain.Instance.GameLaunchMgr:GetCurrentVersion() args.is_new_player = self.isNewPlayer @@ -1564,13 +1565,22 @@ function BIReport:postDailyChallengeTaskState(completedCount, taskInfo) self:report(EVENT_NAME_DAILY_CHALLENGE_OPT, args) end -function BIReport:postNetError(pbName, code, reqData) +function BIReport:postNetError(pbName, code, reqData, pbData) + local msg = GConst.EMPTY_STRING + if pbData then + msg = json.encode(pbData) + if msg and #msg > 2000 then + msg = string.sub(msg, 1, 2000) + end + end + local args = { event_type = BIReport.NETWORK_OPT_TYPE.ERROR_CODE, pb_name = pbName, ui_name = UIManager:getTopUIIndex(), error_code = code, - req_data = reqData + req_data = reqData, + msg = msg, } self:report(EVENT_NAME_NETWORK_OPT, args) end diff --git a/lua/app/net/net_manager.lua b/lua/app/net/net_manager.lua index 1b68cb80..625e9956 100644 --- a/lua/app/net/net_manager.lua +++ b/lua/app/net/net_manager.lua @@ -773,7 +773,7 @@ function NetManager:onReceive(msgId, data) reqDataStr = json.encode(sendInfo.params) end end - BIReport:postNetError(sendMsgName, pbData.err_code, reqDataStr) + BIReport:postNetError(sendMsgName, pbData.err_code, reqDataStr, pbData) end local callbacks = self.receiveCallbacks[msg] diff --git a/lua/app/userdata/battle/battle_base_data.lua b/lua/app/userdata/battle/battle_base_data.lua index 9f0e3d42..401ae443 100644 --- a/lua/app/userdata/battle/battle_base_data.lua +++ b/lua/app/userdata/battle/battle_base_data.lua @@ -215,20 +215,22 @@ function BattleBaseData:refreshBoard(board, boardEdge, blockIcon, snapshot) boardEdge = snapshot.gridEdge end - for _, info in pairs(boardEdge) do - local initInfo = { - posId = info.pos, - edgeType = info.type, - direction = info.direction, - battleData = self - } - if not self.gridEdgeEntities[initInfo.posId] then - self.gridEdgeEntities[initInfo.posId] = {} - end - if self.gridEdgeEntities[initInfo.posId][initInfo.direction] then - self.gridEdgeEntities[initInfo.posId][initInfo.direction]:ctor(initInfo) - else - self.gridEdgeEntities[initInfo.posId][initInfo.direction] = self:getNewGridEdgeEntity(initInfo) + if boardEdge then + for _, info in pairs(boardEdge) do + local initInfo = { + posId = info.pos, + edgeType = info.type, + direction = info.direction, + battleData = self + } + if not self.gridEdgeEntities[initInfo.posId] then + self.gridEdgeEntities[initInfo.posId] = {} + end + if self.gridEdgeEntities[initInfo.posId][initInfo.direction] then + self.gridEdgeEntities[initInfo.posId][initInfo.direction]:ctor(initInfo) + else + self.gridEdgeEntities[initInfo.posId][initInfo.direction] = self:getNewGridEdgeEntity(initInfo) + end end end