From 5db3c767e4c59c38870286389ca01161a8b62809 Mon Sep 17 00:00:00 2001 From: sk <123456@qq.com> Date: Fri, 3 Jan 2025 15:50:06 +0800 Subject: [PATCH] =?UTF-8?q?fix=20=E7=BA=A2=E5=8C=85=E6=B4=BB=E5=8A=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- model/redpacket.go | 20 ++++++-------------- mq/keyconf.go | 1 - worldsrv/welfmgr.go | 4 ++++ 3 files changed, 10 insertions(+), 15 deletions(-) diff --git a/model/redpacket.go b/model/redpacket.go index 578afef..2b577f4 100644 --- a/model/redpacket.go +++ b/model/redpacket.go @@ -68,18 +68,10 @@ func UpdateRedPacketAll(plt string, list []*RedPacket) error { // BackRedPacket 红包统计数据 type BackRedPacket struct { - Platform string - Id int32 - SnId int32 - ItemId int32 - ItemNum int64 - Ts int64 -} - -type BackActivityConsume struct { - Platform string - TaskId int32 // 任务id - SnId int32 - Num int64 // 消耗钻石数量 - + Platform string // 平台 + Id int32 // 红包活动id + SnId int32 // 玩家id + ItemId int32 // 道具id + ItemNum int64 // 道具数量 + Ts int64 // 时间戳 } diff --git a/mq/keyconf.go b/mq/keyconf.go index 2c62158..d4ba3b9 100644 --- a/mq/keyconf.go +++ b/mq/keyconf.go @@ -20,7 +20,6 @@ const ( BackActivityLog = "back_activitylog" BackOnlineGame = "back_onlinegame" BackRedPacket = "back_redpacket" - BackConsumeTask = "back_consumetask" ) // go后端 diff --git a/worldsrv/welfmgr.go b/worldsrv/welfmgr.go index 7292935..734e3fa 100644 --- a/worldsrv/welfmgr.go +++ b/worldsrv/welfmgr.go @@ -2324,6 +2324,10 @@ func (this *WelfareMgr) GetRedPacket(p *Player, id int64) *welfare.SCRedPacketDr return nil } + if p.WelfData.RedPacket == nil { + p.WelfData.RedPacket = make(map[int64]*model.RedPacketData) + } + if p.WelfData.RedPacket[id] == nil { p.WelfData.RedPacket[id] = &model.RedPacketData{} }