修复补羊匹配卡死问题
This commit is contained in:
parent
3401f524e8
commit
54087998b4
@ -28,17 +28,29 @@ func (this *apiComp) RaceMatchCancel(session comm.IUserSession, req *pb.ParkourR
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if info.State != pb.RaceTeamState_matching {
|
if info.State == pb.RaceTeamState_matching {
|
||||||
errdata = &pb.ErrorData{
|
if req.Rtype == pb.RaceType_ordinary {
|
||||||
Code: pb.ErrorCode_ReqParameterError,
|
if err = this.module.matchTrain.CancelMatch(session.GetUserId()); err != nil {
|
||||||
Title: pb.ErrorCode_ReqParameterError.ToString(),
|
errdata = &pb.ErrorData{
|
||||||
Message: "no matching!",
|
Code: pb.ErrorCode_DBError,
|
||||||
|
Title: pb.ErrorCode_DBError.ToString(),
|
||||||
|
Message: err.Error(),
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if err = this.module.matchrank.CancelMatch(session.GetUserId()); err != nil {
|
||||||
|
errdata = &pb.ErrorData{
|
||||||
|
Code: pb.ErrorCode_DBError,
|
||||||
|
Title: pb.ErrorCode_DBError.ToString(),
|
||||||
|
Message: err.Error(),
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return
|
if err = this.module.parkourComp.Change(session.GetUserId(), map[string]interface{}{
|
||||||
}
|
"state": pb.RaceTeamState_resting,
|
||||||
|
}); err != nil {
|
||||||
if req.Rtype == pb.RaceType_ordinary {
|
|
||||||
if err = this.module.matchTrain.CancelMatch(session.GetUserId()); err != nil {
|
|
||||||
errdata = &pb.ErrorData{
|
errdata = &pb.ErrorData{
|
||||||
Code: pb.ErrorCode_DBError,
|
Code: pb.ErrorCode_DBError,
|
||||||
Title: pb.ErrorCode_DBError.ToString(),
|
Title: pb.ErrorCode_DBError.ToString(),
|
||||||
@ -46,25 +58,6 @@ func (this *apiComp) RaceMatchCancel(session comm.IUserSession, req *pb.ParkourR
|
|||||||
}
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
if err = this.module.matchrank.CancelMatch(session.GetUserId()); err != nil {
|
|
||||||
errdata = &pb.ErrorData{
|
|
||||||
Code: pb.ErrorCode_DBError,
|
|
||||||
Title: pb.ErrorCode_DBError.ToString(),
|
|
||||||
Message: err.Error(),
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if err = this.module.parkourComp.Change(session.GetUserId(), map[string]interface{}{
|
|
||||||
"state": pb.RaceTeamState_resting,
|
|
||||||
}); err != nil {
|
|
||||||
errdata = &pb.ErrorData{
|
|
||||||
Code: pb.ErrorCode_DBError,
|
|
||||||
Title: pb.ErrorCode_DBError.ToString(),
|
|
||||||
Message: err.Error(),
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
}
|
||||||
session.SendMsg(string(this.module.GetType()), "racematchcancel", &pb.ParkourRaceMatchCancelResp{})
|
session.SendMsg(string(this.module.GetType()), "racematchcancel", &pb.ParkourRaceMatchCancelResp{})
|
||||||
return
|
return
|
||||||
|
@ -23,6 +23,12 @@ func (this *apiComp) CreateCheck(session comm.IUserSession, req *pb.UserCreateRe
|
|||||||
// Title: pb.ErrorCode_UserNickSensitive.ToString(),
|
// Title: pb.ErrorCode_UserNickSensitive.ToString(),
|
||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
|
if req.Gender == 0 || req.Skin == "" {
|
||||||
|
errdata = &pb.ErrorData{
|
||||||
|
Code: pb.ErrorCode_UserNickNameEmpty,
|
||||||
|
Title: pb.ErrorCode_UserNickNameEmpty.ToString(),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user