Fixed some network crashes and block config problems

This commit is contained in:
Anuken
2018-01-10 17:22:19 -05:00
parent f09394c0ea
commit 1820abe14f
12 changed files with 94 additions and 37 deletions

View File

@@ -53,8 +53,7 @@ public class KryoClient implements ClientProvider{
try{
Net.handleClientReceived(c);
}catch (Exception e){
Gdx.app.exit();
throw new RuntimeException(e);
Gdx.app.postRunnable(() -> {throw new RuntimeException(e);});
}
}
@@ -65,8 +64,7 @@ public class KryoClient implements ClientProvider{
try{
Net.handleClientReceived(c);
}catch (Exception e){
Gdx.app.exit();
throw new RuntimeException(e);
Gdx.app.postRunnable(() -> {throw new RuntimeException(e);});
}
}
@@ -77,8 +75,7 @@ public class KryoClient implements ClientProvider{
try{
Net.handleClientReceived(object);
}catch (Exception e){
Gdx.app.exit();
throw new RuntimeException(e);
Gdx.app.postRunnable(() -> {throw new RuntimeException(e);});
}
}

View File

@@ -29,7 +29,7 @@ public class KryoServer implements ServerProvider {
IntArray connections = new IntArray();
public KryoServer(){
server = new Server(4096, 1024); //TODO tweak
server = new Server(4096*2, 2048); //TODO tweak
server.setDiscoveryHandler(new ServerDiscoveryHandler() {
private ByteBuffer buffer = ByteBuffer.allocate(4);
@@ -61,8 +61,7 @@ public class KryoServer implements ServerProvider {
Net.handleServerReceived(c, c.id);
connections.add(c.id);
}catch (Exception e){
Gdx.app.exit();
throw new RuntimeException(e);
Gdx.app.postRunnable(() -> {throw new RuntimeException(e);});
}
}
@@ -76,8 +75,7 @@ public class KryoServer implements ServerProvider {
try{
Net.handleServerReceived(c, c.id);
}catch (Exception e){
Gdx.app.exit();
throw new RuntimeException(e);
Gdx.app.postRunnable(() -> {throw new RuntimeException(e);});
}
}
@@ -88,8 +86,7 @@ public class KryoServer implements ServerProvider {
try{
Net.handleServerReceived(object, connection.getID());
}catch (Exception e){
Gdx.app.exit();
throw new RuntimeException(e);
Gdx.app.postRunnable(() -> {throw new RuntimeException(e);});
}
}
});