1. Welcome to LilyPad. Download the project, explore the forums, and create your own LilyPad network.


    If you use the software and enjoy it or have a question, or would like to contribute to the future of the software directly or through resources, please sign up and join our little community.

Sub server Redirect

Discussion in 'Discussion' started by killklli, Oct 6, 2013.

  1. killklli

    killklli New Member

    say a player connects to one of the sub servers that lilypad is redirecting to, is it possible to instead of disconnecting them entirely to redirect them into the hub server? with a plugin or by a setting?
  2. Coelho

    Coelho Software Engineer Staff Member Administrator Maintainer

    There are plugins that do this.
  3. killklli

    killklli New Member

    Any link to any of them? the only one I found that seems to be anything like it is hubkick
  4. The_Zip

    The_Zip Active Member Resource Contributor

    Check in the plugins section, or plugin development, might help you out.
    • Like Like x 1
  5. killklli

    killklli New Member

    The only thing I can find any closely related to it is hubkick and its not updated and im not even sure if it will do that.
  6. The_Zip

    The_Zip Active Member Resource Contributor

    Why don't you just make it so it doesn't direct it to the sub server and it directs to your hub server?
    • Like Like x 1
  7. killklli

    killklli New Member

    Im not entirely sure how I do that.
    Edit: Current config
    Code (text):
    {
      "proxy": {
        "bind": {
          "address": "0.0.0.0",
          "port": 25565
        },
        "outbound": {
          "address": "0.0.0.0"
        },
        "servers": [
          {
            "domain": "*",
            "server": "hub"
          },
          {
            "domain": "127.0.0.1",
            "server": "CTF"
          },
          {
            "domain": "127.0.0.1",
            "server": "TheWalls"
          },
          {
            "domain": "127.0.0.1",
            "server": "Zarena"
          }
        ],
        "motd": "A Minecraft Server",
        "playerMaximum": 1,
        "authenticate": true,
        "throttle": 2500,
        "tabEnabled": true,
        "localeFull": "You seem to be already logged in",
        "localeOffline": "The requested server is currently offline. Try again later!",
        "localeLoggedIn": "You have logged in from another location",
        "localeLostConn": "Lost connection... Please try to reconnect",
        "localeShutdown": "The server is being restarted. Please try to reconnect"
      },
      "queryTcp": {
        "bind": {
          "address": "0.0.0.0",
          "port": 5555
        }
      },
      "queryUdp": {
        "bind": {
          "address": "0.0.0.0",
          "port": 25565
        }
      },
      "connect": {
        "bind": {
          "address": "0.0.0.0",
          "port": 5091
        },
        "logins": [
          {
            "username": "hub",
            "password": "BLOCKED"
          },
          {
            "username": "zarena",
            "password": "BLOCKED"
          },
          {
            "username": "thewalls",
            "password": "BLOCKED"
          },
          {
            "username": "CTF",
            "password": "BLOCKED"
          }
        ]
      }
    }
  8. The_Zip

    The_Zip Active Member Resource Contributor

    Are you running this all on the same server or different ones?
    • Like Like x 1
  9. killklli

    killklli New Member

    All but one server is on the same IP and I'm trying to do all this for the one server not on the same ip
    • Agree Agree x 1
  10. The_Zip

    The_Zip Active Member Resource Contributor

    I'm confused on what you exactly want, and what you have now? Can you explain in more detail?
    • Like Like x 1
  11. killklli

    killklli New Member

    Ok, I have a dedicated server, running the Hub itself, and three other sub servers. This same dedicated server is also running the lilypad standalone. Then there is the one lone server that is being bought and provided for on another host with its own ip. I want to make it so if someone connects to that ip it sends them to the hub. but if they connect to that IP via the hub itself it allows them to be in that server.
    • Like Like x 1
  12. Shawshark

    Shawshark Active Member Resource Contributor

    So you want something like this

    example player 1 connects using hub.yourdomain.com and they go to the hub.
    example player 2 connects using thewalls.yourdomain.com and they go to thewall server.

    Is that what your trying to do ?
  13. killklli

    killklli New Member

    more like, example player 1 connects to thewalls.domain.com they go to the hub
    But while he is in the hub he can go through a portal and connect to thewall server

    then example player 2 joins hub.domain.com they go directly to the hub

    I ended up doing some work myself and attempting to compile the hubkick plugin I have it somewhat working and it seems to have the basic premise of what I want to do, but a section of it is causing it to throw errors.

    Code (text):
    import org.bukkit.event.player.PlayerLoginEvent.Result;

        @EventHandler(priority=EventPriority.HIGHEST)
        public void onPreJoin(PlayerLoginEvent e){
            if(e.getResult()!=Result.ALLOWED){
                e.setResult(Result.ALLOWED);
                redirect(hub, e.getPlayer());
            }
        }
    that section is causing it to give the error Could not pass event PlayerJoinEvent and will not redirect you to the hub instead.
    • Like Like x 1
  14. Shawshark

    Shawshark Active Member Resource Contributor

    So every ip that goes to that server no matter what you want them to go to the hub?

    replace your allinone config with this then

    Code (text):

    {
      "proxy": {
        "bind": {
          "address": "0.0.0.0",
          "port": 25565
        },
        "outbound": {
          "address": "0.0.0.0"
        },
        "servers": [
          {
            "domain": "*",
            "server": "hub"
          }
        ],
        "motd": "A Minecraft Server",
        "playerMaximum": 1,
        "authenticate": true,
        "throttle": 2500,
        "tabEnabled": true,
        "localeFull": "You seem to be already logged in",
        "localeOffline": "The requested server is currently offline. Try again later!",
        "localeLoggedIn": "You have logged in from another location",
        "localeLostConn": "Lost connection... Please try to reconnect",
        "localeShutdown": "The server is being restarted. Please try to reconnect"
      },
      "queryTcp": {
        "bind": {
          "address": "0.0.0.0",
          "port": 5555
        }
      },
      "queryUdp": {
        "bind": {
          "address": "0.0.0.0",
          "port": 25565
        }
      },
      "connect": {
        "bind": {
          "address": "0.0.0.0",
          "port": 5091
        },
        "logins": [
          {
            "username": "hub",
            "password": "BLOCKED"
          },
          {
            "username": "zarena",
            "password": "BLOCKED"
          },
          {
            "username": "thewalls",
            "password": "BLOCKED"
          },
          {
            "username": "CTF",
            "password": "BLOCKED"
          }
        ]
      }
    }

     
  15. killklli

    killklli New Member

    But if I try to do it that way, I get a error:authentication to lilypad failed from the sub server.
    • Like Like x 1
  16. The_Zip

    The_Zip Active Member Resource Contributor

    Hmm, the one @Shawshark should have worked to fixed your problem, could you include the rest of your error?
    • Like Like x 1
  17. killklli

    killklli New Member

    Going with exactly he gave me, when I try to connect to say thewalls directly it gives me "Error: Authentication to Lilypad Failed" as the person connecting I get nothing extra in the server out of the ordinary. It never ends up re directing me to the hub server.
  18. Shawshark

    Shawshark Active Member Resource Contributor

    Replace all the
    Code (text):
    "address": "0.0.0.0",
     
    with your external IP and connect using that. If you do however still go to the walls and not the hub navigate and open /plugins/LilyPad-Portal/config.yml and set redirectLastServer: false
  19. killklli

    killklli New Member

    If I set all of them to my external ip, the allinone server wont start.
    Last edited: Oct 7, 2013
  20. Mikgreg

    Mikgreg Member

    I would like to bump this, as I am looking for the exact same thing.
    If anyone can point me towards plugins that do this, I would be very grateful.

Share This Page