上传网关错误信息

This commit is contained in:
liwei1dao 2023-09-08 17:56:53 +08:00
parent 1b9c52d6c6
commit a1ceea9b91
4 changed files with 18 additions and 10 deletions

View File

@ -140,7 +140,7 @@ locp:
ReqSubType: msg.SubType, ReqSubType: msg.SubType,
Arg: msg.Data, Arg: msg.Data,
Code: pb.ErrorCode_GatewayException, Code: pb.ErrorCode_GatewayException,
Err: &pb.ErrorData{Title: "用户消息处理失败!", Datastring: err.Error()}, Err: &pb.ErrorData{Code: pb.ErrorCode_GatewayException, Title: pb.ErrorCode_GatewayException.String(), Message: err.Error()},
}) })
err = this.WriteMsg(&pb.UserMessage{ err = this.WriteMsg(&pb.UserMessage{
MsgId: msg.MsgId, MsgId: msg.MsgId,
@ -368,7 +368,7 @@ func (this *Agent) HandleMessage(msg *pb.UserMessage) (err error) {
ReqSubType: msg.SubType, ReqSubType: msg.SubType,
Arg: msg.Data, Arg: msg.Data,
Code: pb.ErrorCode_GatewayException, Code: pb.ErrorCode_GatewayException,
Err: &pb.ErrorData{Title: "用户消息处理失败!", Datastring: err.Error()}, Err: &pb.ErrorData{Code: pb.ErrorCode_GatewayException, Title: pb.ErrorCode_GatewayException.String(), Message: err.Error()},
}) })
err = this.WriteMsg(&pb.UserMessage{ err = this.WriteMsg(&pb.UserMessage{
MsgId: msg.MsgId, MsgId: msg.MsgId,

View File

@ -63,10 +63,14 @@ func (this *ModuleRobot_Arena) DoPipeline(robot IRobot) (err error) {
} }
heromodule = robot.GetModule(comm.ModuleHero).(*ModuleRobot_Hero) heromodule = robot.GetModule(comm.ModuleHero).(*ModuleRobot_Hero)
heros = heromodule.getbattlehero() heros = heromodule.getbattlehero()
for _, v := range this.players { for _, v := range this.players {
player = v player = v
break break
} }
if player == nil {
return
}
if resp, errdata = robot.SendMessage("arena", "challenge", &pb.ArenaChallengeReq{ if resp, errdata = robot.SendMessage("arena", "challenge", &pb.ArenaChallengeReq{
Playerid: player.Uid, Playerid: player.Uid,
Isai: player.Isai, Isai: player.Isai,

View File

@ -85,11 +85,6 @@ func (this *ModuleRobot_WTask) Receive(robot IRobot, stype string, message proto
return return
} }
func (this *ModuleRobot_WTask) OncePipeline(robot IRobot) (err error) { func (this *ModuleRobot_WTask) OncePipeline(robot IRobot) (err error) {
return
}
//机器人执行流
func (this *ModuleRobot_WTask) DoPipeline(robot IRobot) (err error) {
var ( var (
errdata *pb.ErrorData errdata *pb.ErrorData
) )
@ -98,7 +93,13 @@ func (this *ModuleRobot_WTask) DoPipeline(robot IRobot) (err error) {
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))
return return
} }
return
}
//机器人执行流
func (this *ModuleRobot_WTask) DoPipeline(robot IRobot) (err error) {
var ( var (
errdata *pb.ErrorData
tconf *cfg.GameWorldTaskData tconf *cfg.GameWorldTaskData
cconf *cfg.GameBuriedCondiData cconf *cfg.GameBuriedCondiData
module core.M_Modules module core.M_Modules

View File

@ -8,6 +8,7 @@ import (
"go_dreamfactory/pb" "go_dreamfactory/pb"
cfg "go_dreamfactory/sys/configure/structs" cfg "go_dreamfactory/sys/configure/structs"
"go_dreamfactory/utils" "go_dreamfactory/utils"
"math/rand"
"time" "time"
jsoniter "github.com/json-iterator/go" jsoniter "github.com/json-iterator/go"
@ -254,6 +255,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)))
} }
for this.cycle { for this.cycle {
@ -275,6 +277,7 @@ func (this *Robot) run() {
this.cycle = true this.cycle = true
} }
} }
time.Sleep(time.Millisecond * time.Duration(2000+rand.Int31n(3000)))
} }
} }
this.Close() this.Close()