protobuf 模块设置为全局变量,不同模块需要register不同.pb #84
Comments
protobuf 模块已经加载到全局,可是工程里面有多个 pb 文件需要解析怎么处理?难道再每次 decode之前都调用 protobuf.register() 文件? 希望能给一个demo代码, 使用如下: 这样个模块可以使用自己独立的*.pb文件 |
我看代码里面 P = debug.getregistry().PROTOBUF_ENV if P then M.GC = GC 不知道我理解错了没有, test1.lua test2.lua 是不是在每次关联不同的pb文件的的之后,执行一次深拷贝? |
我个人建议把register写在一个文件中,因为pb文件有依赖关系,需要注意register的先后顺序 那么 function Init() Init() test1.lua test2.lua 在程序运行中,对ImportPBC.lua文件每一次加载就是热更新了pbc |
我不喜欢 protobuffer, 不想再维护这个项目。 |
protobuffer 确实感觉麻烦。 |
@bugwang 我这也要用到oneof,留个联系方式一起交流吧 |
请问各位 要想使用的不同的pb 有什么好的解决方案吗??? 遇到了相同的问题 |
No description provided.
The text was updated successfully, but these errors were encountered: