13
0
geforkt von Mirrors/Velocity

Limit scope of "attempted server connections" to just initial log ons.

Dieser Commit ist enthalten in:
Andrew Steinborn 2018-08-22 21:10:14 -04:00
Ursprung 2d21c01f8a
Commit 27760f5a97

Datei anzeigen

@ -182,15 +182,18 @@ public class ConnectedPlayer implements MinecraftConnectionAssociation, Player {
public void handleConnectionException(ServerInfo info, Component disconnectReason) { public void handleConnectionException(ServerInfo info, Component disconnectReason) {
connectionInFlight = null; connectionInFlight = null;
if (connectedServer == null || connectedServer.getServerInfo().equals(info)) { if (connectedServer == null) {
// The player isn't yet connected to a server or they are already connected to the server // The player isn't yet connected to a server.
// they're disconnected from.
Optional<ServerInfo> nextServer = getNextServerToTry(); Optional<ServerInfo> nextServer = getNextServerToTry();
if (nextServer.isPresent()) { if (nextServer.isPresent()) {
createConnectionRequest(nextServer.get()).fireAndForget(); createConnectionRequest(nextServer.get()).fireAndForget();
} else { } else {
connection.closeWith(Disconnect.create(disconnectReason)); connection.closeWith(Disconnect.create(disconnectReason));
} }
} else if (connectedServer.getServerInfo().equals(info)) {
// Already connected to the server being disconnected from.
// TODO: ServerKickEvent
connection.closeWith(Disconnect.create(disconnectReason));
} else { } else {
connection.write(Chat.create(disconnectReason)); connection.write(Chat.create(disconnectReason));
} }