参数校验
This commit is contained in:
parent
3f5c6ba3ab
commit
66ff038d4e
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user