Skip to content

Commit

Permalink
更新golexer 修复AutoMsgID不识别问题
Browse files Browse the repository at this point in the history
  • Loading branch information
davyxu committed Mar 24, 2021
1 parent 6ba11d1 commit 6ce59c7
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 8 deletions.
4 changes: 2 additions & 2 deletions example/csharp/Example/ProtoGenReg.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,14 @@ public static void Visit(Action<MetaInfo> callback)
callback(new MetaInfo
{
Type = typeof(LoginREQ),
ID = 0,
ID = 45589,
SourcePeer = "client",
TargetPeer = "game",
});
callback(new MetaInfo
{
Type = typeof(LoginACK),
ID = 0,
ID = 7420,
SourcePeer = "",
TargetPeer = "",
});
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ go 1.12

require (
github.com/davyxu/cellnet v4.1.0+incompatible
github.com/davyxu/golexer v0.0.0-20180314091252-f048a86ae200
github.com/davyxu/golexer v0.1.1-0.20200202091144-a15ddde83f6a
github.com/davyxu/ulexer v0.0.0-20200705151509-86177890ec50
github.com/stretchr/testify v1.6.1
)
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davyxu/golexer v0.0.0-20180314091252-f048a86ae200 h1:qLWlQBFg5c7HUOK+UdoGouLzRaYBQr2WwoAqixU+eik=
github.com/davyxu/golexer v0.0.0-20180314091252-f048a86ae200/go.mod h1:K/1PVWqaQEwMs+N+VvaoS66o1BAAwso+jEgXKBIa8QY=
github.com/davyxu/golexer v0.1.1-0.20200202091144-a15ddde83f6a h1:VYps2zwgBJPNuLGLiPrR4w6ud6cJpwlBA1OOytrCpx4=
github.com/davyxu/golexer v0.1.1-0.20200202091144-a15ddde83f6a/go.mod h1:dCUDBJcBQ9/AOzz6++KvSetGgVf5zXphevt6LQvKy0A=
github.com/davyxu/goobjfmt v0.1.0/go.mod h1:KKrytCtCXny2sEg3ojQfJ4NThhBP8hKw/qM9vhDwgog=
github.com/davyxu/protoplus v0.1.0/go.mod h1:WzmNYPvYsyks3G81jCJ/vGY2ljs49qFMfCmXGwvxFLA=
github.com/davyxu/ulog v1.0.0 h1:CfKRT2yK1JStZH5Yeal3BtF3kj/OETt1gTchuAbekBU=
Expand Down
3 changes: 3 additions & 0 deletions tests/Make.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
#!/usr/bin/env bash

set -e

go build -v -o=${GOPATH}/bin/protoplus github.com/davyxu/protoplus/cmd/protoplus

# code.proto为输入文件
Expand Down
4 changes: 2 additions & 2 deletions tests/code.proto
Original file line number Diff line number Diff line change
Expand Up @@ -94,12 +94,12 @@ struct MyType
EnumSlice []MyEnum
}

[MsgDir: "client -> game"]
[AutoMsgID MsgDir: "client -> game"]
struct LoginREQ {

}


[AutoMsgID]
struct LoginACK {

}
Expand Down
4 changes: 2 additions & 2 deletions tests/reg_gen.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,13 @@ func init() {
cellnet.RegisterMessageMeta(&cellnet.MessageMeta{
Codec: codec.MustGetCodec("protoplus"),
Type: reflect.TypeOf((*LoginREQ)(nil)).Elem(),
ID: 0,
ID: 17076,
New: func() interface{} { return &LoginREQ{} },
})
cellnet.RegisterMessageMeta(&cellnet.MessageMeta{
Codec: codec.MustGetCodec("protoplus"),
Type: reflect.TypeOf((*LoginACK)(nil)).Elem(),
ID: 0,
ID: 44443,
New: func() interface{} { return &LoginACK{} },
})
}
2 changes: 1 addition & 1 deletion tests/route.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"Rule": [
{
"MsgName": "proto.LoginREQ",
"MsgID": 0,
"MsgID": 45589,
"SvcName": "game"
}
]
Expand Down

0 comments on commit 6ce59c7

Please sign in to comment.