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

全服广播, 单服广播 #61

Closed
bobwong89757 opened this issue Jul 6, 2023 · 2 comments
Closed

全服广播, 单服广播 #61

bobwong89757 opened this issue Jul 6, 2023 · 2 comments

Comments

@bobwong89757
Copy link

请问大佬有没有全服(所有网关的所有合法用户)广播的例子?

@godotg
Copy link
Contributor

godotg commented Jul 6, 2023

    var notice = GroupChatMessageNotice.valueOf(entity.toChatMessage());
    // 广播给全服玩家
    NetContext.getSessionManager().forEachServerSession(it -> NetContext.getRouter().send(it, notice));

@bobwong89757
Copy link
Author

感谢

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