Cross-Server Communication Support

Agree with @vemacs. We’ve done work with benching Redis as pubsub. Remarkably performant. We ran a test with one publisher and five subscribers. Sent 80,000 messages per second before we hit 1 Gbps (we calculated a 40% overhead on 68 byte message events).

Redis would be great, as a foundation.

1 Like

issue: http://issues.spongepowered.org/youtrack/issue/SPONGE-22

@IDragonfire - That’s for exposing an API for Server ↔ Proxy/Client communication using Mojang’s Plugin channel system which already exists in vanilla Minecraft. This topic is about Server ↔ Server communication where is no equivalent functionality in vanilla Minecraft, and is completely different.

I see not the point to handle this two topics differently :wink:

There is a very good reason for doing so - they are two completely different features. They are not as related as you think.

  • Server ↔ Client/Proxy support already exists in vanilla Minecraft. That means that all Sponge really need to do is add an API to it, find where the code to send such messages exist in nms/Forge, hook into it, and it’ll (hopefully) be usable. The Sponge guys won’t need to create new functionality, they don’t need to think about how the networking internals work so much, because it’s already written and will work with a vanilla client.
  • Server ↔ Server support does NOT exist in vanilla Minecraft and would need to be written from the ground up. If the Sponge Devs wanted to add such a feature, they would have to write a networking system that allows minecraft servers to connect to one-another. They would then have to write the API, and they would have to work out how to secure it, how servers can interact with each other etc. etc. - it’d potentially be a huge job.

Also, Server to Client and Server to Server have two completely seperate use cases, would be two very different systems, and require two very different amounts of effort to implement - particuarly as one of the systems does not exist.

That said, I think it would be nifty to see such a thing. I doubt it’d get into Sponge though - I’m under the impression that the Sponge API is meant to enable others to modify Minecraft on a stable platform, and not functionally modify it itself (that is, a Sponge server with no other plugins or mods should behave as a vanilla server, though I guess a server ↔ server communication channel wouldn’t technically alter Minecraft on it’s own).

You could always ask the core team if they would accept such a feature. If they won’t, I’m sure a group of interested developers will try to make a plugin for Sponge that standardises such communication.

2 Likes

In my view there are some problems with the channels,
e.g. you cannot send a message to an empty server …

I linked only the issue for information purpose :wink:

But I aggree with you, it depends on the usecase and Sponge should be as lightweight as possible …

That’s because it was never designed for server → proxy → server communication at all - and thus is why it’s a different issue entirely to the one you linked to. As I said, Plugin Message channels are designed for Server ↔ Client messaging - NOT to connect to servers, even through proxies and roundabout techniques.

Server to server communication using Plugin Message channels is completely the wrong thing to do if you ask me - if you need to do it, you should do it directly via sockets or something like that - more reliable that way - no middle man. If the proxy (read, BungeeCord) you are using goes down, then your servers get cut off - all the more reason to create a library for this really…

Anyway, back on topic (sorry guys!)

There is a Bukkit plugin somewhere called Transporter that used server ↔ server sockets to communicate (I think it’s on the Spigot webpages somewhere). It might be worth looking at that plugin if anyone is interested in actually doing this server->server stuff, see how the author of that plugin did it. Even more interesting is that he uses it in conjunction with Bungee - uses Bungee to teleport the player using a Server → Proxy plugin message, but uses a server->server socket to ensure that there is a place on the server for the incoming player.

Please don’t mix it up with the vanilla plugin channel.
It’s all about communication between servers. (not via player connection)

XServer does server ↔ server communication with “Subchannels” like you know them from the Vanilla Plugin Channel.
And many other plugins do the same again for themselves.

But!
I don’t like the concept to have to link all my plugin to this library/plugin.
It would be waaay better to have some common interface that can be implemented by most server ↔ server communication plugins.
And by doing so embracing the support for plugins to be able to communicate across servers without woring much about dependecies.

For Example:

public interface SpongeServer{
  public void registerCrossServerSupport(HostModule module);
  public HostModule getCrossServerSupport();
}

public interface HostModule {
  ... stuff like sendMessage(...) etc.
}

In the end there could be dozen other cross-server modules for Sponge (like my XServer plugin) that have a shared interface.

So if you don’t like direct socket to socket communication, you could use RabbitMQ, Redis or Socket.io… (@vemacs)

It’s more about the standardization, than the implementation.
So … what do you think?
Is there an opionion on this topic by a core developer?

Personally, I think sponge could use some kind of bungee api or something? I probably totally just said that wrong. Just take a look at this idea:

Sponge server:
Server 1
World
World_Nether
World_End
Plugins
Server 2
Arena
Plugins
(Other Files like server.properties and stuff)

So… anyway, my idea is that the server can run each server folder as a set of worlds with their own plugins folder, and a multi world plugin or communication plugin could handle the communication and stuff, this way, we wouldn’t need a proxy and all that stuff!

Multiple plugin folders can’t be done.
There is only one java instance running your server, so a plugin can’t be loaded twice.
(because of reasons)


Sponge is no Proxy server. Sponge should / is going to be like a better Vanilla Minecraft server.


Sry., but it seems that you don’t understand the benefit of a proxy server.

  1. No disconnects on restarts
  • You can restart your servers to prevent memory leaks and to reload plugins
  • Dynamically add more servers to adapt to players.
  1. Balance cpu workload on multiple root-servers (mega servers)
  2. Multiple Access-Points to your network.
  3. You don’t have to disconnect and connect again to change a server.

You need a proxy if you have a larger player base.

Well I do know that some old bukkit plugins could be per world, or disabled in certain worlds. Maybe there could be some way to work with this? Like make it part of the API?

Nope! Every plugin did for itself the world handling.

But isn’t that another topic? ^^

Honestly, I know I am starting to drift off here, but I am literally out of topics. I have posted so much today that I am not allowed to start a new topic for like 8 more hours XD

I think I got a bit overjoyed and chatty about sponge and made countless posts (Of course they were not necessarily spam, but still, my point is that there were a lot, not that they weren’t god)

Anyway, so I don’t get flagged, lets get back on topic.

I think it would be pointless to implement cross server communication if sponge does not have a proxy. I believe this would have been one of the things, if we were using bungee, to go under the bungeecord plugins folder rather than the server plugins. Correct me if I am wrong.indent preformatted text by 4 spaces

You still don’t understand… this has not directly something to do with bungeecord.

(not via player connection)
~ A brief explanation of current bungeecord’s communication channel with CraftBukkit / Spigot servers will maybe show you the difference.
BungeeCord uses a Minecraft vanilla feature called “Plugin Channel”. This is basically a protocol packet that can be send between client and server. It contains a String for the channel name and the packet content as a byte array. What BungeeCord basically does is to hack into that channel and intercept channel messages on the channel named “BungeeCord”. BungeeCord plugins can intercept more channels.
Therefore a message can only be send to a server if a player is connected to the server!


The point of this thread is to embrace the support of server ↔ server messaging.

1 Like

ok… You win :stuck_out_tongue:

I honestly do not care, I think it is a good idea then. I thought you guys were trying to take a method used by proxies and implement it into sponge, but now I see what you mean now.

Correct me if I am wrong though, but will the servers have to be linked or proxied together? Or will they simply be able to send messages over the vast internet to other servers, and communicate stats and stuff?

The idea is to connect a group of servers. It does not matter if they are on the same machine, or on opposite sides of the earth.

I think we discussed that it is indifferent how the connection is implemented.
But one thing is sure, you won’t be able to simply connect to another server (security risk).
There has to be some password protection or even better a ssh key exchange.

PS: No problem. It’s good that you asked. :thumbsup:

But then again… Isn’t there always Bungee with its plugins? I have a pretty good feeling that Sponge is going to have something like that since md_5 is working on it…

1 Like

Like what? Link?

Now that they know exacly what every part of theyr code does, let’s hope that this won’t give as many errors on the console as it used to give with bungee or bukkit

Is the networking being written from scratch or are you using some type of library in the background to take care of it?