SpigotMC / BungeeCord

BungeeCord, the 6th in a generation of server portal suites. Efficiently proxies and maintains connections and transport between multiple Minecraft servers.
https://www.spigotmc.org/go/bungeecord
Other
1.53k stars 1.09k forks source link

connect player to fallback if backend disconnects silently #3696

Closed Outfluencer closed 2 weeks ago

Outfluencer commented 3 weeks ago

this should make all players connect to a fallback server in any case i think it should solve the problem of #3695 without calling extra events

Outfluencer commented 3 weeks ago

I also added that the name of the server you will connect to will be passed to the translator so you can add it to the message in the message.properties

this PR should increase the all in all stability of backend server craches, and disconnects

andreasdc commented 3 weeks ago

If fallback server is offline and server that the player is on is being turned off, the player may be stuck on the offline server. Is it possible to add a backup fallback server?

Outfluencer commented 3 weeks ago

yes its the same logic as for any other case you get kicked and connected to a fallback server.

updateAndGetNextServer is called to get the next server in priority. if all priorities are offline you get kicked. https://github.com/SpigotMC/BungeeCord/blob/8a88ce464e0b107b15523109afd7810096e635ca/proxy/src/main/java/net/md_5/bungee/UserConnection.java#L257

andreasdc commented 2 weeks ago

yes its the same logic as for any other case you get kicked and connected to a fallback server.

updateAndGetNextServer is called to get the next server in priority. if all priorities are offline you get kicked.

https://github.com/SpigotMC/BungeeCord/blob/8a88ce464e0b107b15523109afd7810096e635ca/proxy/src/main/java/net/md_5/bungee/UserConnection.java#L257

I think kicking the player should only be done as a last resort, not in normal scenario.

Janmm14 commented 2 weeks ago

yes its the same logic as for any other case you get kicked and connected to a fallback server. updateAndGetNextServer is called to get the next server in priority. if all priorities are offline you get kicked. https://github.com/SpigotMC/BungeeCord/blob/8a88ce464e0b107b15523109afd7810096e635ca/proxy/src/main/java/net/md_5/bungee/UserConnection.java#L257

I think kicking the player should only be done as a last resort, not in normal scenario.

When there is no server of the configured priority-server-list server available, what should bungee do if not disconnect?

Now plugins can also use the ServerDisconnectEvent here to redirect the player elsewhere in this case of disconnect.

Outfluencer commented 2 weeks ago

yes its the same logic as for any other case you get kicked and connected to a fallback server.

updateAndGetNextServer is called to get the next server in priority. if all priorities are offline you get kicked.

https://github.com/SpigotMC/BungeeCord/blob/8a88ce464e0b107b15523109afd7810096e635ca/proxy/src/main/java/net/md_5/bungee/UserConnection.java#L257

I think kicking the player should only be done as a last resort, not in normal scenario.

Theoretically we could simply not disconnect the player, then the player would be clientside on a disconnected server and could grief the world or something. But that shouldn't be what you want. The goal should be that you always have a server online to avoid disconnecting.

Janmm14 commented 2 weeks ago

yes its the same logic as for any other case you get kicked and connected to a fallback server.

updateAndGetNextServer is called to get the next server in priority. if all priorities are offline you get kicked.

https://github.com/SpigotMC/BungeeCord/blob/8a88ce464e0b107b15523109afd7810096e635ca/proxy/src/main/java/net/md_5/bungee/UserConnection.java#L257

I think kicking the player should only be done as a last resort, not in normal scenario.

Theoretically we could simply not disconnect the player, then the player would be clientside on a disconnected server and could grief the world or something. But that shouldn't be what you want. The goal should be that you always have a server online to avoid disconnecting.

wouldnt the client just time out as bungee itself doesn't answer on like nearly all packets (except like bungee commands)?

andreasdc commented 2 weeks ago

yes its the same logic as for any other case you get kicked and connected to a fallback server.

updateAndGetNextServer is called to get the next server in priority. if all priorities are offline you get kicked.

https://github.com/SpigotMC/BungeeCord/blob/8a88ce464e0b107b15523109afd7810096e635ca/proxy/src/main/java/net/md_5/bungee/UserConnection.java#L257

I think kicking the player should only be done as a last resort, not in normal scenario.

Theoretically we could simply not disconnect the player, then the player would be clientside on a disconnected server and could grief the world or something. But that shouldn't be what you want. The goal should be that you always have a server online to avoid disconnecting.

For example if player is on server X and fallback server is set to Y, after server Y and then X are disabled, the player is stuck on the server X.

Janmm14 commented 2 weeks ago

yes its the same logic as for any other case you get kicked and connected to a fallback server.

updateAndGetNextServer is called to get the next server in priority. if all priorities are offline you get kicked.

https://github.com/SpigotMC/BungeeCord/blob/8a88ce464e0b107b15523109afd7810096e635ca/proxy/src/main/java/net/md_5/bungee/UserConnection.java#L257

I think kicking the player should only be done as a last resort, not in normal scenario.

Theoretically we could simply not disconnect the player, then the player would be clientside on a disconnected server and could grief the world or something. But that shouldn't be what you want. The goal should be that you always have a server online to avoid disconnecting.

For example if player is on server X and fallback server is set to Y, after server Y and then X are disabled, the player is stuck on the server X.

So what do you expect instead if connection of a palyer is closed by the server? Btw. "Fallback" does not exist anymore, it is now a priority list, allows to enter multiple servers as "fallback"

andreasdc commented 2 weeks ago

yes its the same logic as for any other case you get kicked and connected to a fallback server.

updateAndGetNextServer is called to get the next server in priority. if all priorities are offline you get kicked.

https://github.com/SpigotMC/BungeeCord/blob/8a88ce464e0b107b15523109afd7810096e635ca/proxy/src/main/java/net/md_5/bungee/UserConnection.java#L257

I think kicking the player should only be done as a last resort, not in normal scenario.

Theoretically we could simply not disconnect the player, then the player would be clientside on a disconnected server and could grief the world or something. But that shouldn't be what you want. The goal should be that you always have a server online to avoid disconnecting.

For example if player is on server X and fallback server is set to Y, after server Y and then X are disabled, the player is stuck on the server X.

So what do you expect instead if connection of a palyer is closed by the server? Btw. "Fallback" does not exist anymore, it is now a priority list, allows to enter multiple servers as "fallback"

I'm thinking of main fallback server and backup of that, something like a queue for example.

Janmm14 commented 2 weeks ago

yes its the same logic as for any other case you get kicked and connected to a fallback server.

updateAndGetNextServer is called to get the next server in priority. if all priorities are offline you get kicked.

https://github.com/SpigotMC/BungeeCord/blob/8a88ce464e0b107b15523109afd7810096e635ca/proxy/src/main/java/net/md_5/bungee/UserConnection.java#L257

I think kicking the player should only be done as a last resort, not in normal scenario.

Theoretically we could simply not disconnect the player, then the player would be clientside on a disconnected server and could grief the world or something. But that shouldn't be what you want. The goal should be that you always have a server online to avoid disconnecting.

For example if player is on server X and fallback server is set to Y, after server Y and then X are disabled, the player is stuck on the server X.

So what do you expect instead if connection of a palyer is closed by the server? Btw. "Fallback" does not exist anymore, it is now a priority list, allows to enter multiple servers as "fallback"

I'm thinking of main fallback server and backup of that, something like a queue for example.

If the connection to the current server of priority list fails, it should, as the code is now, call this code again and try the next.

andreasdc commented 2 weeks ago

In the order that's in the config, right? If yes, that's really nice.

Outfluencer commented 2 weeks ago

In the order that's in the config, right? If yes, that's really nice.

Yes