From c61c88266b4ccd0072819ebf472fb45a11705ffb Mon Sep 17 00:00:00 2001 From: by <123456@qq.com> Date: Tue, 25 Jun 2024 10:48:36 +0800 Subject: [PATCH] =?UTF-8?q?=E7=B4=AF=E8=AE=A1=E7=AD=BE=E5=88=B0=E8=BF=9B?= =?UTF-8?q?=E9=98=B6=E5=A5=96=E5=8A=B1=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- protocol/welfare/welfare.pb.go | 2 +- protocol/welfare/welfare.proto | 2 +- worldsrv/welfmgr.go | 6 ++++++ 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/protocol/welfare/welfare.pb.go b/protocol/welfare/welfare.pb.go index 786c83b..43b8942 100644 --- a/protocol/welfare/welfare.pb.go +++ b/protocol/welfare/welfare.pb.go @@ -430,7 +430,7 @@ type AddUp2TypeDate struct { Day int32 `protobuf:"varint,1,opt,name=Day,proto3" json:"Day,omitempty"` Id int32 `protobuf:"varint,2,opt,name=Id,proto3" json:"Id,omitempty"` // 1,代表观看视频 2,代表钻石类型 - Num int32 `protobuf:"varint,3,opt,name=Num,proto3" json:"Num,omitempty"` //数量 + Num int32 `protobuf:"varint,3,opt,name=Num,proto3" json:"Num,omitempty"` //完成次数 } func (x *AddUp2TypeDate) Reset() { diff --git a/protocol/welfare/welfare.proto b/protocol/welfare/welfare.proto index 944e4ec..2e988e9 100644 --- a/protocol/welfare/welfare.proto +++ b/protocol/welfare/welfare.proto @@ -81,7 +81,7 @@ message WelfareDate { message AddUp2TypeDate{ int32 Day = 1; int32 Id = 2; // 1,代表观看视频 2,代表钻石类型 - int32 Num = 3; //数量 + int32 Num = 3; //完成次数 } //转动转盘 diff --git a/worldsrv/welfmgr.go b/worldsrv/welfmgr.go index 512db11..0004ab0 100644 --- a/worldsrv/welfmgr.go +++ b/worldsrv/welfmgr.go @@ -757,6 +757,9 @@ func (this *WelfareMgr) UpdateAddUp2Date(p *Player, day int32, endTime int64) { return } typeId := addUpDate2Type[0].Id + if p.WelfData.Sign7.Addup2Data[day] == nil { + p.WelfData.Sign7.Addup2Data[day] = make(map[int32]int64) + } p.WelfData.Sign7.Addup2Data[day][typeId] = endTime //通知客户端 pack := &welfare.SCSignDayAddup2Award{} @@ -772,6 +775,9 @@ func (this *WelfareMgr) GetAddUp2Award(p *Player, day int32) { // 判断是否已经领取 Num := int32(0) EndTime := int64(0) + if p.WelfData.Sign7.Addup2Data[day] == nil { + return + } for num, endTime := range p.WelfData.Sign7.Addup2Data[day] { if endTime == -1 { return