chenjielin

Results 2 comments of chenjielin

有依赖关系的先把依赖register。 parser.register({"b.proto", "a.proto"}, nil)

我个人建议把register写在一个文件中,因为pb文件有依赖关系,需要注意register的先后顺序 比如: a.proto和b.proto b.proto中import了a.proto 那么 ImprotPBC.lua ... protobuf = require "protobuf" function RegisterPBC(filename) protobuf.register_file(filename) end function Init() RegisterPBC("a.pb") RegisterPBC("b.pb") end Init() ... test1.lua ... require "ImportPBC" ... test2.lua ... require...