上传武官道具使用限制

This commit is contained in:
liwei 2023-07-03 14:20:39 +08:00
parent fa4c23d39f
commit ae58f1c98b

View File

@ -122,6 +122,19 @@ func (this *apiComp) Practice(session comm.IUserSession, req *pb.PracticePractic
return
}
if !utils.IsToday(room.Knapsack[req.Teacher].Lastusetime) {
room.Knapsack[req.Teacher].Usenum = 0
}
if room.Knapsack[req.Teacher].Usenum >= tconfigure.Limitation {
errdata = &pb.ErrorData{
Code: pb.ErrorCode_ReqParameterError,
Title: pb.ErrorCode_ReqParameterError.ToString(),
Message: fmt.Sprintf("the teacher:%s use to Limit", req.Teacher),
}
return
}
room.Knapsack[req.Teacher].Usenum++
if tconfigure.Race != heroconf.Race {
errdata = &pb.ErrorData{
Code: pb.ErrorCode_ReqParameterError,
@ -164,6 +177,21 @@ func (this *apiComp) Practice(session comm.IUserSession, req *pb.PracticePractic
}
return
}
if !utils.IsToday(room.Knapsack[req.Prop].Lastusetime) {
room.Knapsack[req.Teacher].Usenum = 0
}
if room.Knapsack[req.Prop].Usenum >= tconfigure.Limitation {
errdata = &pb.ErrorData{
Code: pb.ErrorCode_ReqParameterError,
Title: pb.ErrorCode_ReqParameterError.ToString(),
Message: fmt.Sprintf("the prop:%s use to Limit", req.Prop),
}
return
}
room.Knapsack[req.Prop].Usenum++
if pconfigure.Race != heroconf.Race {
errdata = &pb.ErrorData{
Code: pb.ErrorCode_ReqParameterError,