diff --git a/server/netty/src/com/riiablo/net/reliable/ReliableEndpoint.java b/server/netty/src/com/riiablo/net/reliable/ReliableEndpoint.java index 612414c2..4e862102 100644 --- a/server/netty/src/com/riiablo/net/reliable/ReliableEndpoint.java +++ b/server/netty/src/com/riiablo/net/reliable/ReliableEndpoint.java @@ -49,6 +49,10 @@ public class ReliableEndpoint implements MessageChannel.PacketTransceiver { return channel.remoteAddress(); } + public boolean isConnected() { + return channel.isConnected(); + } + public void reset() { for (MessageChannel mc : channels) if (mc != null) mc.reset(); } diff --git a/server/netty/src/com/riiablo/net/reliable/TestClient.java b/server/netty/src/com/riiablo/net/reliable/TestClient.java index 8d48dc2d..d99604c5 100644 --- a/server/netty/src/com/riiablo/net/reliable/TestClient.java +++ b/server/netty/src/com/riiablo/net/reliable/TestClient.java @@ -85,6 +85,13 @@ public class TestClient extends ApplicationAdapter implements ReliableEndpoint.P } } + @Override + public void render() { + if (endpoint != null && endpoint.isConnected()) { + endpoint.update(Gdx.graphics.getDeltaTime()); + } + } + @Override public void processPacket(ByteBuf bb) { Gdx.app.debug(TAG, "Processing packet..."); diff --git a/server/netty/src/com/riiablo/net/reliable/TestServer.java b/server/netty/src/com/riiablo/net/reliable/TestServer.java index 5546e161..5e44b626 100644 --- a/server/netty/src/com/riiablo/net/reliable/TestServer.java +++ b/server/netty/src/com/riiablo/net/reliable/TestServer.java @@ -65,6 +65,13 @@ public class TestServer extends ApplicationAdapter implements ReliableEndpoint.P } } + @Override + public void render() { + if (endpoint != null && endpoint.isConnected()) { + endpoint.update(Gdx.graphics.getDeltaTime()); + } + } + @Override public void processPacket(ByteBuf bb) { Gdx.app.debug(TAG, "Processing packet...");