MartenM / RedirectPlus

A simple plugin that redirects player when they get kicked of a server.
MIT License
12 stars 5 forks source link

[Help] Cannot redirect to assigned groups/servers #30

Closed ehetteNandaYo closed 3 years ago

ehetteNandaYo commented 3 years ago

I was trying to do configure it like this map, but I cannot figure how.

image

Basically

If resources hell or shops crash, shutdowns, kicks a player, they are sent to Survival,

Survival send them to lobby

and lobby send them to survival (why? because lobby sometimes is shutdown and I dont have a second lobby)

Could you help me?

Thank you!

# 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"
  - "Restarting brb!"
  - "You were kicked for being AFK"

# 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]"

# Disable the uses of aliases on specific servers.
# Useful when having auth servers and AuthMe is not installed on the BungeeCord
disable-aliases:
  # A list of servers to disable the aliases on.
  servers:
    - someserver1
    - someserver2
  # Regex to identify these servers.
  regex: "none"

# 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: 60

# Server groups and their settings
groups:
  lobby:
    # If kicked from this server group, no redirects will happen.
    bottom-kick: false
    # 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: 60
    # 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:
      - mainlobby
    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: {}
  survivalgroup:
    bottom-kick: false
    spread: false
    parent-group: lobby
    # These servers do not have lobbies them self so we use a parent group.
    servers:
      - survival
    servers-regex: 'none'
    connected:
      - survival
    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: {}
  external:
    bottom-kick: false
    spread: false
    parent-group: survivalgroup
    # These servers do not have lobbies them self so we use a parent group.
    servers:
      - resources
      - shops
      - hell
    servers-regex: 'none'
    connected:
      - resources
      - shops
      - hell
    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
MartenM commented 3 years ago

Currently, in Redirct Plus there is no method of achieving the 2-way arrow you drew between Lobby and Surival. I have changed the configuration to support just the Survival -> Lobby which should work most of the times in your case.

  lobby:
    # If kicked from this server group, no redirects will happen.
    bottom-kick: false
    # 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: 60
    # 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:
      - mainlobby
    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: {}
  survivalgroup:
    bottom-kick: false
    spread: false
    parent-group: lobby
    # These servers do not have lobbies them self so we use a parent group.
    servers:
      - survival
    servers-regex: 'none'
    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: {}
  external:
    bottom-kick: false
    spread: false
    parent-group: survivalgroup
    # These servers do not have lobbies them self so we use a parent group.
    servers: {}
    servers-regex: 'none'
    connected:
      - resources
      - shops
      - hell
    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: {}

The only cases this doesn't catch if they are dropped from Lobby. However an alternative to this would be to put both survival and lobby in the same server group. Based on the spread method they would get located to one of the 2 servers.

Another option for me would be to include a spread mode FIRST, which just simply takes the first available server in the list. This option could work nicely too. Let me know if you would be intrested in that!

ehetteNandaYo commented 3 years ago

In the second option, if they are new players they will connect to the Lobby?

I'm trying to avoid new players from joining survival server first, if they are new they must connect to the lobby and then, when they play, they will connect to the last server they were online... I'm using hubmagic right now in secuential mode, which selects the first server in the list for new players and if for some reason that server is down they connect to survival. I think thats how you suggest, if you can make that possible that would be great!.

MartenM commented 3 years ago

Redirect plus does not handle which server people connect to, it only handles redirects from kicks.