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

Get all servers to send data to #56

Closed
kangarko opened this issue Mar 10, 2018 · 4 comments
Closed

Get all servers to send data to #56

kangarko opened this issue Mar 10, 2018 · 4 comments

Comments

@kangarko
Copy link

kangarko commented Mar 10, 2018

Hello!

I am facing a difficulty when finding a way on how to (easier) send data from one server to another. The only way I found is very obscure through getting ServerInfo for each player on the network.

This is my code that I am currently using:

a

Any help would be appreciated.

@kangarko kangarko changed the title Forward data to other servers Get all servers to send data to Mar 10, 2018
@yzimroni
Copy link

yzimroni commented Mar 10, 2018

To get all the proxies in the network, you can use RedisBungeeAPI#getAllServers,
but if you want to send data from one proxy to all the proxies in the network, you can simply use RedisBungeeAPI#sendChannelMessage (register the channel you want to use using RedisBungeeAPI#registerPubSubChannels and listen to PubSubMessageEvent for incoming messages from other proxies)

@kangarko
Copy link
Author

Hey, thank you.

I am just curious (since I don't have redis environment right now) whether sending that data as a byte stream would work. Right now I am using this method to forward the data (that's why I need the ServerInfo class):

a

@yzimroni
Copy link

Do you want to send the data to all bungeecords (proxies) in the network or to all the Minecraft servers connected to bungeecord (it looks like it from your code)?
If to all bungeecords, use RedisBungeeAPI#sendChannelMessage,
If you want to send to all the Minecraft servers, use ServerInfo#sendData (this is BungeecordAPI, you don't have to use Redis/RedisBungee for this)

@kangarko
Copy link
Author

I would like to forward the data from one Minecraft server to another just like my image excerpt above looks like. The method getAllServers() is the one from my first post.

Okay it seems that my approach is correct. Thanks again. Closing this :)

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