-
-
Notifications
You must be signed in to change notification settings - Fork 12
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
Keep track of online servers to detect unreachable portals #198
Comments
The question is how to do that reliably? Would it be a good idea to make a simple bungee plugin for it? |
If all servers share the database, we could update the database during onEnable and onDisable and poll it every 10 seconds or so. For SQlite, we could probably send a custom bungee message during onEnable and onDisable, which the other servers would use to update their ServerInfo table. Alternatively, we could just store the online status transiently and design a small protocol. Only storing it transiently might be the better option, as it won't assume the other servers are available after a crash. |
Protocol for a new enabled server:
Protocol for a disabled server:
SERVER_ENABLED message: Contains the id of the newly enabled server |
The main problem with broadcasting the messages is the requirements to be able to send those; plugin messages require a player to be online on the server receiving and broadcasting the message. In this case if a player was not online on a server shutting down or starting, no broadcasting message can be sent to relevant servers. Note that this is not an issue for portal creation and destruction, as those actions require a player to be online (if not done by an addon). Receiving messages is only relevant when a player is online. Which is fine, as messages that could not be received are stored in a queue |
If a BungeeCord addon could fix this, that would be a working solution. Through event manipulation, the whole feature could potentially be an add-on. Alternatively, we could use sockets directly to communicate the protocol. If we sent a plugin message when a player activated a portal, would the receiving server be able to reply? The connect message can be sent to a server without players. |
Only if the server has a player on it, it would be able to reply. This is just an annoying limitation with bungee. Using sockets directly is an option, but it might be somewhat complicated, but wouldn't that also mean that the addresses/ports for each server would have to be defined in the config? It might just be easier for the end user if we make a simple bungee plugin for this instead. |
I have seen Bungeecord plugins that display the status of online servers, but I'm not entirely sure how to go about it. If the plugin could keep track of the servers, and be able to send/receive messages, we could just poll it for the information either on a schedule, or when a player activates a portal. I'm not sure how to start even getting that information from. But if we are going to do it with a bungee plugin, we should probably put this on hold. Regardless of the solution, there doesn't seem to be advantages to storing the online status in the database, except for MySQL servers, so we can avoid database changes. |
It was originally planned that the InterServer table should have a property isOnline to keep track of online portals, but this was never implemented. If it is to be implemented, it would be better to keep track of whether the entire server is online by adding an isOnline property to the ServerInfo table. That way, you'll know that all portals belonging to an offline server are unreachable. This can also be used for legacy bungee to send a more clear error message.
Benefits to keeping track of online servers:
The text was updated successfully, but these errors were encountered: