This commit is contained in:
liwei1dao 2024-01-19 22:25:26 +08:00
commit 0baec0b759
4 changed files with 14 additions and 11 deletions

View File

@ -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.Rtype83, 1, req.BossType, req.Difficulty))
tasks = append(tasks, comm.GetBuriedParam(comm.Rtype202, consumPs)) tasks = append(tasks, comm.GetBuriedParam(comm.Rtype202, consumPs))
tasks = append(tasks, comm.GetBuriedParam(comm.Rtype200, 1)) 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) { go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
this.module.ModuleBuried.TriggerBuried(session, tasks...) this.module.ModuleBuried.TriggerBuried(session, tasks...)
this.module.WriteUserLog(session.GetUserId(), req, comm.GMResAddType, "HuntingChallengeOverReq", szAtno) this.module.WriteUserLog(session.GetUserId(), req, comm.GMResAddType, "HuntingChallengeOverReq", szAtno)

View File

@ -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 { for _, v := range info {
if v.Landid != "" { // 过滤 if v.Landid != "" { // 过滤

View File

@ -128,19 +128,19 @@ func (this *modelPlunder) queryPlunderInfos(uids []string, landid string) (data
var ( var (
mp map[string]struct{} // 没找到的数据 mp map[string]struct{} // 没找到的数据
results []*pb.DBPlunder results []*pb.DBPlunder
onfound []string //onfound []string
newdata map[string]interface{} = make(map[string]interface{}) newdata map[string]interface{} = make(map[string]interface{})
unfound []string unfound []string
) )
results = make([]*pb.DBPlunder, 0) results = make([]*pb.DBPlunder, 0)
mp = make(map[string]struct{}) 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) this.module.Errorln(err)
return return
} }
for _, v := range onfound { for _, v := range results {
mp[v] = struct{}{} mp[v.Uid] = struct{}{}
} }
for _, v := range uids { for _, v := range uids {
if _, ok := mp[v]; !ok { if _, ok := mp[v]; !ok {
@ -167,11 +167,12 @@ func (this *modelPlunder) queryPlunderInfos(uids []string, landid string) (data
break break
} }
} }
if len(newdata) > 0 {
if err = this.Adds(newdata); err != nil { if err = this.Adds(newdata); err != nil {
this.module.Errorln(err) this.module.Errorln(err)
return return
} }
}
for _, v := range results { for _, v := range results {
if v.Landid == "" { if v.Landid == "" {

View File

@ -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.Rtype237, consumPs))
tasks = append(tasks, comm.GetBuriedParam(comm.Rtype201, 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.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)) tasks = append(tasks, comm.GetBuriedParam(comm.Rtype77, 1, req.BossId, req.Difficulty))
if bHelp { if bHelp {
tasks = append(tasks, comm.GetBuriedParam(comm.Rtype180, req.BossId, 1)) tasks = append(tasks, comm.GetBuriedParam(comm.Rtype180, req.BossId, 1))