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

请问下,在通信消息里,加1个自增id,起到了什么作用? #96

Closed
15951836388 opened this issue Oct 20, 2018 · 5 comments

Comments

@15951836388
Copy link

还有消息,是否有必要压缩?

@egametang
Copy link
Owner

你说的是rpc id吧,这是为了回调。消息压缩必要性不大,客户端会增加gc,并且protobuf本身压缩比就不错,服务端也没必要压缩

@15951836388
Copy link
Author

我说的是普通消息,似乎是防止第三方攻击的?这个怎么防止的?什么原理?

@egametang
Copy link
Owner

kcp?不知道你说的是哪里

@15951836388
Copy link
Author

恩,就是kcp,怎么防止第三方攻击的?

@egametang
Copy link
Owner

每个kcp的udp包里面包含自己的连接号跟服务端对应的连接号,服务端对应的连接号,服务端收到消息会验证这两个连接号。第三方是不知道对应的服务端连接号的,所以无法伪造消息

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

No branches or pull requests

2 participants