From 9793bb53bb7b1974ba92021c03b18370afb7e790 Mon Sep 17 00:00:00 2001 From: meixiongfeng <766881921@qq.com> Date: Fri, 19 Jan 2024 21:00:33 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E4=BB=BB=E5=8A=A1=E5=9F=8B=E7=82=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/hunting/api_challengeover.go | 2 +- modules/viking/api_challengeover.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/hunting/api_challengeover.go b/modules/hunting/api_challengeover.go index a27554d65..1f11691d7 100644 --- a/modules/hunting/api_challengeover.go +++ b/modules/hunting/api_challengeover.go @@ -228,7 +228,7 @@ func (this *apiComp) ChallengeOver(session comm.IUserSession, req *pb.HuntingCha tasks = append(tasks, comm.GetBuriedParam(comm.Rtype83, 1, req.BossType, req.Difficulty)) tasks = append(tasks, comm.GetBuriedParam(comm.Rtype202, consumPs)) tasks = append(tasks, comm.GetBuriedParam(comm.Rtype200, 1)) - tasks = append(tasks, comm.GetBuriedParam(comm.Rtype251, cfgHunting.Id, req.Report.Round)) + tasks = append(tasks, comm.GetBuriedParam(comm.Rtype251, 1, cfgHunting.Id, req.Report.Round)) go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) { this.module.ModuleBuried.TriggerBuried(session, tasks...) this.module.WriteUserLog(session.GetUserId(), req, comm.GMResAddType, "HuntingChallengeOverReq", szAtno) diff --git a/modules/viking/api_challengeover.go b/modules/viking/api_challengeover.go index 3c0f0bc92..8679cab75 100644 --- a/modules/viking/api_challengeover.go +++ b/modules/viking/api_challengeover.go @@ -249,7 +249,7 @@ func (this *apiComp) ChallengeOver(session comm.IUserSession, req *pb.VikingChal // tasks = append(tasks, comm.GetBuriedParam(comm.Rtype237, consumPs)) tasks = append(tasks, comm.GetBuriedParam(comm.Rtype201, consumPs)) tasks = append(tasks, comm.GetBuriedParam(comm.Rtype76, 1, req.BossId)) - tasks = append(tasks, comm.GetBuriedParam(comm.Rtype250, vikingCfg.Id, req.Report.Round)) // 回合数 + tasks = append(tasks, comm.GetBuriedParam(comm.Rtype250, 1, vikingCfg.Id, req.Report.Round)) // 回合数 tasks = append(tasks, comm.GetBuriedParam(comm.Rtype77, 1, req.BossId, req.Difficulty)) if bHelp { tasks = append(tasks, comm.GetBuriedParam(comm.Rtype180, req.BossId, 1)) From 0960ffa71dd3b0a089c029f16758e1bb5f7d6966 Mon Sep 17 00:00:00 2001 From: meixiongfeng <766881921@qq.com> Date: Fri, 19 Jan 2024 21:51:48 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E9=94=99=E8=AF=AF=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=E8=BE=93=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/plunder/model_land.go | 4 +++- modules/plunder/model_plunder.go | 17 +++++++++-------- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/modules/plunder/model_land.go b/modules/plunder/model_land.go index 99fc70fc9..65556fffd 100644 --- a/modules/plunder/model_land.go +++ b/modules/plunder/model_land.go @@ -80,7 +80,9 @@ func (this *modelLand) createPlunderLandData(uid string) (land *pb.DBPlunderLand } } } - info, _ = this.module.modelPlunder.queryPlunderInfos(uids, land.Id) + if info, err = this.module.modelPlunder.queryPlunderInfos(uids, land.Id); err != nil { + return + } for _, v := range info { if v.Landid != "" { // 过滤 diff --git a/modules/plunder/model_plunder.go b/modules/plunder/model_plunder.go index e30225c0a..6d1adbb87 100644 --- a/modules/plunder/model_plunder.go +++ b/modules/plunder/model_plunder.go @@ -128,19 +128,19 @@ func (this *modelPlunder) queryPlunderInfos(uids []string, landid string) (data var ( mp map[string]struct{} // 没找到的数据 results []*pb.DBPlunder - onfound []string + //onfound []string newdata map[string]interface{} = make(map[string]interface{}) unfound []string ) results = make([]*pb.DBPlunder, 0) mp = make(map[string]struct{}) - if onfound, err = this.Gets(uids, &results); err != nil { + if _, err = this.Gets(uids, &results); err != nil { this.module.Errorln(err) return } - for _, v := range onfound { - mp[v] = struct{}{} + for _, v := range results { + mp[v.Uid] = struct{}{} } for _, v := range uids { if _, ok := mp[v]; !ok { @@ -167,10 +167,11 @@ func (this *modelPlunder) queryPlunderInfos(uids []string, landid string) (data break } } - - if err = this.Adds(newdata); err != nil { - this.module.Errorln(err) - return + if len(newdata) > 0 { + if err = this.Adds(newdata); err != nil { + this.module.Errorln(err) + return + } } for _, v := range results {