Pass a list through Bungeecord

Discussion in 'BungeeCord Plugin Help' started by Velerium, Jun 17, 2016.

  1. Hello all.
    I've 3 lobby servers, each one has a login system with session, how can I pass the list of players able to login without put a password again in the others 2 lobbies?

    First Lobby - I login and type /login password
    I relog to first lobby, I have the session opened (stored in a list with my previous ip and my name)
    I switch lobby, I do not have the session cause the file is stored in the first lobby server.

    How can I solve?

    Explained in the easiest way. Sorry for my rubbish english.

    Thank you, Velerium.
  2. I can't use mysql.
  3. why not? sqlite? mariadb? mongodb? postgresql?
  4. With the Plugin-Messaging Channel, i think.
    • Agree Agree x 1
  5. maybe a common sqlite should be ok, how can I create it?
  6. @Velerium simple plugin messaging should do the trick:
    • Create a bungeecord plugin which saves a list
    • When they type the password, send a plugin message to the bungee network, and make the bungee server add the player to the list.
    • When the player swaps servers and they have are in the list, make the bungee server send a plugin message to the server.
  7. Note that plugin messaging channels only work if the server has at least 1 player currently logged in (per server receiving message, not whole network).
  8. @BillyGalbreath and because when a player types the password and when they switch servers they are on the server, there's always someone online for it
  9. Theres lots of race conditions there. Sometimes a player can even technically be logged into two servers at the exact same time. Theres no guarantees there at all. Just wanted to let that be known up front because its a pretty big hurdle for most devs to get around ;)
  10. @BillyGalbreath when a player types the password, they are on server1, so server1 can send a plugin message. When they joined on server2, server2 can send and receive plugin messages to check if they have logged in.
  11. Player is on server 1. Types in a password. Server 1 cant send the password to server 2 because no one is on server 2. Player hops over to server 2. Server 2 cant tell server 1 to give the password because no one is on server 1.

    In fact, server 1 cant even just delay the sending of the password. Once the task goes to run the player is not there so the message cant even be sent. The entire messaging channel stops working unless a player is present.

    Mojang designed this feature in the plugin messaging channels to minimize bandwidth. So, its a good thing, but it has limitation like this.

    Common solution is to use BungeeCord as the middle-man. Server 1 can send Bungee the password before player leaves, then when player joins server 2 it can request the password from Bungee. This requires a Bukkit plugin and a Bungee plugin to work.
  12. @BillyGalbreath
    Simple misunderstanding .-.
    • Like Like x 1
  13. My bad. I read yours wrong, you already said the man-in-the-middle approach. Thought you were saying direct server <-> server plugin channel :S
    • Like Like x 1