Merge branch 'meixiongfeng' of http://git.legu.cc/liwei_3d/go_dreamfactory into dev

This commit is contained in:
meixiongfeng 2022-12-20 17:16:47 +08:00
commit 9c077aa803
3 changed files with 33 additions and 34 deletions

View File

@ -68,36 +68,36 @@ func (this *Hero) CreateRepeatHero(session comm.IUserSession, heroCfgId string,
var err error var err error
hero, err = this.modelHero.createHeroOverlying(session.GetUserId(), heroCfgId, num) hero, err = this.modelHero.createHeroOverlying(session.GetUserId(), heroCfgId, num)
if err == nil { if err == nil {
go func(uid string, heroCfgId string) { // 携程处理 图鉴数据 //go func(uid string, heroCfgId string) { // 携程处理 图鉴数据
if db.IsCross() { if db.IsCross() {
this.moduleFetter.SendRpcAddHero(session, heroCfgId) this.moduleFetter.SendRpcAddHero(session, heroCfgId)
} else { } else {
this.moduleFetter.AddHeroFetterData(uid, heroCfgId) this.moduleFetter.AddHeroFetterData(session.GetUserId(), heroCfgId)
} }
heroConf := this.modelHero.moduleHero.configure.GetHeroConfig(heroCfgId) heroConf := this.modelHero.moduleHero.configure.GetHeroConfig(heroCfgId)
if heroConf == nil { if heroConf == nil {
return return
}
if result, err1 := this.ModuleUser.GetUserExpand(session.GetUserId()); err1 == nil {
initUpdate := map[string]interface{}{}
sz := result.GetTujian()
if len(sz) == 0 {
sz = make(map[string]int32, 0)
} }
if result, err1 := this.ModuleUser.GetUserExpand(uid); err1 == nil { if _, ok := result.GetTujian()[heroCfgId]; !ok {
initUpdate := map[string]interface{}{} if heroConf.Handbook == -1 {
sz := result.GetTujian() sz[heroCfgId] = 0
if len(sz) == 0 { } else {
sz = make(map[string]int32, 0) sz[heroCfgId] = 1
} }
if _, ok := result.GetTujian()[heroCfgId]; !ok { initUpdate["tujian"] = sz
if heroConf.Handbook == -1 { this.ModuleUser.ChangeUserExpand(session.GetUserId(), initUpdate)
sz[heroCfgId] = 0
} else {
sz[heroCfgId] = 1
}
initUpdate["tujian"] = sz
this.ModuleUser.ChangeUserExpand(uid, initUpdate)
}
} }
}(session.GetUserId(), heroCfgId) }
//}(session.GetUserId(), heroCfgId)
// 统计任务 // 统计任务
this.ModuleRtask.SendToRtask(session, comm.Rtype1, utils.ToInt32(heroCfgId)) this.ModuleRtask.SendToRtask(session, comm.Rtype1, utils.ToInt32(heroCfgId))
// 查品质 // 查品质

View File

@ -21,15 +21,14 @@ func (this *apiComp) GetList(session comm.IUserSession, req *pb.PagodaGetListReq
) )
list, _ = this.module.modelPagoda.getPagodaList(session.GetUserId()) list, _ = this.module.modelPagoda.getPagodaList(session.GetUserId())
if list.Id == "" { // 普通塔 if list.Id == "" { // 普通塔
if list == nil { // redis没有数据
list = &pb.DBPagoda{}
list.Id = primitive.NewObjectID().Hex()
list.Uid = session.GetUserId() list.Id = primitive.NewObjectID().Hex()
list.PagodaId = 0 // 初始数据0层
list.Type = comm.PagodaType list.Uid = session.GetUserId()
this.module.modelPagoda.addNewPagoda(session.GetUserId(), list) list.PagodaId = 0 // 初始数据0层
} list.Type = comm.PagodaType
this.module.modelPagoda.addNewPagoda(session.GetUserId(), list)
} else if list.Complete { } else if list.Complete {
list, _ = this.module.modelSeasonPagoda.getSeasonPagodaList(session.GetUserId()) list, _ = this.module.modelSeasonPagoda.getSeasonPagodaList(session.GetUserId())
} }

View File

@ -34,7 +34,7 @@ func (this *ModelPagoda) getPagodaList(uid string) (result *pb.DBPagoda, err err
err = nil err = nil
return return
} }
err = nil
return result, err return result, err
} }