Merge branch 'meixiongfeng' of http://git.legu.cc/liwei_3d/go_dreamfactory into dev
This commit is contained in:
commit
e7d3d0ca7a
@ -841,10 +841,25 @@ func (this *Hero) InRange(heroRecord *pb.DBHeroRecord, strPool []string, update
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (this *Hero) RegisterInstructor(session comm.IUserSession, heroOid string, fulllvenr int32) (code pb.ErrorCode) {
|
func (this *Hero) RegisterInstructor(session comm.IUserSession, heroOid string, fulllvenr int32) (code pb.ErrorCode) {
|
||||||
_hero, code := this.GetHeroByObjID(session.GetUserId(), heroOid)
|
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 {
|
if code != pb.ErrorCode_Success {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if _hero.Fulllvenr == 0 {
|
if _hero.Fulllvenr == 0 {
|
||||||
// 校验有没有满级
|
// 校验有没有满级
|
||||||
@ -856,10 +871,22 @@ func (this *Hero) RegisterInstructor(session comm.IUserSession, heroOid string,
|
|||||||
_heroMap := map[string]interface{}{
|
_heroMap := map[string]interface{}{
|
||||||
"fulllvenr": _hero.Fulllvenr,
|
"fulllvenr": _hero.Fulllvenr,
|
||||||
}
|
}
|
||||||
if err := this.modelHero.ChangeList(session.GetUserId(), _hero.Id, _heroMap); err != nil {
|
|
||||||
|
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
|
code = pb.ErrorCode_DBError
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if err := this.modelHero.ChangeList(session.GetUserId(), heroOid, _heroMap); err != nil { // 修改英雄信息
|
||||||
|
this.Errorf("err:%v", err)
|
||||||
|
code = pb.ErrorCode_DBError
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
code = pb.ErrorCode_HeroIsRegister // 英雄已经注册过
|
code = pb.ErrorCode_HeroIsRegister // 英雄已经注册过
|
||||||
|
@ -46,7 +46,6 @@ func (this *apiComp) RankList(session comm.IUserSession, req *pb.PagodaRankListR
|
|||||||
_dataList := rd.Val()
|
_dataList := rd.Val()
|
||||||
for _, v := range _dataList {
|
for _, v := range _dataList {
|
||||||
//conn_, err := db.Cross()
|
//conn_, err := db.Cross()
|
||||||
|
|
||||||
dbModel := db.NewDBModel(comm.TableSeasonRecord, 0, conn)
|
dbModel := db.NewDBModel(comm.TableSeasonRecord, 0, conn)
|
||||||
result := &pb.DBPagodaRecord{}
|
result := &pb.DBPagodaRecord{}
|
||||||
if err = dbModel.GetListObj(session.GetUserId(), v, result); err == nil {
|
if err = dbModel.GetListObj(session.GetUserId(), v, result); err == nil {
|
||||||
|
@ -100,7 +100,6 @@ func (this *configureComp) CheckSmithyFirstReelConfigData(etype int32, id int32)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return true
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return false
|
return false
|
||||||
|
Loading…
Reference in New Issue
Block a user