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

在zinx中网关节点做转发协议该如何配置路由? #297

Open
milk36 opened this issue Jan 12, 2024 · 3 comments
Open

在zinx中网关节点做转发协议该如何配置路由? #297

milk36 opened this issue Jan 12, 2024 · 3 comments

Comments

@milk36
Copy link

milk36 commented Jan 12, 2024

大致流程: client 协议先发送到 gate, 网关经过一些处理后再转发到相应内网中的 game节点.

目前 server.AddRouter 都只是针对固定协议id配置对应的路由逻辑,
那如果只想在gate节点对数据进行一些二次封装后(附加一些信息),做转发

gate接收到消息以后该如何配置路由呢?

@clukboy
Copy link
Collaborator

clukboy commented Jan 15, 2024

你所谓的gate接收信息后怎么配置路由我不是很理解,你想表达的是不是client连接到gate,然后gate在连接到对应的game节点吧。你搭建的gate层只是一个跳板而已,用于存储client信息和game节点信息。如果client信息到gate中,你直接从gate中发送到对应的game节点就好了

@milk36
Copy link
Author

milk36 commented Jan 18, 2024

你的理解大致是对的 , 其实gate就是做转发.
我不太清楚的是 gate里面应该如何配置router中协议的转发规则,
比如1-100的协议转发到game节点, 101-200的协议转发到rank节点

@ayamzh
Copy link

ayamzh commented May 24, 2024

这属于逻辑层了。

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

3 participants