mirror of
https://github.com/collinsmith/riiablo.git
synced 2025-01-19 16:57:20 +07:00
TestClient and TestServer now call ReliableEndpoint#update(float) every frame
This commit is contained in:
parent
165459dd12
commit
58a576dfc9
@ -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();
|
||||
}
|
||||
|
@ -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...");
|
||||
|
@ -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...");
|
||||
|
Loading…
Reference in New Issue
Block a user