英雄等级接口跨服处理
This commit is contained in:
parent
acc409c6b7
commit
ec892aa56f
@ -841,9 +841,24 @@ func (this *Hero) InRange(heroRecord *pb.DBHeroRecord, strPool []string, update
|
||||
}
|
||||
|
||||
func (this *Hero) RegisterInstructor(session comm.IUserSession, heroOid string, fulllvenr int32) (code pb.ErrorCode) {
|
||||
_hero, code := this.GetHeroByObjID(session.GetUserId(), heroOid)
|
||||
if code != pb.ErrorCode_Success {
|
||||
return
|
||||
var (
|
||||
_hero *pb.DBHero
|
||||
model *db.DBModel
|
||||
err error
|
||||
)
|
||||
if this.IsCross() {
|
||||
_hero = &pb.DBHero{}
|
||||
if model, err = this.GetDBModuleByUid(session.GetUserId(), this.modelHero.TableName, this.modelHero.Expired); err == nil {
|
||||
if err := model.GetListObj(session.GetUserId(), heroOid, _hero); err != nil {
|
||||
this.Errorf("err:%v", err)
|
||||
return
|
||||
}
|
||||
}
|
||||
} else {
|
||||
_hero, code = this.GetHeroByObjID(session.GetUserId(), heroOid)
|
||||
if code != pb.ErrorCode_Success {
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
if _hero.Fulllvenr == 0 {
|
||||
@ -856,9 +871,21 @@ func (this *Hero) RegisterInstructor(session comm.IUserSession, heroOid string,
|
||||
_heroMap := map[string]interface{}{
|
||||
"fulllvenr": _hero.Fulllvenr,
|
||||
}
|
||||
if err := this.modelHero.ChangeList(session.GetUserId(), _hero.Id, _heroMap); err != nil {
|
||||
code = pb.ErrorCode_DBError
|
||||
return
|
||||
|
||||
if this.IsCross() {
|
||||
if model != nil {
|
||||
if err := model.ChangeList(session.GetUserId(), heroOid, _heroMap); err != nil {
|
||||
this.Errorf("err:%v", err)
|
||||
code = pb.ErrorCode_DBError
|
||||
return
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if err := this.modelHero.ChangeList(session.GetUserId(), heroOid, _heroMap); err != nil { // 修改英雄信息
|
||||
this.Errorf("err:%v", err)
|
||||
code = pb.ErrorCode_DBError
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
} else {
|
||||
|
@ -46,7 +46,6 @@ func (this *apiComp) RankList(session comm.IUserSession, req *pb.PagodaRankListR
|
||||
_dataList := rd.Val()
|
||||
for _, v := range _dataList {
|
||||
//conn_, err := db.Cross()
|
||||
|
||||
dbModel := db.NewDBModel(comm.TableSeasonRecord, 0, conn)
|
||||
result := &pb.DBPagodaRecord{}
|
||||
if err = dbModel.GetListObj(session.GetUserId(), v, result); err == nil {
|
||||
|
@ -92,7 +92,7 @@ func (this *configureComp) CheckSmithyFirstReelConfigData(etype int32, id int32)
|
||||
if v, err := this.GetConfigure(game_smithyreel); err == nil {
|
||||
if configure, ok := v.(*cfg.GameNewSmithy); ok {
|
||||
for _, v := range configure.GetDataList() {
|
||||
if v.Type == etype {
|
||||
if v.Type == etype{
|
||||
if v.Id == id {
|
||||
return true
|
||||
} else {
|
||||
@ -100,7 +100,6 @@ func (this *configureComp) CheckSmithyFirstReelConfigData(etype int32, id int32)
|
||||
}
|
||||
}
|
||||
}
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
|
Loading…
Reference in New Issue
Block a user