Bungee - Proxy Redirect Plus 2.11.3

Redirect players on kicks. Moves players on server shutdowns and restarts. Easy but extensive.

  1. Is there a regex support for the servernames?
     
  2. Not as as of yet. Sounds like a very nice addition though and I could easily implement that!
     
  3. I keep getting handleDisconnection() called twice errors every time RedirectPlus tries to redirect a player, then fails and disconnects them from the server completely. I am using 1.14.2 but I have been using it for a while and the issue is only coming up after I updated to the latest. Any comments?

    Bungee Console Messages:
    Code (Text):
    [23:34:53 INFO] [RedirectPlus]: Redirected SenseiTechUS from survival to lobby
    [23:34:53 INFO]: [SenseiTechUS] disconnected with: Kicked from server.
    [23:34:53 INFO]: [/xxx.xx.x.xxx:xxxxx|SenseiTechUS] <-> DownstreamBridge <-> [survival] has disconnected
    [23:34:53 INFO]: [/xxx.xx.x.xxx:xxxxx|SenseiTechUS] -> UpstreamBridge has disconnected
    Config:
    Code (YAML):
    lobby:
        bottom-kick
    : false
        spread
    : true
        parent-group
    : none
        servers
    :
         - lobby
        connected
    :
         - survival
        aliases
    : {}
    Edit: So I tried restarting the proxy one more time and for some reason, it works flawlessly now so I have no idea what happened...
     
    #63 SenseiTechUS, Jun 20, 2019
    Last edited: Jun 21, 2019
  4. Hmmm, let me know if it happens again.
     
  5. Will work on this soonish, really like this suggestion.

    Will test soon.
     
  6. Hello, im having problems with the plugin, it doesnt redirect when user is kicked or server is shutdown
    /rd servers shows the hub server as online but does not redirect anyone to it

    this is my config of the plugin

    Code (YAML):
    # All the messages send by the plugin.
    messages
    :
      redirected
    :
       - "&f"
        - "&cEl servidor en el que estabas se reiniciĆ³."
        - "&cHas sido redireccionado a el Hub."
        - "&f"
      unable-redirect-alias
    :
       - "&f"
        - "&cUnable to send you. All servers in that category are unavailable."
        - "&f"
      unable-redirect-alias-same-category
    :
       - "&f"
        - "&cUnable to send you to another server in this category."
        - "&f"

    # The amount of time between checking if a server is online.
    # Players won't be connected to offline servers.
    check
    : 30

    # The delay that is given to the redirect message.
    # When you have a lot of messages when a player joins a certain server this can help to make sure that the redirectplus messages shows as 'newest'.
    # The delay is in seconds.
    delay
    : 0

    # Blacklist. When a kick message contains this word they will NOT get redirected.
    #   This will result in the player seeing the kick screen.
    blacklist
    :
     - "ban"

    # Detect shutdown in server kick messages
    #   This can be faster for when you want to shutdowns servers and using RedirectPlus to redirectplus those people.
    detect-shutdown
    :
      enabled
    : true
      messages
    :
     - "shutdown"
      - "restart"
      - "closed"

    # Don't show the redirect message if the message contains one of the following words.
    # Can be useful when redirecting people from a game lobby and stuff.
    no-messages
    :
     - "[Silent]"

    # unknown-group / server
    # This will redirect unknown servers to the group listed here:
    unknown-group
    : lobby

    # Specify defaults here. You can overwrite these settings by adding them to groups them self.
    global
    :
     # Spread modes:
      #   PROGRESSIVE : Fill the server to the progressive-minimal amount, after that fill the next one, giving nicely populated lobbies. Uses LOWEST when the minimal is reached on all servers.
      #   CYCLE       : Cycle to the server to spread the load as much as possible. This can result in players being in a server on their own.
      #   LOWEST      : Send the player to the server with the lowest amount of players online.
      #   HIGHEST     : Send the players to the server with the highest amount of players. (Not adviced!)
      spread-mode
    : LOWEST

      # The minimal amount of players that are on a server before the next server gets selected.
      progressive-minimal
    : 20

    # Server groups and their settings
    groups
    :
      lobby
    :
       # If kicked from this server group, no redirects will happen.
        bottom-kick
    : true
        # Spread redirected people over the servers.
        spread
    : false
        # Spread mode, if spread is enabled, use the following spread mode (will overwrite global if used).
        spread-mode
    : PROGRESSIVE
        # The minimal amount of players that are on a server before the next server gets selected. (only used for PROGRESSIVE spread)
        progressive-minimal
    : 20
        # Parent group - If none of the servers are available, the parent group will be used.
        # Set to none if none. If the parent server group is needed the player will be kicked instead.
        parent-group
    : none
        servers
    :
         - LOBBY-1
        # Servers that are connected to this group, but they won't be redirected to:
        connected
    : {}
        # Aliases can be used to redirect people to the server group when they use a certain command (Eg: lobby, hub, survival, towny, etc)
        aliases
    : {}
    # Log settings, this will show your messages in console so you know what's going on.
    log
    :
     # If set to true the plugin will log redirects attempts that are canceled due to blacklisted words.
      blacklist
    : true
      # If set to true the plugin will log redirects that fail because no server was found.
      redirect-failed
    : true
      # If set to true the plugin will log players that do not get redirected due to the bottom-kick setting enabled.
      bottom-kick
    : false
      # If set to true the plugin will log successful redirect attempts.
      redirected
    : true
      # If set to true the plugin will log any cancelled redirect attempts due to inactive connections.
      inactive
    : true

    # EXAMPLE SETUP
    #groups:
    #  # The main lobby. If kicked from here they should not be redirected so we enable bottom-kick.
    #  # There are no connected servers here.
    #  main-lobby:
    #    bottom-kick: true
    #    spread: true
    #    parent-group: none
    #    servers:
    #      - lobby1
    #      - lobby2
    #      - lobby3
    #    connected: {}
    #    # Aliases can be used to redirect people to the server group when they use a certain command (Eg: lobby, hub, survival, towny, etc)
    #    aliases:
    #      - lobbies
    #      - lobby
    #  # This is the survival games group.
    #  # bottom-kick is false, since we want redirects from the connected servers.
    #  # The lobby servers are in the 'servers' list (so they will be redirected to) and the game servers are in the 'connected' list.
    #  survivalgames:
    #    bottom-kick: false
    #    spread: true
    #    parent-group: none
    #    servers:
    #      - sg-lobby-1
    #      - sg-lobby-2
    #    connected:
    #      - sg-game-1
    #      - sg-game-2
    #      - sg-game-3
    #      - sg-game-4
    #      - sg-game-5
    #    # Aliases can be used to redirect people to the server group when they use a certain command (Eg: lobby, hub, survival, towny, etc)
    #    aliases:
    #      - survivalgames
    #      - sg
     
  7. Sorry for the late response, I would recommend you to add all servers in the connected list of 'lobby' that you want to be redirected.
     
  8. Better late then never I guess :p
    Updated with your suggestion.
     
  9. Is it 1.14.4 supported?
     
  10. Yes
     
  11. Nice! Could you give an example on how to use the regex in the config just to be sure?
     
  12. It tries to match the server name with the regex. If it is successful it wil be added.
    My servers are all named 1.12, 1.13, 1.14, etc. So the following line will add them all:
    https://regexr.com/ is a great site for building the regex patterns. For example for multiple lobby servers something like this could work: https://www.regexr.com/4j041
    Code (YAML):

    groups
    :
      lobby
    :
       # If kicked from this server group, no redirects will happen.
        bottom-kick
    : true
        # Spread redirected people over the servers.
        spread
    : true
        # Spread mode, if spread is enabled, use the following spread mode (will overwrite global if used).
        spread-mode
    : PROGRESSIVE
        # The minimal amount of players that are on a server before the next server gets selected. (only used for PROGRESSIVE spread)
        progressive-minimal
    : 20
        # Parent group - If none of the servers are available, the parent group will be used.
        # Set to none if none. If the parent server group is needed the player will be kicked instead.
        parent-group
    : none
        servers
    : {}
        servers-regex
    : 'lobby-\d'
        # Servers that are connected to this group, but they won't be redirected to:
        connected
    : {}
        connected-regex
    : 'none'
        aliases
    : {}
     
     
  13. https://pastebin.com/DcpTVH4L

    So, I'm checking the console and it seems like the plugin does attempt to redirect the player, but does it after the player has already left the server, do you know if this is due to misconfiguration on my part?

    upload_2019-8-13_12-21-55.png
     
  14. Looks like the player gets redirected to the lobby server and gets kicked from that one instead.
     
  15. Hello,

    I have two configured lobby if one of my game servers goes out. The redirection works perfectly but if I close one of the lobby the players are not redirected to the other lobby. How to solve this problem ?

    My configuration:
    Code (Text):
    # All the messages send by the plugin.
    messages:
      redirected:
        - "&f"
        - "&cAn kick occurred in your connection. &cReason:&r %reason%"
        - "&cYou have been send back to the main lobby."
        - "&f"
      unable-redirect-alias:
        - "&f"
        - "&cUnable to send you. All servers in that category are unavailable."
        - "&f"
      unable-redirect-alias-same-category:
        - "&f"
        - "&cUnable to send you to another server in this category."
        - "&f"

    # The amount of time between checking if a server is online.
    # Players won't be connected to offline servers.
    check: 30

    # The delay that is given to the redirect message.
    # When you have a lot of messages when a player joins a certain server this can help to make sure that the redirectplus messages shows as 'newest'.
    # The delay is in seconds.
    delay: 0

    # Blacklist. When a kick message contains this word they will NOT get redirected.
    #   This will result in the player seeing the kick screen.
    blacklist:
      - "ban"

    # Detect shutdown in server kick messages
    #   This can be faster for when you want to shutdowns servers and using RedirectPlus to redirectplus those people.
    detect-shutdown:
      enabled: true
      messages:
      - "shutdown"
      - "restart"
      - "closed"

    # Don't show the redirect message if the message contains one of the following words.
    # Can be useful when redirecting people from a game lobby and stuff.
    no-messages:
      - "[Silent]"

    # unknown-group / server
    # This will redirect unknown servers to the group listed here:
    unknown-group:
      - lobby

    # Specify defaults here. You can overwrite these settings by adding them to groups them self.
    global:
      # Spread modes:
      #   PROGRESSIVE : Fill the server to the progressive-minimal amount, after that fill the next one, giving nicely populated lobbies. Uses LOWEST when the minimal is reached on all servers.
      #   CYCLE       : Cycle to the server to spread the load as much as possible. This can result in players being in a server on their own.
      #   LOWEST      : Send the player to the server with the lowest amount of players online.
      #   HIGHEST     : Send the players to the server with the highest amount of players. (Not adviced!)
      spread-mode: PROGRESSIVE

      # The minimal amount of players that are on a server before the next server gets selected.
      progressive-minimal: 20

    # Server groups and their settings
    groups:
      lobby:
        # If kicked from this server group, no redirects will happen.
        bottom-kick: true
        # Spread redirected people over the servers.
        spread: true
        # Spread mode, if spread is enabled, use the following spread mode (will overwrite global if used).
        spread-mode: PROGRESSIVE
        # The minimal amount of players that are on a server before the next server gets selected. (only used for PROGRESSIVE spread)
        progressive-minimal: 20
        # Parent group - If none of the servers are available, the parent group will be used.
        # Set to none if none. If the parent server group is needed the player will be kicked instead.
        parent-group: none
        servers:
          - lobby-1
          - lobby-2
        servers-regex: 'none'
        # Servers that are connected to this group, but they won't be redirected to:
        connected: {}
        connected-regex: 'none'
        # Aliases can be used to redirect people to the server group when they use a certain command (Eg: lobby, hub, survival, towny, etc)
        aliases: {}

    # Log settings, this will show your messages in console so you know what's going on.
    log:
      # If set to true the plugin will log redirects attempts that are canceled due to blacklisted words.
      blacklist: true
      # If set to true the plugin will log redirects that fail because no server was found.
      redirect-failed: true
      # If set to true the plugin will log players that do not get redirected due to the bottom-kick setting enabled.
      bottom-kick: false
      # If set to true the plugin will log successful redirect attempts.
      redirected: true
      # If set to true the plugin will log any cancelled redirect attempts due to inactive connections.
      inactive: true
     
     
  16. Code (YAML):
    # If kicked from this server group, no redirects will happen.
        bottom-kick
    : true
    Set this line to false.
     
  17. Thank for your reply.

    I have another problem sometimes, when I try to shutdown my second lobby I am kicked and not redirected to other servers. The console displays this warning:
    Code (Text):
    09:56:19 [WARNING] Error dispatching event ServerKickEvent(cancelled=false, player=Floflobel, kickedFrom=BungeeServerInfo(name=lobby-2, address=localhost/127.0.0.1:20102
    , restricted=false), kickReasonComponent=[TextComponent{text=Server closed, BaseComponent(color=, bold=null, italic=null, underlined=null, strikethrough=null, obfuscated
    =null, insertion=null, extra=null, clickEvent=null, hoverEvent=null)}], cancelServer=BungeeServerInfo(name=lobby-1, address=localhost/127.0.0.1:20101, restricted=false),
    state=CONNECTED) to listener [email protected]
    java.lang.NullPointerException
        at nl.martenm.redirectplus.listeners.PlayerKickListener.handleKickEvent(PlayerKickListener.java:69)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at net.md_5.bungee.event.EventHandlerMethod.invoke(EventHandlerMethod.java:19)
        at net.md_5.bungee.event.EventBus.post(EventBus.java:46)
        at net.md_5.bungee.api.plugin.PluginManager.callEvent(PluginManager.java:397)
        at net.md_5.bungee.connection.DownstreamBridge.handle(DownstreamBridge.java:484)
        at net.md_5.bungee.protocol.packet.Kick.handle(Kick.java:35)
        at net.md_5.bungee.netty.HandlerBoss.channelRead(HandlerBoss.java:104)
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:359)
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:345)
        at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:337)
        at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:102)
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:359)
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:345)
        at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:337)
        at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:102)
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:359)
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:345)
        at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:337)
        at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:323)
        at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:297)
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:359)
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:345)
        at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:337)
        at io.netty.handler.timeout.IdleStateHandler.channelRead(IdleStateHandler.java:286)
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:359)
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:345)
        at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:337)
        at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1408)
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:359)
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:345)
        at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:930)
        at io.netty.channel.epoll.AbstractEpollStreamChannel$EpollStreamUnsafe.epollInReady(AbstractEpollStreamChannel.java:796)
        at io.netty.channel.epoll.EpollEventLoop.processReady(EpollEventLoop.java:427)
        at io.netty.channel.epoll.EpollEventLoop.run(EpollEventLoop.java:328)
        at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:905)
        at java.lang.Thread.run(Thread.java:748)
    09:56:19 [INFO] [Floflobel] disconnected with: Server closed
    09:56:19 [INFO] [Floflobel] <-> DownstreamBridge <-> [lobby-2] has disconnected
    09:56:19 [INFO] [Floflobel] -> UpstreamBridge has disconnected
     
     
    #78 Floflobel, Sep 23, 2019
    Last edited: Sep 26, 2019
  18. Hello,
    @MartenM Any news on my issue ?
     
  19. Hi @MartenM
    I am somewhat having a problem and I believe I am making a stupid mistake but I have tried a good bit to get it to work. The problem is that it won't redirect me to the hub server when I am in other servers and the other way around. I am not getting any errors in console when I try to connect, just "Unable to send you to another server in this category. Sorry if its a really stupid mistake and thank you so much! Here is my config: https://pastebin.com/1W5qSB7s