Fix several invalid connection closure issues.
This commit is contained in:
@@ -32,7 +32,7 @@ public class BackendPlaySessionHandler implements MinecraftSessionHandler {
|
|||||||
if (!connection.getPlayer().isActive()) {
|
if (!connection.getPlayer().isActive()) {
|
||||||
// Connection was left open accidentally. Close it so as to avoid "You logged in from another location"
|
// Connection was left open accidentally. Close it so as to avoid "You logged in from another location"
|
||||||
// errors.
|
// errors.
|
||||||
connection.getMinecraftConnection().close();
|
connection.disconnect();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -99,7 +99,7 @@ public class BackendPlaySessionHandler implements MinecraftSessionHandler {
|
|||||||
if (!connection.getPlayer().isActive()) {
|
if (!connection.getPlayer().isActive()) {
|
||||||
// Connection was left open accidentally. Close it so as to avoid "You logged in from another location"
|
// Connection was left open accidentally. Close it so as to avoid "You logged in from another location"
|
||||||
// errors.
|
// errors.
|
||||||
connection.getMinecraftConnection().close();
|
connection.disconnect();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -149,8 +149,10 @@ public class VelocityServerConnection implements MinecraftConnectionAssociation,
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void disconnect() {
|
public void disconnect() {
|
||||||
minecraftConnection.close();
|
if (minecraftConnection != null) {
|
||||||
minecraftConnection = null;
|
minecraftConnection.close();
|
||||||
|
minecraftConnection = null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
Reference in New Issue
Block a user