Removed sequence from PacketProcessor#processPacket and PacketTransceiver#receivePacket interfaces

sequence was not used and should remain encapsulated beneath MessageChannel layer
This commit is contained in:
Collin Smith 2020-06-23 21:28:20 -07:00
parent 53ceea02a8
commit 53a1a6f117
5 changed files with 7 additions and 7 deletions

View File

@ -25,6 +25,6 @@ public abstract class MessageChannel implements ReliablePacketController.PacketL
public interface PacketTransceiver {
void sendPacket(ByteBuf bb);
void receivePacket(int sequence, ByteBuf bb);
void receivePacket(ByteBuf bb);
}
}

View File

@ -96,12 +96,12 @@ public class ReliableEndpoint implements MessageChannel.PacketTransceiver {
}
@Override
public void receivePacket(int sequence, ByteBuf bb) {
packetProcessor.processPacket(sequence, bb);
public void receivePacket(ByteBuf bb) {
packetProcessor.processPacket(bb);
}
public interface PacketProcessor {
void processPacket(int sequence, ByteBuf bb);
void processPacket(ByteBuf bb);
}
public static final Stats stats = new Stats();

View File

@ -86,7 +86,7 @@ public class TestClient extends ApplicationAdapter implements ReliableEndpoint.P
}
@Override
public void processPacket(int sequence, ByteBuf bb) {
public void processPacket(ByteBuf bb) {
Gdx.app.debug(TAG, "Processing packet...");
Gdx.app.log(TAG, ByteBufUtil.hexDump(bb));
}

View File

@ -66,7 +66,7 @@ public class TestServer extends ApplicationAdapter implements ReliableEndpoint.P
}
@Override
public void processPacket(int sequence, ByteBuf bb) {
public void processPacket(ByteBuf bb) {
Gdx.app.debug(TAG, "Processing packet...");
Gdx.app.log(TAG, ByteBufUtil.hexDump(bb));

View File

@ -27,7 +27,7 @@ public class UnreliableMessageChannel extends MessageChannel {
@Override
public void onPacketProcessed(int sequence, ByteBuf bb) {
if (DEBUG_RECEIVE) Log.debug(TAG, "onPacketProcessed " + bb);
packetTransceiver.receivePacket(sequence, bb);
packetTransceiver.receivePacket(bb);
}
@Override