From d2c5c4f1599d81ad5832931912b4416225a7ea52 Mon Sep 17 00:00:00 2001 From: sk <123456@qq.com> Date: Mon, 2 Sep 2024 17:31:45 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B4=BB=E5=8A=A8=E7=A4=BC=E5=8C=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dbproxy/svc/l_jybuser.go | 6 ++++-- model/jyb.go | 2 +- worldsrv/hundredscenemgr.go | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/dbproxy/svc/l_jybuser.go b/dbproxy/svc/l_jybuser.go index efa1a00..a8dc343 100644 --- a/dbproxy/svc/l_jybuser.go +++ b/dbproxy/svc/l_jybuser.go @@ -156,10 +156,12 @@ func upJybUser(cjybuse, cjyb *mongo.Collection, snId, codeType int32, plt, useCo if jybuser.JybInfos == nil { jybuser.JybInfos = make(map[string]int32) } else if _, exist := jybuser.JybInfos[jybuseerid]; exist { // 该类型礼包玩家已经领取过 - return model.ErrJYBPlCode + if ret.CodeType != 3 { + return model.ErrJYBPlCode + } } - jybuser.JybInfos[jybuseerid] = 1 + jybuser.JybInfos[jybuseerid]++ err = cjybuse.Update(bson.M{"_id": jybuser.JybUserId}, bson.D{{"$set", bson.D{{"jybinfos", jybuser.JybInfos}}}}) if err != nil { diff --git a/model/jyb.go b/model/jyb.go index c365ef4..78b60f0 100644 --- a/model/jyb.go +++ b/model/jyb.go @@ -53,7 +53,7 @@ type JybInfo struct { JybId bson.ObjectId `bson:"_id"` // 礼包ID Platform string //平台 Name string // 礼包名称 - CodeType int32 // 礼包类型 1 通用 2 特殊 + CodeType int32 // 礼包类型 1 通用 2专属(自动生成兑换码,每个玩家领一个) 3活动(自动生产兑换码,每个兑换码领一个) StartTime int64 // 开始时间 Unix EndTime int64 // 结束时间 Content string // 礼包内容 diff --git a/worldsrv/hundredscenemgr.go b/worldsrv/hundredscenemgr.go index 2766caa..70c59e0 100644 --- a/worldsrv/hundredscenemgr.go +++ b/worldsrv/hundredscenemgr.go @@ -346,7 +346,7 @@ func (this *HundredSceneMgr) ModuleName() string { } func (this *HundredSceneMgr) Init() { - this.TryCreateRoom() + //this.TryCreateRoom() } func (this *HundredSceneMgr) Update() {