From dd5879ff8840b92e3c5bb61a71c26418930d551e Mon Sep 17 00:00:00 2001 From: meixiongfeng <766881921@qq.com> Date: Tue, 3 Jan 2023 18:24:18 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E6=8C=87=E9=92=88=E5=88=A4=E7=A9=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/viking/api_challengeover.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/viking/api_challengeover.go b/modules/viking/api_challengeover.go index c8c71355f..45611f617 100644 --- a/modules/viking/api_challengeover.go +++ b/modules/viking/api_challengeover.go @@ -115,7 +115,7 @@ func (this *apiComp) ChallengeOver(session comm.IUserSession, req *pb.VikingChal for _, v1 := range atno { if v1.A == "equp" { cfg := this.configure.GetEquipmentConfigureById(v1.T) - if cfg.Star == v { + if cfg != nil && cfg.Star == v { del = append(del, v1.O) } } From 09fb6e67edaceef78a57a26c04c63d13acdcb808 Mon Sep 17 00:00:00 2001 From: meixiongfeng <766881921@qq.com> Date: Wed, 4 Jan 2023 09:58:12 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E6=88=98=E6=96=97=E5=A4=B1=E8=B4=A5?= =?UTF-8?q?=E6=88=98=E6=8A=A5=E6=95=B0=E6=8D=AE=E4=B8=BA=E7=A9=BA=20?= =?UTF-8?q?=E7=94=B1=E4=B8=8B=E5=B1=82=E5=88=A4=E6=96=AD=E8=BE=93=E8=B5=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/mainline/api_challengeover.go | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/modules/mainline/api_challengeover.go b/modules/mainline/api_challengeover.go index 97062a0c3..e60614325 100644 --- a/modules/mainline/api_challengeover.go +++ b/modules/mainline/api_challengeover.go @@ -56,14 +56,11 @@ func (this *apiComp) ChallengeOver(session comm.IUserSession, req *pb.MainlineCh } // 校验通过 - if req.Report != nil { // 战斗失败 - code, isWin = this.module.battle.CheckBattleReport(session, req.Report) - if code != pb.ErrorCode_Success { - return - } - } else { - isWin = false + code, isWin = this.module.battle.CheckBattleReport(session, req.Report) + if code != pb.ErrorCode_Success { + return } + if !isWin { // 战斗失败直接返回 // 返还 mainline.Ps = 0 From 41e61dd3a5c465d6c37bc836659e367b2d5d2abe Mon Sep 17 00:00:00 2001 From: meixiongfeng <766881921@qq.com> Date: Wed, 4 Jan 2023 10:12:43 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E8=B7=A8=E6=9C=8D=E8=B0=83=E7=94=A8?= =?UTF-8?q?=E8=8E=B7=E5=8F=96=E7=89=B9=E6=9D=83=E6=8E=A5=E5=8F=A3=E5=A4=84?= =?UTF-8?q?=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/privilege/module.go | 36 +++++++++++++++++++++++++++--------- 1 file changed, 27 insertions(+), 9 deletions(-) diff --git a/modules/privilege/module.go b/modules/privilege/module.go index 2a95e15de..f693a0dfe 100644 --- a/modules/privilege/module.go +++ b/modules/privilege/module.go @@ -9,6 +9,7 @@ import ( "go_dreamfactory/pb" "go_dreamfactory/sys/configure" "go_dreamfactory/utils" + "time" "go.mongodb.org/mongo-driver/bson/primitive" ) @@ -410,17 +411,34 @@ func (this *Privilege) SendDailyPrivilegeMail(session comm.IUserSession, cId []i } } func (this *Privilege) GetCountByPrivilegeId(uid string, pId int32) (count int32) { - vip, err := this.modelVip.getVipList(uid) - if err != nil { - return - } - if v, ok := vip.Privilege[pId]; ok { - data := this.configure.GetPrivilegeByType(pId) - for _, v1 := range v.PrivilegeID { - if c, ok1 := data[v1]; ok1 { - count += c + if this.IsCross() { // 跨服情况 + if model, err := this.GetDBModuleByUid(uid, comm.TableVip, time.Hour); err == nil { + vip := &pb.DBVip{} + if err = model.Get(uid, vip); err == nil { + if v, ok := vip.Privilege[pId]; ok { + data := this.configure.GetPrivilegeByType(pId) + for _, v1 := range v.PrivilegeID { + if c, ok1 := data[v1]; ok1 { + count += c + } + } + } + } + } + } else { + vip, err := this.modelVip.getVipList(uid) + if err != nil { + return + } + if v, ok := vip.Privilege[pId]; ok { + data := this.configure.GetPrivilegeByType(pId) + for _, v1 := range v.PrivilegeID { + if c, ok1 := data[v1]; ok1 { + count += c + } } } } + return }