上传战斗测试程序

This commit is contained in:
liwei1dao 2022-12-13 15:05:56 +08:00
parent 0490d643aa
commit 84a846e553

View File

@ -112,6 +112,7 @@ func Test_Comment(t *testing.T) {
fmt.Println(err) fmt.Println(err)
break locp break locp
} }
fmt.Printf("收到消息: %d\n", time.Now().UnixMilli())
if err = proto.Unmarshal(data, msg); err != nil { if err = proto.Unmarshal(data, msg); err != nil {
fmt.Println(err) fmt.Println(err)
break locp break locp
@ -119,14 +120,18 @@ func Test_Comment(t *testing.T) {
fmt.Println(msg) fmt.Println(msg)
} }
}() }()
for i := 0; i < 3; i++ {
msg := &pb.BattleRpcMessage{ msg := &pb.BattleRpcMessage{
Rid: 1, Rid: 1,
Method: "Check", Method: "Check",
}
msg.Data, _ = anypb.New(&pb.BattleReport{})
data, _ := proto.Marshal(msg)
fmt.Printf("发送消息: %d\n", time.Now().UnixMilli())
connect.WriteMessage(websocket.BinaryMessage, data)
time.Sleep(time.Second)
} }
msg.Data, _ = anypb.New(&pb.BattleReport{})
data, _ := proto.Marshal(msg)
connect.WriteMessage(websocket.BinaryMessage, data)
//监听外部关闭服务信号 //监听外部关闭服务信号
c := make(chan os.Signal, 1) c := make(chan os.Signal, 1)
//添加进程结束信号 //添加进程结束信号