This commit is contained in:
meixiongfeng 2023-03-03 10:50:59 +08:00
parent 910568d2f4
commit 8b6110246b

View File

@ -322,10 +322,12 @@ func (this *Hero) KungFuHero(session comm.IUserSession, heroObjID string, bKongf
var ( var (
_hero *pb.DBHero _hero *pb.DBHero
_changeHero []*pb.DBHero // 变化的英雄 _changeHero []*pb.DBHero // 变化的英雄
model *db.DBModel // 跨服对象
err error
) )
if this.IsCross() { if this.IsCross() {
if model, err := this.GetDBModuleByUid(session.GetUserId(), this.modelHero.TableName, this.modelHero.Expired); err == nil { if model, err = this.GetDBModuleByUid(session.GetUserId(), this.modelHero.TableName, this.modelHero.Expired); err == nil {
if err := model.GetListObj(session.GetUserId(), heroObjID, _hero); err != nil { if err := model.GetListObj(session.GetUserId(), heroObjID, _hero); err != nil {
this.Errorf("err:%v", err) this.Errorf("err:%v", err)
return return
@ -357,7 +359,7 @@ func (this *Hero) KungFuHero(session comm.IUserSession, heroObjID string, bKongf
} }
if this.IsCross() { if this.IsCross() {
if model, err := this.GetDBModuleByUid(session.GetUserId(), this.modelHero.TableName, this.modelHero.Expired); err == nil { if model != nil {
if err := model.ChangeList(session.GetUserId(), heroObjID, _heroMap); err != nil { if err := model.ChangeList(session.GetUserId(), heroObjID, _heroMap); err != nil {
this.Errorf("err:%v", err) this.Errorf("err:%v", err)
code = pb.ErrorCode_DBError code = pb.ErrorCode_DBError