mirror of
https://github.com/PaperMC/Paper.git
synced 2025-07-26 09:42:06 -07:00
Remote Connections shouldn't hold up shutdown
Bugs in the connection logic appears to leave stale connections even, preventing shutdown
This commit is contained in:
@@ -250,8 +250,17 @@
|
|||||||
@Override
|
@Override
|
||||||
public boolean isSpawningMonsters() {
|
public boolean isSpawningMonsters() {
|
||||||
return this.settings.getProperties().spawnMonsters && super.isSpawningMonsters();
|
return this.settings.getProperties().spawnMonsters && super.isSpawningMonsters();
|
||||||
@@ -293,6 +403,7 @@
|
@@ -286,13 +396,14 @@
|
||||||
this.queryThreadGs4.stop();
|
}
|
||||||
|
|
||||||
|
if (this.rconThread != null) {
|
||||||
|
- this.rconThread.stop();
|
||||||
|
+ this.rconThread.stopNonBlocking(); // Paper - don't wait for remote connections
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.queryThreadGs4 != null) {
|
||||||
|
- this.queryThreadGs4.stop();
|
||||||
|
+ // this.remoteStatusListener.stop(); // Paper - don't wait for remote connections
|
||||||
}
|
}
|
||||||
|
|
||||||
+ System.exit(0); // CraftBukkit
|
+ System.exit(0); // CraftBukkit
|
||||||
|
@@ -9,3 +9,18 @@
|
|||||||
if (string.isEmpty()) {
|
if (string.isEmpty()) {
|
||||||
string = "0.0.0.0";
|
string = "0.0.0.0";
|
||||||
}
|
}
|
||||||
|
@@ -104,6 +104,14 @@
|
||||||
|
|
||||||
|
this.clients.clear();
|
||||||
|
}
|
||||||
|
+ // Paper start - don't wait for remote connections
|
||||||
|
+ public void stopNonBlocking() {
|
||||||
|
+ this.running = false;
|
||||||
|
+ for (RconClient client : this.clients) {
|
||||||
|
+ client.running = false;
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
+ // Paper end - don't wait for remote connections
|
||||||
|
|
||||||
|
private void closeSocket(ServerSocket socket) {
|
||||||
|
LOGGER.debug("closeSocket: {}", socket);
|
||||||
|
Reference in New Issue
Block a user