Fix a deadlock that could happen in offline mode when shutting down the server

This commit is contained in:
Thinkofdeath 2015-04-20 09:49:39 +01:00
parent 19d9d39eac
commit 98e006c856

View file

@ -74,6 +74,33 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
}
// Spigot end
@@ -0,0 +0,0 @@ public class LoginListener implements PacketLoginInListener, IUpdatePlayerListBo
this.networkManager.handle(new PacketLoginOutEncryptionBegin(this.j, this.server.P().getPublic(), this.e));
} else {
// Spigot start
- try {
- initUUID();
- new LoginHandler().fireEvents();
- } catch (Exception ex) {
- disconnect("Failed to verify username!");
- server.server.getLogger().log(java.util.logging.Level.WARNING, "Exception verifying " + i.getName(), ex);
- }
+ initUUID();
+ new Thread(new Runnable() {
+
+ @Override
+ public void run() {
+ try{
+ new LoginHandler().fireEvents();
+ } catch (Exception ex) {
+ disconnect("Failed to verify username!");
+ server.server.getLogger().log(java.util.logging.Level.WARNING, "Exception verifying " + i.getName(), ex);
+ }
+ }
+ }).start();
// Spigot end
}
diff --git a/src/main/java/net/minecraft/server/NetworkManager.java b/src/main/java/net/minecraft/server/NetworkManager.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/server/NetworkManager.java