bolt-rip / config-bungee

Config files and docker image of our Bungeecord servers
GNU General Public License v3.0
1 stars 1 forks source link

Fallback to a lobby server if the player get kicked #2

Closed unixfox closed 4 years ago

unixfox commented 4 years ago

Description of the issue

If a player get kicked from a server he looses connection with the bungeecord proxy. We want to move the player instead to a lobby server. We could use movemenow plugin but Kubernetes generates random names that are unpredictable (example: lobby-6t7jx) and movemenow requires writing predictable server names so this plugin doesn't fit our usecase.

The kinds of way to develop that plugin

The very ideal scenario

  1. A player get kicked from a server and a modified version of the plugin Dockerizedcraft knows that thanks to onServerKickEvent.
  2. A modified version of the plugin Dockerizedcraft fetch its current serverlist and filter the servers by the default-group specified in the connection-balancer.yml file.
  3. From this filtered serverlist the plugin pick a server with the lowest amount of players.
  4. Then it sends the player to the server that it picked.

    The ideal scenario

  5. A player get kicked from a server and the plugin knows that thanks to onServerKickEvent.
  6. The plugin fetch the serverlist of dockerizedcraft and filter the serverlist by "lobby" group. Example here (but only for Bukkit servers): https://github.com/DockerizedCraft/Core#server-list-payload
  7. The plugin randomly pick a lobby server with the lowest amount of players.
  8. Then it sends the player to the lobby server that it picked.

    The basic implementation

  9. A player get kicked from a server and the plugin knows that thanks to onServerKickEvent.
  10. The plugin fetch the bungeecord serverlist and filter the server names starting with lobby-.
  11. The plugin randomly pick a lobby server with the lowest amount of players.
  12. Then it sends the player to the lobby server that it picked.
unixfox commented 4 years ago

The basic implementation (without automatically choosing the lobby with the lowest amount of players) was implemented by @Pugzy in https://github.com/Pugzy/MoveMeNow. After testing it, the implementation works as expected: image

Pugzy commented 4 years ago

without automatically choosing the lobby with the lowest amount of players

It should be using the match with the lowest player count, no check for capacity though.