上传机器人代码
This commit is contained in:
parent
d6c56bbb16
commit
dfd123190c
@ -74,6 +74,7 @@ func (this *ModuleRobot_Sys) funcactivate(tid, sid int32, robot IRobot, cid stri
|
||||
|
||||
if _, errdata = robot.SendTaskMessage(tid, sid, "sys", "funcactivate", &pb.SysFuncActivateReq{Cid: cid}); errdata != nil {
|
||||
if errdata.Code == pb.ErrorCode_OpenCondActivate {
|
||||
this.cmd[cid] = 2
|
||||
return
|
||||
}
|
||||
err = errors.New(fmt.Sprintf("code:%d message:%s", errdata.Code, errdata.Message))
|
||||
|
@ -13,6 +13,7 @@ type (
|
||||
RobotTotalNum int32 //机器人总数
|
||||
RobotSingleNum int32 //单词机器人进入数量
|
||||
Intervals int32 //间隔时间 单位秒
|
||||
RobotName string //机器人名称
|
||||
Pipeline []string //执行流水线
|
||||
}
|
||||
)
|
||||
|
@ -43,7 +43,7 @@ locp:
|
||||
for {
|
||||
select {
|
||||
case <-timer.C:
|
||||
if this.currRobotNum < this.module.options.RobotSingleNum {
|
||||
if this.currRobotNum < this.module.options.RobotTotalNum {
|
||||
for i := 0; i < int(this.module.options.RobotSingleNum); i++ {
|
||||
this.createRobot(this.currRobotNum)
|
||||
this.currRobotNum++
|
||||
@ -63,7 +63,7 @@ func (this *robotmgrComp) createRobot(index int32) {
|
||||
robot = &Robot{
|
||||
robotmgrComp: this,
|
||||
index: index,
|
||||
account: fmt.Sprintf("it_%d", index),
|
||||
account: fmt.Sprintf("%s_%d", this.module.options.RobotName, index),
|
||||
serverId: this.module.options.ServerID,
|
||||
pipeline: this.module.options.Pipeline,
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user