From 9a8b5d25efbb352f45f825ad15e9feb8f1f366ac Mon Sep 17 00:00:00 2001 From: sk <123456@qq.com> Date: Tue, 16 Apr 2024 14:31:33 +0800 Subject: [PATCH] =?UTF-8?q?=E9=9B=86=E5=8D=A1=E6=B4=BB=E5=8A=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- worldsrv/action_bag.go | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/worldsrv/action_bag.go b/worldsrv/action_bag.go index daaa88e..e039d59 100644 --- a/worldsrv/action_bag.go +++ b/worldsrv/action_bag.go @@ -92,6 +92,20 @@ func (this *CSUpBagInfoHandler) Process(s *netlib.Session, packetid int, data in return nil } + if common.Config.IsDevMode { + if msg.GetOpt() == -1 { + items := []*Item{{ + ItemId: msg.ItemId, + ItemNum: int64(msg.ItemNum), + }} + BagMgrSingleton.AddJybBagInfo(p, items, 0, common.GainWay_AddBag, "system", "测试") + for _, v := range items { + BagMgrSingleton.RecordItemLog(p.Platform, p.SnId, ItemObtain, v.ItemId, v.Name, v.ItemNum, "测试") + } + return nil + } + } + pack := &bag.SCUpBagInfo{RetCode: bag.OpResultCode_OPRC_Error} send := func() { p.SendToClient(int(bag.SPacketID_PACKET_ALL_BAG_USE), pack) @@ -328,6 +342,7 @@ func CSExchangeList(s *netlib.Session, packetid int, data interface{}, sid int64 }) } pack.Infos = append(pack.Infos, &bag.ExchangeInfo{ + Id: v.Id, CostItems: costItems, GainItems: gainItems, }) @@ -398,7 +413,7 @@ func CSPropExchange(s *netlib.Session, packetid int, data interface{}, sid int64 BagMgrSingleton.RecordItemLog(p.Platform, p.SnId, ItemConsume, item.ItemId, item.Name, item.ItemNum, "集卡活动兑换使用") } // 增加背包物品 - BagMgrSingleton.AddJybBagInfo(p, items, 0, common.GainWay_Collect, "player", "集卡活动兑换") + BagMgrSingleton.AddJybBagInfo(p, items, 0, common.GainWay_Collect, "system", "集卡活动兑换") for _, v := range items { BagMgrSingleton.RecordItemLog(p.Platform, p.SnId, ItemObtain, v.ItemId, v.Name, v.ItemNum, "集卡活动兑换获得") pack.Items = append(pack.Items, &bag.PropInfo{