diff --git a/modules/battle/module.go b/modules/battle/module.go index 8d4b495b0..32f97cf8f 100644 --- a/modules/battle/module.go +++ b/modules/battle/module.go @@ -149,7 +149,6 @@ func (this *Battle) CreatePveBattle(session comm.IUserSession, req *pb.BattlePVE conn, err = db.Local() stag = this.service.GetTag() } else { - conn, err = db.ServerDBConn(session.GetServiecTag()) stag = session.GetServiecTag() } @@ -697,7 +696,8 @@ func (this *Battle) RunServerBattle(session comm.IUserSession, req *pb.BattleRun ctx context.Context err error ) - if this.options.OpenCheck { + // if this.options.OpenCheck { + if false { stime := time.Now() ctx, _ = context.WithTimeout(context.Background(), time.Second*5) if reply, err = this.clientmgr.RunBattle(ctx, req); err != nil { diff --git a/modules/viking/api_sweep.go b/modules/viking/api_sweep.go index e9b5e2cf2..8d9d43e4f 100644 --- a/modules/viking/api_sweep.go +++ b/modules/viking/api_sweep.go @@ -70,7 +70,7 @@ func (this *apiComp) Sweep(session comm.IUserSession, req *pb.VikingSweepReq) (e return } - if req.Difficulty <= viking.Boss[req.BossId] { + if req.Difficulty > viking.Boss[req.BossId] { errdata = &pb.ErrorData{ Code: pb.ErrorCode_VikingLvErr, Title: pb.ErrorCode_VikingLvErr.ToString(), @@ -184,10 +184,10 @@ func (this *apiComp) Sweep(session comm.IUserSession, req *pb.VikingSweepReq) (e if vikingCfg.Heroexp > 0 { var heroObjs []string if v != nil && v.Info != nil && len(v.Info.Redflist) > 0 { - for _, v := range v.Info.Redflist[0].Team { - if v.HeroID != "" { - if !v.Ishelp { // 助战英雄不加经验 - heroObjs = append(heroObjs, v.Oid) + for _, v1 := range v.Info.Redflist[0].Team { + if v1 != nil && v1.HeroID != "" { + if !v1.Ishelp { // 助战英雄不加经验 + heroObjs = append(heroObjs, v1.Oid) } } } @@ -229,7 +229,7 @@ func (this *apiComp) Sweep(session comm.IUserSession, req *pb.VikingSweepReq) (e return } - session.SendMsg(string(this.module.GetType()), VikingChallengeOverResp, &pb.VikingSweepResp{ + session.SendMsg(string(this.module.GetType()), "sweep", &pb.VikingSweepResp{ Result: result, }) if len(tasks) > 0 {