This commit is contained in:
meixiongfeng 2023-09-05 19:59:39 +08:00
commit 217530b674
6 changed files with 9 additions and 3 deletions

View File

@ -75,7 +75,7 @@ func (this *apiComp) BoosChallenge(session comm.IUserSession, req *pb.MainlineBo
if errdata != nil {
return
}
session.SendMsg(string(this.module.GetType()), "challenge", &pb.MainlineBoosChallengeResp{
session.SendMsg(string(this.module.GetType()), "booschallenge", &pb.MainlineBoosChallengeResp{
Info: &pb.BattleInfo{
Id: record.Id,
Title: record.Title,

View File

@ -46,6 +46,7 @@ func (this *apiComp) Info(session comm.IUserSession, req *pb.MainlineInfoReq) (e
}
if err = this.module.modelMline.Change(session.GetUserId(), map[string]interface{}{
"currbooschapter": info.Currbooschapter,
"currboosmodel": info.Currboosmodel,
"lastboosrefresh": info.Lastboosrefresh,
}); err != nil {
errdata = &pb.ErrorData{

View File

@ -178,6 +178,9 @@ func (this *ModelMline) randomboos(data *pb.DBMainline) (err error) {
}
}
}
if !ok {
continue
}
chapters = append(chapters, k)
}
if len(chapters) == 0 {

View File

@ -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))

View File

@ -13,6 +13,7 @@ type (
RobotTotalNum int32 //机器人总数
RobotSingleNum int32 //单词机器人进入数量
Intervals int32 //间隔时间 单位秒
RobotName string //机器人名称
Pipeline []string //执行流水线
}
)

View File

@ -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,
}