This commit is contained in:
liwei1dao 2023-03-16 16:17:23 +08:00
commit 953dd22db8
10 changed files with 2422 additions and 2418 deletions

View File

@ -169,7 +169,7 @@ func (this *apiComp) Equip(session comm.IUserSession, req *pb.EquipmentEquipReq)
code = pb.ErrorCode_SystemError code = pb.ErrorCode_SystemError
return return
} }
tasks = append(tasks, comm.GettaskParam(comm.Rtype5, 1, utils.ToInt32(hero.HeroID), equipNum)) tasks = append(tasks, comm.GettaskParam(comm.Rtype5, 1, equipNum, utils.ToInt32(hero.HeroID)))
// this.module.ModuleRtask.SendToRtask(session, comm.Rtype5, utils.ToInt32(hero.HeroID), equipNum) // this.module.ModuleRtask.SendToRtask(session, comm.Rtype5, utils.ToInt32(hero.HeroID), equipNum)
for k, v := range equipStr { for k, v := range equipStr {
tasks = append(tasks, comm.GettaskParam(comm.Rtype41, 1, utils.ToInt32(hero.HeroID), v, k)) tasks = append(tasks, comm.GettaskParam(comm.Rtype41, 1, utils.ToInt32(hero.HeroID), v, k))

View File

@ -86,7 +86,7 @@ func (this *apiComp) StrengthenUpStar(session comm.IUserSession, req *pb.HeroStr
// 推送 世界任务消息 // 推送 世界任务消息
var szTask []*comm.TaskParam var szTask []*comm.TaskParam
szTask = append(szTask, comm.GettaskParam(comm.Rtype6, utils.ToInt32(_hero.HeroID), _hero.Star)) szTask = append(szTask, comm.GettaskParam(comm.Rtype6, _hero.Star, utils.ToInt32(_hero.HeroID)))
szTask = append(szTask, comm.GettaskParam(comm.Rtype25, 1, utils.ToInt32(_hero.HeroID), _hero.Star)) szTask = append(szTask, comm.GettaskParam(comm.Rtype25, 1, utils.ToInt32(_hero.HeroID), _hero.Star))
if _hero.Star == 4 { if _hero.Star == 4 {

View File

@ -576,7 +576,7 @@ func (this *ModelHero) AddCardExp(session comm.IUserSession, hero *pb.DBHero, ex
var szTask []*comm.TaskParam var szTask []*comm.TaskParam
szTask = append(szTask, comm.GettaskParam(comm.Rtype147, utils.ToInt32(hero.HeroID), curLv-preLv)) szTask = append(szTask, comm.GettaskParam(comm.Rtype147, utils.ToInt32(hero.HeroID), curLv-preLv))
szTask = append(szTask, comm.GettaskParam(comm.Rtype113, utils.ToInt32(hero.HeroID), curLv-preLv)) szTask = append(szTask, comm.GettaskParam(comm.Rtype113, utils.ToInt32(hero.HeroID), curLv-preLv))
szTask = append(szTask, comm.GettaskParam(comm.Rtype4, utils.ToInt32(hero.HeroID), hero.Lv)) szTask = append(szTask, comm.GettaskParam(comm.Rtype4, hero.Lv, utils.ToInt32(hero.HeroID)))
szTask = append(szTask, comm.GettaskParam(comm.Rtype23, 1, hero.Star, hero.Lv)) szTask = append(szTask, comm.GettaskParam(comm.Rtype23, 1, hero.Star, hero.Lv))
szTask = append(szTask, comm.GettaskParam(comm.Rtype24, 1)) szTask = append(szTask, comm.GettaskParam(comm.Rtype24, 1))
szTask = append(szTask, comm.GettaskParam(comm.Rtype29, 1, hero.Lv, utils.ToInt32(hero.HeroID))) szTask = append(szTask, comm.GettaskParam(comm.Rtype29, 1, hero.Lv, utils.ToInt32(hero.HeroID)))

View File

@ -1,6 +1,7 @@
package hero package hero
import ( import (
"context"
"crypto/rand" "crypto/rand"
"go_dreamfactory/comm" "go_dreamfactory/comm"
"go_dreamfactory/lego/core" "go_dreamfactory/lego/core"
@ -944,33 +945,36 @@ func (this *Hero) QueryCrossMultipleHeroinfo(oid []string) (hero []*pb.DBHero, e
if err1 != nil { if err1 != nil {
continue continue
} }
result := make([]bson.M, 0)
for _, v := range oid { for _, v := range oid {
sr := conn.Mgo.FindOne(comm.TableHero, bson.M{ result = append(result, bson.M{"_id": v})
"_id": v, }
}) sr, _ := conn.Mgo.Find(comm.TableHero, bson.M{"$or": result})
for sr.Next(context.TODO()) {
_hero := &pb.DBHero{} _hero := &pb.DBHero{}
if err = sr.Decode(_hero); err != nil { if err = sr.Decode(_hero); err != nil {
this.modelHero.moduleHero.Errorf("find hero error: %v", err) this.modelHero.moduleHero.Errorf("find hero error: %v", err)
} }
hero = append(hero, _hero) hero = append(hero, _hero)
} }
return return
} }
} else { // 不是跨服就查本服 注意 这个接口是给跨服玩法调用 理论上这个分支是不会执行的 } else { // 不是跨服就查本服 注意 这个接口是给跨服玩法调用 理论上这个分支是不会执行的
result := make([]bson.M, 0)
for _, v := range oid { for _, v := range oid {
if res := this.modelHero.DB.FindOne(comm.TableHero, bson.M{ result = append(result, bson.M{"_id": v})
"_id": v, }
}); res == nil { sr, _ := this.modelHero.DB.Find(comm.TableHero, bson.M{"$or": result})
for sr.Next(context.TODO()) {
_hero := &pb.DBHero{} _hero := &pb.DBHero{}
if err = res.Decode(_hero); err != nil { if err = sr.Decode(_hero); err != nil {
this.modelHero.moduleHero.Errorf("find hero error: %v", err) this.modelHero.moduleHero.Errorf("find hero error: %v", err)
return
} }
hero = append(hero, _hero) hero = append(hero, _hero)
} }
} }
}
return return
} }