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

protobuf 消息压缩问题 #1062

Open
luvFriday opened this Issue May 28, 2018 · 2 comments

Comments

Projects
None yet
3 participants
@luvFriday

luvFriday commented May 28, 2018

pomelo 的protobuf 好像只能对 webServer 和 gameServer 主动发送的消息进行压缩,不能对某个发送的返回消息进行压缩。
如 lordOfPomelo 的示例中:webServer 请求 ‘area.playerHandler.enterScene’ 的时候,可以在serverProtos.json 中对请求的参数 Entities 进行定义,以便protobuf 能够使用;但是不能对 ‘area.playerHandler.enterScene’ 中的回调函数里面返回的数据进行 protobuf 压缩。
请问我的理解是否正确?

@rogerhdh

This comment has been minimized.

rogerhdh commented Jul 5, 2018

我认为回调函数也能使用protobuf编码,只要serverProtos.json中包含area.playerHandler.enterScene的protobuf格式说明,因为回复消息的route使用的是接收的route。以上只是我看代码的过程中分析出来的,没有实际验证过。

@whtiehack

This comment has been minimized.

whtiehack commented Jul 5, 2018

clientProto 存的是 请求, 放 area.playerHandler.enterScene 的请求protobuf结构

serverProto 存的是返回, 放 area.playerHandler.enterScene 的返回 protobuf结构

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment