上传测试服代码
This commit is contained in:
parent
5215d99828
commit
2ebaa538ae
@ -269,7 +269,7 @@ func (this *Battle) CreateRolesByHeros(heros []*pb.DBHero) (roles []*pb.BattleRo
|
||||
roles = make([]*pb.BattleRole, len(heros))
|
||||
for i, v := range heros {
|
||||
if v != nil {
|
||||
if roles[i], code = this.modelBattle.createBattleRole(v, 100+i, i); code != pb.ErrorCode_Success {
|
||||
if roles[i], code = this.modelBattle.createBattleRole(v, 200+i, i); code != pb.ErrorCode_Success {
|
||||
return
|
||||
}
|
||||
}
|
||||
|
@ -31,6 +31,6 @@ func (this *apiComp) GymInfo(session comm.IUserSession, req *pb.PracticeGymInfoR
|
||||
"gymrefresh": room.Gymrefresh,
|
||||
})
|
||||
}
|
||||
session.SendMsg(string(this.module.GetType()), "confirm", &pb.PracticeGymInfoResp{Lastaction: room.Gymaction, Refreshnum: room.Gymrefresh})
|
||||
session.SendMsg(string(this.module.GetType()), "gymInfo", &pb.PracticeGymInfoResp{Lastaction: room.Gymaction, Refreshnum: room.Gymrefresh})
|
||||
return
|
||||
}
|
||||
|
@ -57,6 +57,6 @@ func (this *apiComp) GymRefresh(session comm.IUserSession, req *pb.PracticeGymRe
|
||||
"gymrefresh": room.Gymrefresh,
|
||||
"lastrefresh": room.Lastrefresh,
|
||||
})
|
||||
session.SendMsg(string(this.module.GetType()), "confirm", &pb.PracticeGymRefreshResp{Lastaction: room.Gymaction, Refreshnum: room.Gymrefresh})
|
||||
session.SendMsg(string(this.module.GetType()), "gymrefresh", &pb.PracticeGymRefreshResp{Lastaction: room.Gymaction, Refreshnum: room.Gymrefresh})
|
||||
return
|
||||
}
|
||||
|
@ -33,7 +33,7 @@ func (this *apiComp) NPCBattkle(session comm.IUserSession, req *pb.PracticeNPCBa
|
||||
}); code != pb.ErrorCode_Success {
|
||||
return
|
||||
}
|
||||
session.SendMsg(string(this.module.GetType()), "npcbattkle", &pb.MoonfantasyBattleResp{
|
||||
session.SendMsg(string(this.module.GetType()), "npcbattkle", &pb.PracticeNPCBattkleResp{
|
||||
Info: &pb.BattleInfo{
|
||||
Id: record.Id,
|
||||
Title: record.Title,
|
||||
|
@ -18,25 +18,24 @@ func (this *apiComp) NPCBattkleFinishCheck(session comm.IUserSession, req *pb.Pr
|
||||
///npc 战斗结果请求
|
||||
func (this *apiComp) NPCBattkleFinish(session comm.IUserSession, req *pb.PracticeNPCBattkleFinishReq) (code pb.ErrorCode, data proto.Message) {
|
||||
var (
|
||||
err error
|
||||
room *pb.DBPracticeRoom
|
||||
conf *cfg.GameDispatch_BattleData
|
||||
iswin bool
|
||||
err error
|
||||
room *pb.DBPracticeRoom
|
||||
conf *cfg.GameDispatch_BattleData
|
||||
)
|
||||
if room, err = this.module.modelPandata.queryUserMartialhall(session.GetUserId()); err != nil {
|
||||
code = pb.ErrorCode_DBError
|
||||
return
|
||||
}
|
||||
if room.Npcstate != 2 {
|
||||
if room.Npcstate == 2 || room.Npcstate == 3 {
|
||||
code = pb.ErrorCode_ReqParameterError
|
||||
return
|
||||
}
|
||||
|
||||
if code, iswin = this.module.battle.CheckBattleReport(session, req.Report); code != pb.ErrorCode_Success {
|
||||
if code, _ = this.module.battle.CheckBattleReport(session, req.Report); code != pb.ErrorCode_Success {
|
||||
return
|
||||
}
|
||||
|
||||
if iswin {
|
||||
if req.Report.WinSide == 1 {
|
||||
room.Npcstate = 2
|
||||
if conf, err = this.module.configure.getDispatchBattleData(room.Currnpc); err != nil {
|
||||
code = pb.ErrorCode_ConfigNoFound
|
||||
|
Loading…
Reference in New Issue
Block a user