上传竞技场错误修复
This commit is contained in:
parent
40c7889b19
commit
a71ac34402
@ -33,7 +33,7 @@ func (this *apiComp) Info(session comm.IUserSession, req *pb.ArenaInfoReq) (errd
|
|||||||
errdata = &pb.ErrorData{
|
errdata = &pb.ErrorData{
|
||||||
Code: pb.ErrorCode_DBError,
|
Code: pb.ErrorCode_DBError,
|
||||||
Title: pb.ErrorCode_DBError.ToString(),
|
Title: pb.ErrorCode_DBError.ToString(),
|
||||||
Message: err.Error(),
|
Message: "no fund user!",
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
@ -76,8 +76,10 @@ func (this *ModuleRobot_Horoscope) findcanupnode() (conf *cfg.GameHoroscopeData,
|
|||||||
for _, v := range v.(*cfg.GameHoroscope).GetDataList() {
|
for _, v := range v.(*cfg.GameHoroscope).GetDataList() {
|
||||||
ok = true
|
ok = true
|
||||||
for _, v := range v.Front {
|
for _, v := range v.Front {
|
||||||
if _, ok = this.Info.Nodes[v]; !ok {
|
if v != 0 {
|
||||||
break
|
if _, ok = this.Info.Nodes[v]; !ok {
|
||||||
|
break
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ok {
|
if ok {
|
||||||
|
@ -142,25 +142,40 @@ func (this *Robot) SendMessage(mtype, stype string, msg proto.Message) (resp pro
|
|||||||
SubType: stype,
|
SubType: stype,
|
||||||
Data: data,
|
Data: data,
|
||||||
}
|
}
|
||||||
if err = this.WriteMsg(message); err != nil {
|
|
||||||
errdata = &pb.ErrorData{
|
|
||||||
Code: pb.ErrorCode_ClientError,
|
|
||||||
Title: pb.ErrorCode_ClientError.String(),
|
|
||||||
Message: err.Error(),
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
if mtype != "gateway" {
|
if mtype != "gateway" {
|
||||||
this.curreq = fmt.Sprintf("%s.%s", mtype, stype)
|
this.curreq = fmt.Sprintf("%s.%s", mtype, stype)
|
||||||
|
if err = this.WriteMsg(message); err != nil {
|
||||||
|
errdata = &pb.ErrorData{
|
||||||
|
Code: pb.ErrorCode_ClientError,
|
||||||
|
Title: pb.ErrorCode_ClientError.String(),
|
||||||
|
Message: err.Error(),
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
messageresp = <-this.await //等待回应
|
messageresp = <-this.await //等待回应
|
||||||
resp = messageresp.resp
|
resp = messageresp.resp
|
||||||
errdata = messageresp.errdata
|
errdata = messageresp.errdata
|
||||||
|
if this.debug {
|
||||||
|
if errdata == nil {
|
||||||
|
log.Debug("[机器人 Message]", log.Field{Key: "t", Value: time.Since(stime).Milliseconds()}, log.Field{Key: "Account", Value: this.account}, log.Field{Key: "message", Value: fmt.Sprintf("%s.%s", mtype, stype)}, log.Field{Key: "errdata", Value: errdata == nil})
|
||||||
|
} else {
|
||||||
|
log.Error("[机器人 Message]", log.Field{Key: "t", Value: time.Since(stime).Milliseconds()}, log.Field{Key: "Account", Value: this.account}, log.Field{Key: "message", Value: fmt.Sprintf("%s.%s", mtype, stype)}, log.Field{Key: "errdata", Value: errdata.String()})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
this.statistics = append(this.statistics, &RobotStatistics{
|
this.statistics = append(this.statistics, &RobotStatistics{
|
||||||
message: fmt.Sprintf("%s.%s", mtype, stype),
|
message: fmt.Sprintf("%s.%s", mtype, stype),
|
||||||
time: time.Since(stime).Milliseconds(),
|
time: time.Since(stime).Milliseconds(),
|
||||||
})
|
})
|
||||||
if this.debug {
|
} else {
|
||||||
log.Debug("[机器人 Message]", log.Field{Key: "t", Value: time.Since(stime).Milliseconds()}, log.Field{Key: "Account", Value: this.account}, log.Field{Key: "message", Value: fmt.Sprintf("%s.%s", mtype, stype)}, log.Field{Key: "resp", Value: errdata == nil})
|
if err = this.WriteMsg(message); err != nil {
|
||||||
|
errdata = &pb.ErrorData{
|
||||||
|
Code: pb.ErrorCode_ClientError,
|
||||||
|
Title: pb.ErrorCode_ClientError.String(),
|
||||||
|
Message: err.Error(),
|
||||||
|
}
|
||||||
|
return
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
@ -255,7 +270,7 @@ func (this *Robot) run() {
|
|||||||
log.Error("[机器人 初始执行错误]", log.Field{Key: "Account", Value: this.account}, log.Field{Key: "module", Value: v}, log.Field{Key: "err", Value: err.Error()})
|
log.Error("[机器人 初始执行错误]", log.Field{Key: "Account", Value: this.account}, log.Field{Key: "module", Value: v}, log.Field{Key: "err", Value: err.Error()})
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
time.Sleep(time.Millisecond * time.Duration(2000+rand.Int31n(3000)))
|
time.Sleep(time.Millisecond * time.Duration(2000+rand.Int31n(2000)))
|
||||||
}
|
}
|
||||||
|
|
||||||
for this.cycle {
|
for this.cycle {
|
||||||
@ -277,7 +292,7 @@ func (this *Robot) run() {
|
|||||||
this.cycle = true
|
this.cycle = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
time.Sleep(time.Millisecond * time.Duration(2000+rand.Int31n(3000)))
|
time.Sleep(time.Millisecond * time.Duration(2000+rand.Int31n(2000)))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this.Close()
|
this.Close()
|
||||||
|
Loading…
Reference in New Issue
Block a user