This commit is contained in:
liwei1dao 2022-09-07 09:28:14 +08:00
commit 05ec2a1f9f

View File

@ -9,7 +9,7 @@ import (
//参数校验
func (this *apiComp) ChallengeCheck(session comm.IUserSession, req *pb.MainlineChallengeReq) (code pb.ErrorCode) {
if req.MainlineId == 0 {
if req.MainlineId == 0 || req.ChapterObj == "" || req.Leadpos >= 5 || len(req.Teamids) > 5 || req.Leadpos < 0 {
code = pb.ErrorCode_ReqParameterError
return
}
@ -58,6 +58,9 @@ func (this *apiComp) Challenge(session comm.IUserSession, req *pb.MainlineChalle
Teamids: req.Teamids,
Mformat: node.FormatList,
})
if code != pb.ErrorCode_Success {
return
}
session.SendMsg(string(this.module.GetType()), MainlineChallengeResp, &pb.MainlineChallengeResp{Info: &pb.BattleInfo{
Id: record.Id,
Btype: record.Btype,