Pinging All Servers for Information

Discussion in 'BungeeCord Plugin Development' started by CrypticStorm, Jul 10, 2013.

  1. (Not sure if this would be a BungeeCord plugin, but it will be a plugin that uses a BungeeCord network of servers)

    I wanted to create a plugin for my main server that would "ping" other servers for certain information. The information I want to send is simple, but it is from a plugin. I am running into two major problems because of this.

    First, the player on the main server will run this command, and the main server is pinging the subservers for information. That information is then sent back to the main server and displayed to the player. This obviously can take some time, but how would I accomplish this. Would I send a PluginMessage over the forward channel and then read that message in order to send one back?

    If so, that leads to problem number 2, in order to send a PluginMessage, I need a player online. Some of these servers will not have online players, but will have information that needs to be read on that command.

    A solution to this would be to firewall the subservers (or hide their MOTD in some way) and use the MOTD to store the information and have that either autoupdate and be readable, or send an update PluginMessage with a delayed read MOTD PluginMessage.

    Are there any flaws in the system I have designed? Or is there a way to simplify this whole ordeal that I am overlooking?

    EDIT: Quick update, MOTD is actually not a registered BungeeCord channel, so I would need a way to read the MOTD. I believe this is possible, but am not sure how to get it.
  2. How would you feel about giving us more information about the info you want to send?
  3. I tend to be a bit restrictive on giving out information if you haven't noticed...

    Let's see:

    The sub servers are small one at a time match pvp servers like Ghost Squadron on the Overcast Network.

    I am pinging each server for:
    The amount of players in game. (Int value, Not spectators)
    The current score of the game. (In a string syntax I will parse through)
    The time remaining. (Long value)
    A few other int and boolean variables detailing game status (Booleans and Int values)
  4. You could in theory parse MOTD and separate each value by setting it to "player, score, time, true, true, false"? Otherwise this. Thank zh32
  5. I'm not sure if this would fit your needs, but you could have a plugin on each of the subservers that periodically (every 5-10 seconds) collects information then writes that information to a MySQL database. Then all you would need to do is write a plugin for your main server to retrieve the data from the database, do any parsing you need, then print it out to the player.

  6. Seems the most logical of my choices. Thanks for the class BTW. Will need.

    Nope, not what I need. No custom information in that plugin.

    Indeed I could do that, but I'll stick with the simple approach of the MOTD parsing. That could work for people who need the MOTD though.
  7. Why not just use messaging channels, forwarding data from the child servers to the lobby? You could use MySQL as logging, and just query the database a few times.