Refactored PacketProcessor to com.riiablo.net

This commit is contained in:
Collin Smith 2020-06-24 11:35:45 -07:00
parent 8727189283
commit 919281e814
4 changed files with 12 additions and 6 deletions

View File

@ -0,0 +1,7 @@
package com.riiablo.net;
import io.netty.buffer.ByteBuf;
public interface PacketProcessor {
void processPacket(ByteBuf bb);
}

View File

@ -9,6 +9,7 @@ import java.net.InetSocketAddress;
import java.nio.ByteBuffer;
import org.apache.commons.lang3.Validate;
import com.riiablo.net.PacketProcessor;
import com.riiablo.net.reliable.channel.ReliableMessageChannel;
import com.riiablo.net.reliable.channel.UnreliableMessageChannel;
import com.riiablo.net.reliable.channel.UnreliableOrderedMessageChannel;
@ -104,10 +105,6 @@ public class ReliableEndpoint implements MessageChannel.PacketTransceiver {
packetProcessor.processPacket(bb);
}
public interface PacketProcessor {
void processPacket(ByteBuf bb);
}
public static final Stats stats = new Stats();
public static class Stats {

View File

@ -21,11 +21,12 @@ import com.badlogic.gdx.backends.headless.HeadlessApplication;
import com.badlogic.gdx.backends.headless.HeadlessApplicationConfiguration;
import com.riiablo.codec.Animation;
import com.riiablo.net.PacketProcessor;
import com.riiablo.net.packet.netty.Connection;
import com.riiablo.net.packet.netty.Netty;
import com.riiablo.net.packet.netty.NettyData;
public class TestClient extends ApplicationAdapter implements ReliableEndpoint.PacketProcessor {
public class TestClient extends ApplicationAdapter implements PacketProcessor {
private static final String TAG = "Client";
public static void main(String[] args) throws Exception {

View File

@ -19,10 +19,11 @@ import com.badlogic.gdx.backends.headless.HeadlessApplication;
import com.badlogic.gdx.backends.headless.HeadlessApplicationConfiguration;
import com.riiablo.codec.Animation;
import com.riiablo.net.PacketProcessor;
import com.riiablo.net.packet.netty.Netty;
import com.riiablo.net.packet.netty.NettyData;
public class TestServer extends ApplicationAdapter implements ReliableEndpoint.PacketProcessor {
public class TestServer extends ApplicationAdapter implements PacketProcessor {
private static final String TAG = "Server";
static final int PORT = 6114;