参数校验
This commit is contained in:
parent
d4a9ef3d55
commit
37b0667232
@ -71,7 +71,7 @@ func (this *apiComp) Story(session comm.IUserSession, req *pb.StonehengeStoryReq
|
||||
}
|
||||
return
|
||||
}
|
||||
this.module.Debugf("%v", conf)
|
||||
this.module.Debugf("GetStoneStoryConf:%v", conf)
|
||||
if req.Pos == 0 {
|
||||
event = conf.OptionEventIdGroup1
|
||||
} else if req.Pos == 1 {
|
||||
@ -109,14 +109,18 @@ func (this *apiComp) Story(session comm.IUserSession, req *pb.StonehengeStoryReq
|
||||
szW = append(szW, int32(n))
|
||||
}
|
||||
}
|
||||
|
||||
arr := strings.Split(event[comm.GetRandW(szW)], ",")
|
||||
if n, err := strconv.Atoi(arr[2]); err == nil {
|
||||
stone.Rooms.Story = int32(n)
|
||||
}
|
||||
if n, err := strconv.Atoi(arr[0]); err == nil {
|
||||
newEvent = int32(n)
|
||||
stone.Rooms.Eventid[newEvent] = false
|
||||
if len(event) > 0 {
|
||||
arr := strings.Split(event[comm.GetRandW(szW)], ",")
|
||||
if len(arr) != 3 {
|
||||
return
|
||||
}
|
||||
if n, err := strconv.Atoi(arr[2]); err == nil {
|
||||
stone.Rooms.Story = int32(n)
|
||||
}
|
||||
if n, err := strconv.Atoi(arr[0]); err == nil {
|
||||
newEvent = int32(n)
|
||||
stone.Rooms.Eventid[newEvent] = false
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user