Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bad argument #1 to 'encode' (type 'Person' does not exists) #248

Open
DJKarlHarris opened this issue Jun 27, 2023 · 8 comments
Open

bad argument #1 to 'encode' (type 'Person' does not exists) #248

DJKarlHarris opened this issue Jun 27, 2023 · 8 comments
Labels

Comments

@DJKarlHarris
Copy link

使用protoc模块载入没问题,但是直接用pb.load(...)去载入xxx.pb的话就找不到

@DJKarlHarris
Copy link
Author

使用pb.loadfile成功了,但是为什么loadfile没有被作者挂出来呢

@starwing
Copy link
Owner

因为用这个库的很多人是在Unity里用的,他们不知道当前目录的概念,解释起来太麻烦,所以干脆在文档里删掉了所有文件相关的API,会用的人肯定知道怎么用。

你可以用io.open()读取你的.pb文件内容,然后用pb.load()载入

@DJKarlHarris
Copy link
Author

谢谢作者!

@DJKarlHarris
Copy link
Author

请问一下,在开发环境中,一般是将所有pb load进内存,还是用到一个load一个

@starwing
Copy link
Owner

最好当然是上来就load,然后就不动了

@DJKarlHarris
Copy link
Author

好的!

@DJKarlHarris
Copy link
Author

作者,请问有什么方案可以让多个lua文件,共享pb.so加载的协议吗?
在skynet中可以额外开多一个服务来存储这些协议,然后其他服务与其通信。

@starwing
Copy link
Owner

考虑一下pb.state(),unsafe里面有shared state的支持。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants