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

Improvement: not break even if players connect from different BungeeCoord instances #6

Open
blablubbabc opened this issue Jan 6, 2014 · 0 comments

Comments

@blablubbabc
Copy link

Hey, I am currently "experimenting" with forwarding players from different BungeeCoord instances to the same minecraft server, which seems to work pretty well, besides the BungeeCoord instances not being aware of the players which connected from the other BungeeCoord instance, of course. This however is currently no problem for me. Everything which matters works just fine already.

However, BungeeSuite seems to have problems with this setup, at least at the point where it sends/receives messages over the PluginMessageChannel:

https://github.com/Bloodsplat/BungeeSuitePortals/blob/master/src/main/java/com/minecraftdimensions/bungeesuiteportals/tasks/PluginMessageTask.java

In this class you get some online player (Bukkit.getOnlinePlayers()[0]) and use him to send your message to the BungeeCoord server, which works fine if all players are coming from the same Bungee Server. However, in my current case it's essential that you send player dependend PluginMessages (like the "TeleportPlayer"-message) to the right BungeeCoord server -> to the bungee coord server the player actually connected from. Otherwise the BungeeSuite-plugin-instance on the other BungeeCord server receives the message and throws an error because it doesn't know the player there, of course..

I hope you understand what I mean and I also know that the chances of "getting support" for something like what I am trying to accomplish here are not that well.
However, if you should decide to try to help me out with that, this would be awesome and a potential "improvement" which probably would fix (at least this issue) would be:

Letting the "PluginMessageTask" take a concrete Player as argument to whom this message shall be sent. And if this player is null (useful for messages which affect all/no specific player) select a player just like you a currently doing it, via Bukkit.getOnlinePlayers()[0].
If the player is no longer online (maybe) ignore the message-to-send / don't send it (I am not completly sure if this could break something.. depends on what else would need "player-specific" plugin messages to be sent.. currently I am only looking at the "TeleportPlayer"-message which probably wouldn't hurt if not being sent when the targeted player is no longer online (right?), AND/OR let the receiving BungeeSuite plugin ignore the message if it doesn't relate to a player it knows about (instead of throwing a NPE like it is doing currently when it receives a plugin message about a player which is connected from a different BungeeSuite server).

So having an "optional" player argument for the PluginMessageTask shouldn't break any current one-bungee-coord setups, because player-independent PluginMessageTasks could simple have it set 'null' during construction, while having player-specific messages sent to the right player/bungee coord instance would fix my issue.

Edit: an other idea would be to built-in support for multi-bungee-setups from the ground up, for example by sending a PluginMessage to each connecting player on the minecraft server to "ask" the "underlying" BungeeCoord instance of that player for some sort of identifier/ip+port/playerlist to figure out which players are coming from which BungeeCoord server and later using that information to send PluginMessage to the correct BungeeCoord servers and/or to all involved BungeeCoord servers, for example if a certain message is meant to affect ALL players on the server, no matter which bungee server they connected from.

Thanks for (hopefully) reading this wall of text. Would be great if you have interest in helping me out getting as much as possible working on this setup with multiple bungee suite servers :)

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

1 participant