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