mirror of
https://github.com/collinsmith/riiablo.git
synced 2025-01-19 16:57:20 +07:00
Refactored PacketProcessor to com.riiablo.net
This commit is contained in:
parent
8727189283
commit
919281e814
7
server/netty/src/com/riiablo/net/PacketProcessor.java
Normal file
7
server/netty/src/com/riiablo/net/PacketProcessor.java
Normal file
@ -0,0 +1,7 @@
|
||||
package com.riiablo.net;
|
||||
|
||||
import io.netty.buffer.ByteBuf;
|
||||
|
||||
public interface PacketProcessor {
|
||||
void processPacket(ByteBuf bb);
|
||||
}
|
@ -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 {
|
||||
|
@ -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 {
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user