随笔分类 -  protobuf

摘要:在cocos2dx-lua中应用pbc解析protobuf协议格式发现,其对嵌套消息的解析很不友好。 经过for pairs循环检验发现,decode方法并没有解析内部嵌套的子消息。进一步检查发现,子消息的输出格式为table:第一个字段为子消息的名字, 第2个字段为一个奇怪的字符串(一般为子消息的... 阅读全文
posted @ 2016-01-24 22:02 ColaZhang 阅读(3417) 评论(0) 推荐(0)
摘要:目前lua集成protobuf主要有两种方式1. protobuf-gen-lua方案https://github.com/sean-lin/protoc-gen-lua 参照说明即可集成这个方案是将proto文件导出成lua文件, 使用起来稍微麻烦, 不能直接创建lua table, 而是要用生成... 阅读全文
posted @ 2015-10-30 00:23 ColaZhang 阅读(3203) 评论(0) 推荐(0)