Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

connect player to fallback if backend disconnects silently #3696

Merged
merged 3 commits into from
Jun 22, 2024

Conversation

Outfluencer
Copy link
Contributor

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

so you can do something like this in your messages.properties
if you want to

server_went_down=\u00a7cThe server you were previously on went down, you have been connected to {0}
@Outfluencer
Copy link
Contributor Author

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

Copy link
Member

@md-5 md-5 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems fine to me

@andreasdc
Copy link

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
Copy link
Contributor Author

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.

public ServerInfo updateAndGetNextServer(ServerInfo currentTarget)

@md-5 md-5 merged commit cda4537 into SpigotMC:master Jun 22, 2024
4 checks passed
@andreasdc
Copy link

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.

public ServerInfo updateAndGetNextServer(ServerInfo currentTarget)

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

@Janmm14
Copy link
Contributor

Janmm14 commented Jun 23, 2024

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.

public ServerInfo updateAndGetNextServer(ServerInfo currentTarget)

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
Copy link
Contributor Author

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.

public ServerInfo updateAndGetNextServer(ServerInfo currentTarget)

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
Copy link
Contributor

Janmm14 commented Jun 23, 2024

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.

public ServerInfo updateAndGetNextServer(ServerInfo currentTarget)

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
Copy link

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.

public ServerInfo updateAndGetNextServer(ServerInfo currentTarget)

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
Copy link
Contributor

Janmm14 commented Jun 23, 2024

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.

public ServerInfo updateAndGetNextServer(ServerInfo currentTarget)

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
Copy link

andreasdc commented Jun 23, 2024

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.

public ServerInfo updateAndGetNextServer(ServerInfo currentTarget)

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
Copy link
Contributor

Janmm14 commented Jun 23, 2024

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.

public ServerInfo updateAndGetNextServer(ServerInfo currentTarget)

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
Copy link

andreasdc commented Jun 23, 2024

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

@Outfluencer
Copy link
Contributor Author

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

Yes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants