From eb1d1b9fbf9ae2f660fe5c97c0ce9dc21df06e59 Mon Sep 17 00:00:00 2001 From: chenxi Date: Mon, 8 May 2023 14:39:11 +0800 Subject: [PATCH] =?UTF-8?q?=E8=81=94=E7=BD=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lua/app/module/login/login_manager.lua | 2 +- lua/app/proto/proto_msg_type.lua | 12 ++++++++++++ lua/app/userdata/bag/bag_data.lua | 2 -- lua/app/userdata/bag/item_data.lua | 2 +- lua/app/userdata/formation/formation_data.lua | 14 ++++++-------- lua/app/userdata/player/player_data.lua | 5 ----- 6 files changed, 20 insertions(+), 17 deletions(-) diff --git a/lua/app/module/login/login_manager.lua b/lua/app/module/login/login_manager.lua index bcdd010e..43bd4470 100644 --- a/lua/app/module/login/login_manager.lua +++ b/lua/app/module/login/login_manager.lua @@ -143,7 +143,7 @@ function LoginManager:loginFinish(data) data.max_chapter = DataManager.ChapterData:getNewChapterId() -- data.ads_num = DataManager.PlayerData:getAdCount() -- data.pay_money = DataManager.PlayerData:getPaymentCount() - data.play_days = DataManager.PlayerData:getLoginDay() + -- data.play_days = DataManager.PlayerData:getLoginDay() data.now_version = Platform:getClientVersion() CS.ThinkingAnalytics.ThinkingAnalyticsAPI.UserSet(data) diff --git a/lua/app/proto/proto_msg_type.lua b/lua/app/proto/proto_msg_type.lua index a67c404f..a9868109 100644 --- a/lua/app/proto/proto_msg_type.lua +++ b/lua/app/proto/proto_msg_type.lua @@ -5,9 +5,13 @@ local ProtoMsgType = { [109702075] = "PigLevelDownRsp", [132242856] = "ChapterSettlementReq", [132244689] = "ChapterSettlementRsp", + [147147672] = "EnergyByADReq", + [147149505] = "EnergyByADRsp", [516281556] = "GuideFundMarkReq", [516283389] = "GuideFundMarkRsp", [531558517] = "PigPlayUpdateNtf", + [554454681] = "EnergyByDiamondReq", + [554456514] = "EnergyByDiamondRsp", [565555292] = "MallPayNtf", [565621982] = "MallPayReq", [565623815] = "MallPayRsp", @@ -82,9 +86,13 @@ local ProtoMsgType = { PigLevelDownRsp = 109702075, ChapterSettlementReq = 132242856, ChapterSettlementRsp = 132244689, + EnergyByADReq = 147147672, + EnergyByADRsp = 147149505, GuideFundMarkReq = 516281556, GuideFundMarkRsp = 516283389, PigPlayUpdateNtf = 531558517, + EnergyByDiamondReq = 554454681, + EnergyByDiamondRsp = 554456514, MallPayNtf = 565555292, MallPayReq = 565621982, MallPayRsp = 565623815, @@ -159,9 +167,13 @@ local ProtoMsgType = { PigLevelDownRsp = "PigLevelDownRsp", ChapterSettlementReq = "ChapterSettlementReq", ChapterSettlementRsp = "ChapterSettlementRsp", + EnergyByADReq = "EnergyByADReq", + EnergyByADRsp = "EnergyByADRsp", GuideFundMarkReq = "GuideFundMarkReq", GuideFundMarkRsp = "GuideFundMarkRsp", PigPlayUpdateNtf = "PigPlayUpdateNtf", + EnergyByDiamondReq = "EnergyByDiamondReq", + EnergyByDiamondRsp = "EnergyByDiamondRsp", MallPayNtf = "MallPayNtf", MallPayReq = "MallPayReq", MallPayRsp = "MallPayRsp", diff --git a/lua/app/userdata/bag/bag_data.lua b/lua/app/userdata/bag/bag_data.lua index 30cbb19c..aca24a04 100644 --- a/lua/app/userdata/bag/bag_data.lua +++ b/lua/app/userdata/bag/bag_data.lua @@ -1,7 +1,5 @@ local BagData = class("BagData", BaseData) -local ItemConst = require "app/module/item/item_const" - BagData.RECOVERY_TYPE = { TIMELY = 1, DAILY = 2, diff --git a/lua/app/userdata/bag/item_data.lua b/lua/app/userdata/bag/item_data.lua index a197af32..7f23d30f 100644 --- a/lua/app/userdata/bag/item_data.lua +++ b/lua/app/userdata/bag/item_data.lua @@ -44,7 +44,7 @@ function ItemData:init(data) if recoveryInfo then local obj = { id = v.id, - ts = v.ts, + ts = v.ts // 1000, limit = recoveryInfo.limit, recoveryType = recoveryInfo.type, time = recoveryInfo.time diff --git a/lua/app/userdata/formation/formation_data.lua b/lua/app/userdata/formation/formation_data.lua index 7bda5064..e9b0d064 100644 --- a/lua/app/userdata/formation/formation_data.lua +++ b/lua/app/userdata/formation/formation_data.lua @@ -3,15 +3,13 @@ local FormationData = class("FormationData", BaseData) function FormationData:init(data) self.data.dirty = false self.formations = {} + -- 目前只有主线关卡的 if data and data.heroes then - -- for formationType, formation in pairs(data.heroes) do - local clientFormation = {} - -- self.formations[formationType] = clientFormation - self.formations[GConst.BattleConst.BATTLE_TYPE.STAGE] = clientFormation -- 暂时写死 - for matchType, heroId in pairs(data.heroes) do - clientFormation[matchType] = heroId - end - -- end + local clientFormation = {} + for matchType, heroId in pairs(data.heroes) do + clientFormation[tonumber(matchType)] = heroId + end + self.formations[GConst.BattleConst.BATTLE_TYPE.STAGE] = clientFormation end end diff --git a/lua/app/userdata/player/player_data.lua b/lua/app/userdata/player/player_data.lua index d71ddcbf..da04c290 100644 --- a/lua/app/userdata/player/player_data.lua +++ b/lua/app/userdata/player/player_data.lua @@ -6,7 +6,6 @@ function PlayerData:init(data) self.data.exp = data.exp or 0 self.data.dirty = false self.data.payAmount = data.pay_amount or 0 - self.loginDay = data.loginDay or 1 self.lastLoginTime = data.lastLoginTime or Time:getBeginningOfServerToday() end @@ -33,8 +32,4 @@ function PlayerData:getExpPercent() return 0 end -function PlayerData:getLoginDay() - return self.loginDay -end - return PlayerData \ No newline at end of file