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.58k stars 1.11k forks source link

Don't try to reconnect player when it disconnects manually #3712

Closed Raraph84 closed 3 months ago

Raraph84 commented 4 months ago

I should solve the https://github.com/SpigotMC/BungeeCord/issues/3711 issue

Raraph84 commented 4 months ago

(just signed the commit)

Outfluencer commented 4 months ago

i think the problem is that the server is not marked as obsolote as it should be

I would fix it by set obsolte to true if the server gets disconnected This way the internal use of obsolete is more consistent We also could remove any lines of code that set obsolote to true before disconnecting the server like this

user.getServer().setObsolete( true ); user.getServer().disconnect( "Quitting" );

And just call the setObsolote inside the disconnect method

Raraph84 commented 4 months ago

Like that? I tested and it works

Outfluencer commented 4 months ago

Yes thats exactly what was on my mind

md-5 commented 4 months ago

i think the problem is that the server is not marked as obsolote as it should be

I would fix it by set obsolte to true if the server gets disconnected This way the internal use of obsolete is more consistent We also could remove any lines of code that set obsolote to true before disconnecting the server like this

user.getServer().setObsolete( true ); user.getServer().disconnect( "Quitting" );

And just call the setObsolote inside the disconnect method

Are you sure this fixes it? Looking at the code ServerConnection#disconnect is already accompanied by a setObsolete

Outfluencer commented 4 months ago

i think the problem is that the server is not marked as obsolote as it should be I would fix it by set obsolte to true if the server gets disconnected This way the internal use of obsolete is more consistent We also could remove any lines of code that set obsolote to true before disconnecting the server like this user.getServer().setObsolete( true ); user.getServer().disconnect( "Quitting" ); And just call the setObsolote inside the disconnect method

Are you sure this fixes it? Looking at the code ServerConnection#disconnect is already accompanied by a setObsolete

its about the
con.getServer().disconnect( "Quitting" ); call in the Upstreambridge disconnected method there we have not set obsolete to true

https://github.com/SpigotMC/BungeeCord/blob/8b195d1d2124f18f795d9d6fa8a44bb28c930361/proxy/src/main/java/net/md_5/bungee/connection/UpstreamBridge.java#L110

so it should fix it

Raraph84 commented 4 months ago

Can this be merged then?