Fixed server getting stuck when hosting

This commit is contained in:
Anuken
2018-01-12 16:03:54 -05:00
parent 5fc5d7ca77
commit 77d8464623
2 changed files with 8 additions and 5 deletions

View File

@@ -21,7 +21,7 @@ allprojects {
appName = "Mindustry"
gdxVersion = '1.9.8'
aiVersion = '1.8.1'
uCoreVersion = '459e8ae';
uCoreVersion = '2254516';
}
repositories {

View File

@@ -46,9 +46,6 @@ public class KryoServer implements ServerProvider {
}
});
Thread thread = new Thread(server, "Kryonet Server");
thread.setDaemon(true);
thread.start();
server.addListener(new Listener(){
@Override
@@ -125,11 +122,17 @@ public class KryoServer implements ServerProvider {
@Override
public void host(int port) throws IOException {
server.bind(port, port);
Thread thread = new Thread(server, "Kryonet Server");
thread.setDaemon(true);
thread.start();
}
@Override
public void close() {
server.close();
UCore.setPrivate(server, "shutdown", true);
new Thread(() -> server.close()).run();
}
@Override