Comments (8)
仔细读文档, 如果文档没有就读源码
这是特性。
from pbc.
我有个问题想请教:
我的CoreProtocol.proto嵌套定义片段如下:
option java_package = "com.skysoft.core.auto.message";
option java_outer_classname = "CoreProtocol";
import "BaseStruct.proto";
//协议包,内部可包含多条协议内容
message MessagePack {
required MessageMainCmd messageMainCmd = 1;//指令
optional int32 version = 2; //版本号
optional fixed64 sessionId = 3; //sessionId
optional MessageContent content = 4; //协议内容
}
enum MessageMainCmd {
CMD_GETSERVER = 2;//获取服务器信息
CMD_REGISTER = 3; //普通注册指令
}
message MessageContent {
required MessageType messageType = 1 ;//[default = TYPE_NORMAL];
}
我的lua代码片段:
stringbuff = pb.encode("MessagePack", {
messageMainCmd = "CMD_REGISTER",
version = 2223,
--sessionId = 33,
content = {{messageType = scReqFastLogin.messageType},}
})
只要我把content = {{messageType = scReqFastLogin.messageType},}注释去掉就会报错,是否嵌套不支持如此写,注释掉酒没问题。请求大神指点一下
from pbc.
为什么 content = 后有两层 {} ?
发自我的 iPhone
在 2014年12月8日,下午7:28,E.Y [email protected] 写道:
我有个问题想请教:
我的CoreProtocol.proto嵌套定义片段如下:
option java_package = "com.skysoft.core.auto.message";
option java_outer_classname = "CoreProtocol";import "BaseStruct.proto";
//协议包,内部可包含多条协议内容
message MessagePack {
required MessageMainCmd messageMainCmd = 1;//指令
optional int32 version = 2; //版本号
optional fixed64 sessionId = 3; //sessionId
optional MessageContent content = 4; //协议内容
}enum MessageMainCmd {
CMD_GETSERVER = 2;//获取服务器信息
CMD_REGISTER = 3; //普通注册指令
}message MessageContent {
required MessageType messageType = 1 ;//[default = TYPE_NORMAL];
}我的lua代码片段:
stringbuff = pb.encode("MessagePack", {
messageMainCmd = "CMD_REGISTER",
version = 2223,
--sessionId = 33,
content = {{messageType = scReqFastLogin.messageType},}
})
只要我把content = {{messageType = scReqFastLogin.messageType},}注释去掉就会报错,是否嵌套不支持如此写,注释掉酒没问题。请求大神指点一下—
Reply to this email directly or view it on GitHub.
from pbc.
如果一层的话lua直接会报{ close ,content near =
的错误,昨晚上测试发现主要有两处错误,使得无法解析,一处是使用fixed64 ,另一处是在嵌套的消息中不能使用option
发自我的 iPad
在 2014年12月9日,00:39,云风 [email protected] 写道:
为什么 content = 后有两层 {} ?
发自我的 iPhone
在 2014年12月8日,下午7:28,E.Y [email protected] 写道:
我有个问题想请教:
我的CoreProtocol.proto嵌套定义片段如下:
option java_package = "com.skysoft.core.auto.message";
option java_outer_classname = "CoreProtocol";import "BaseStruct.proto";
//协议包,内部可包含多条协议内容
message MessagePack {
required MessageMainCmd messageMainCmd = 1;//指令
optional int32 version = 2; //版本号
optional fixed64 sessionId = 3; //sessionId
optional MessageContent content = 4; //协议内容
}enum MessageMainCmd {
CMD_GETSERVER = 2;//获取服务器信息
CMD_REGISTER = 3; //普通注册指令
}message MessageContent {
required MessageType messageType = 1 ;//[default = TYPE_NORMAL];
}我的lua代码片段:
stringbuff = pb.encode("MessagePack", {
messageMainCmd = "CMD_REGISTER",
version = 2223,
--sessionId = 33,
content = {{messageType = scReqFastLogin.messageType},}
})
只要我把content = {{messageType = scReqFastLogin.messageType},}注释去掉就会报错,是否嵌套不支持如此写,注释掉酒没问题。请求大神指点一下—
Reply to this email directly or view it on GitHub.—
Reply to this email directly or view it on GitHub.
from pbc.
如果有 bug , 请帮忙修复,提一个 pr 供 review
发自我的 iPad
在 2014年12月9日,上午9:07,E.Y [email protected] 写道:
如果一层的话lua直接会报{ close ,content near =
的错误,昨晚上测试发现主要有两处错误,使得无法解析,一处是使用fixed64 ,另一处是在嵌套的消息中不能使用option发自我的 iPad
在 2014年12月9日,00:39,云风 [email protected] 写道:
为什么 content = 后有两层 {} ?
发自我的 iPhone
在 2014年12月8日,下午7:28,E.Y [email protected] 写道:
我有个问题想请教:
我的CoreProtocol.proto嵌套定义片段如下:
option java_package = "com.skysoft.core.auto.message";
option java_outer_classname = "CoreProtocol";import "BaseStruct.proto";
//协议包,内部可包含多条协议内容
message MessagePack {
required MessageMainCmd messageMainCmd = 1;//指令
optional int32 version = 2; //版本号
optional fixed64 sessionId = 3; //sessionId
optional MessageContent content = 4; //协议内容
}enum MessageMainCmd {
CMD_GETSERVER = 2;//获取服务器信息
CMD_REGISTER = 3; //普通注册指令
}message MessageContent {
required MessageType messageType = 1 ;//[default = TYPE_NORMAL];
}我的lua代码片段:
stringbuff = pb.encode("MessagePack", {
messageMainCmd = "CMD_REGISTER",
version = 2223,
--sessionId = 33,
content = {{messageType = scReqFastLogin.messageType},}
})
只要我把content = {{messageType = scReqFastLogin.messageType},}注释去掉就会报错,是否嵌套不支持如此写,注释掉酒没问题。请求大神指点一下—
Reply to this email directly or view it on GitHub.—
Reply to this email directly or view it on GitHub.—
Reply to this email directly or view it on GitHub.
from pbc.
lua 5.2 的 number 类型不足以表示 64bit 整数. 如需 64 位类型, 请使用 lightuserdata
from pbc.
经过测试,是可以嵌套其他文件的消息,之前的问题在于用法上,以及fixed64超出lua number范围,与服务器重新定义,使用string来保存sessionid,我会提交一个说明文档以及一个案例,以供其他需要的朋友参考
发自我的 iPad
在 2014年12月9日,10:45,云风 [email protected] 写道:
如果有 bug , 请帮忙修复,提一个 pr 供 review
发自我的 iPad
在 2014年12月9日,上午9:07,E.Y [email protected] 写道:
如果一层的话lua直接会报{ close ,content near =
的错误,昨晚上测试发现主要有两处错误,使得无法解析,一处是使用fixed64 ,另一处是在嵌套的消息中不能使用option发自我的 iPad
在 2014年12月9日,00:39,云风 [email protected] 写道:
为什么 content = 后有两层 {} ?
发自我的 iPhone
在 2014年12月8日,下午7:28,E.Y [email protected] 写道:
我有个问题想请教:
我的CoreProtocol.proto嵌套定义片段如下:
option java_package = "com.skysoft.core.auto.message";
option java_outer_classname = "CoreProtocol";import "BaseStruct.proto";
//协议包,内部可包含多条协议内容
message MessagePack {
required MessageMainCmd messageMainCmd = 1;//指令
optional int32 version = 2; //版本号
optional fixed64 sessionId = 3; //sessionId
optional MessageContent content = 4; //协议内容
}enum MessageMainCmd {
CMD_GETSERVER = 2;//获取服务器信息
CMD_REGISTER = 3; //普通注册指令
}message MessageContent {
required MessageType messageType = 1 ;//[default = TYPE_NORMAL];
}我的lua代码片段:
stringbuff = pb.encode("MessagePack", {
messageMainCmd = "CMD_REGISTER",
version = 2223,
--sessionId = 33,
content = {{messageType = scReqFastLogin.messageType},}
})
只要我把content = {{messageType = scReqFastLogin.messageType},}注释去掉就会报错,是否嵌套不支持如此写,注释掉酒没问题。请求大神指点一下—
Reply to this email directly or view it on GitHub.—
Reply to this email directly or view it on GitHub.—
Reply to this email directly or view it on GitHub.—
Reply to this email directly or view it on GitHub.
from pbc.
嵌套怎么解析啊
from pbc.
Related Issues (20)
- pbc_wmessage_integer
- mac os 上make命令不能执行 HOT 1
- 在 Mac 直接编译项目提供的 Demo,直接提示下面错误,大神能给看一下吗
- pbc_array_push_slice() bug?
- ubuntu+skynet+pbc环境,encode一个包含了int32类型的数据,会报错。但是改成了类型就不会了.
- skyent 加了一个protobuf 第一次运行报错了。 风哥看看这是啥原因啊 HOT 5
- protobuf 编译如何链接lua5.4,风哥是否能说的稍微详细一些。 HOT 3
- 最新版skynet里调用报错 HOT 3
- pbc是否支持protobuf3的any类型
- PBC library generate a BN256 curve
- enum 类型在 lua 层会被解析为 字符串呢?
- 是否支持grpc呢
- Error : rmessage decode context error HOT 2
- 是否能支持protobuf 3
- 编译binding/lua53时报错 HOT 3
- 在lua中修改的uint64字段字段,经过一次encode之后,又变回了原来的值,感觉没有修改成功,请云风大大看看怎么回事哈 HOT 1
- mingw环境下编译pbc的lua绑定库protobuf会出怪异现象,引用的skynet里lua5.4版本: HOT 5
- SEGV issue detected in pbc_wmessage_integer src/wmessage.c:137
- PBC有非Lazy的解析接口吗
- SEGV issue detected in pbc_wmessage_string src/wmessage.c:281:8
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pbc.