From 2c585b736d97b9c39a5ae124abb132718fdbb0a8 Mon Sep 17 00:00:00 2001 From: zqj <582132116@qq.com> Date: Tue, 4 Jan 2022 18:22:27 +0800 Subject: [PATCH] del: 删除Hero_stickersConvertRpc协议,客户端使用的使用多选一礼包协议 Role_useSelectItemRpc = 134 --- src/ProtocolCode.lua | 1 - src/actions/HeroAction.lua | 23 ----------------------- 2 files changed, 0 insertions(+), 24 deletions(-) diff --git a/src/ProtocolCode.lua b/src/ProtocolCode.lua index d832dc3..d5d6591 100644 --- a/src/ProtocolCode.lua +++ b/src/ProtocolCode.lua @@ -120,7 +120,6 @@ actionCodes = { Hero_setWishPoolRpc = 226, Hero_changeSparkRpc = 227, Hero_saveGeniusTreeRpc = 228, - Hero_stickersConvertRpc = 229, --兑换英雄贴纸 Hang_startRpc = 251, Hang_checkRpc = 252, diff --git a/src/actions/HeroAction.lua b/src/actions/HeroAction.lua index 358465b..c083c54 100644 --- a/src/actions/HeroAction.lua +++ b/src/actions/HeroAction.lua @@ -1412,27 +1412,4 @@ function _M.saveGeniusTreeRpc(agent, data) return true end -function _M.stickersConvertRpc(agent, data) - local role = agent.role - local msg = MsgPack.unpack(data) - local itemId = msg.itemId - local heroType = msg.heroType -- heroId-300 举例 [泡泡]= {[heroType] = 120, [heroId]= 420} - - local itemData = csvdb["itemCsv"][itemId] - if not itemData then return 1 end - - local useEffect = itemData["use_effect"]:toNumMap() - if not useEffect[heroType] then return 2 end - - if not role:isHaveHero(heroType) then return 3 end - - local cost = {[itemId] = 1} - if not role:checkItemEnough(cost) then return 4 end - if not role:costItems({[heroType] = cost}, {log = {desc = "heroStickers"}}) then return 5 end - local reward, change = role:award({[heroType] = 1}, {log = {desc = "heroStickers"}}) - - SendPacket(actionCodes.Hero_stickersConvertRpc, MsgPack.pack(role:packReward(reward, change))) - return true -end - return _M -- libgit2 0.21.2