参数校验
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,8 +109,11 @@ func (this *apiComp) Story(session comm.IUserSession, req *pb.StonehengeStoryReq
|
||||
szW = append(szW, int32(n))
|
||||
}
|
||||
}
|
||||
|
||||
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)
|
||||
}
|
||||
@ -120,6 +123,7 @@ func (this *apiComp) Story(session comm.IUserSession, req *pb.StonehengeStoryReq
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
this.module.modelStonehenge.AddNewEvent([]int32{newEvent}, stone)
|
||||
update["rooms"] = stone.Rooms
|
||||
this.module.modelStonehenge.ChangeStonehengeData(session.GetUserId(), update)
|
||||
|
Loading…
Reference in New Issue
Block a user