mirror of
https://github.com/collinsmith/riiablo.git
synced 2025-07-08 23:07:46 +07:00
Added Channel field to processPacket callback to retrieve attributes and manage connection
This commit is contained in:
@ -4,6 +4,7 @@ import com.google.flatbuffers.FlatBufferBuilder;
|
||||
import io.netty.bootstrap.Bootstrap;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import io.netty.buffer.ByteBufUtil;
|
||||
import io.netty.channel.Channel;
|
||||
import io.netty.channel.ChannelFuture;
|
||||
import io.netty.channel.ChannelInitializer;
|
||||
import io.netty.channel.EventLoopGroup;
|
||||
@ -92,7 +93,7 @@ public class TestClient extends ApplicationAdapter implements PacketProcessor {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void processPacket(ByteBuf bb) {
|
||||
public void processPacket(Channel ch, ByteBuf bb) {
|
||||
Gdx.app.debug(TAG, "Processing packet...");
|
||||
Gdx.app.log(TAG, ByteBufUtil.hexDump(bb));
|
||||
}
|
||||
|
@ -3,6 +3,7 @@ package com.riiablo.net.reliable;
|
||||
import io.netty.bootstrap.Bootstrap;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import io.netty.buffer.ByteBufUtil;
|
||||
import io.netty.channel.Channel;
|
||||
import io.netty.channel.ChannelFuture;
|
||||
import io.netty.channel.ChannelInitializer;
|
||||
import io.netty.channel.ChannelOption;
|
||||
@ -80,7 +81,7 @@ public class TestServer extends ApplicationAdapter implements PacketProcessor {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void processPacket(ByteBuf bb) {
|
||||
public void processPacket(Channel ch, ByteBuf bb) {
|
||||
Gdx.app.debug(TAG, "Processing packet...");
|
||||
Gdx.app.log(TAG, ByteBufUtil.hexDump(bb));
|
||||
|
||||
|
@ -4,6 +4,7 @@ import com.google.flatbuffers.FlatBufferBuilder;
|
||||
import io.netty.bootstrap.Bootstrap;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import io.netty.buffer.ByteBufUtil;
|
||||
import io.netty.channel.Channel;
|
||||
import io.netty.channel.ChannelFuture;
|
||||
import io.netty.channel.ChannelInitializer;
|
||||
import io.netty.channel.ChannelOption;
|
||||
@ -94,7 +95,7 @@ public class TestClient extends ApplicationAdapter implements PacketProcessor {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void processPacket(ByteBuf bb) {
|
||||
public void processPacket(Channel ch, ByteBuf bb) {
|
||||
Gdx.app.debug(TAG, "Processing packet...");
|
||||
Gdx.app.log(TAG, ByteBufUtil.hexDump(bb));
|
||||
}
|
||||
|
@ -3,6 +3,7 @@ package com.riiablo.net.tcp;
|
||||
import io.netty.bootstrap.ServerBootstrap;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import io.netty.buffer.ByteBufUtil;
|
||||
import io.netty.channel.Channel;
|
||||
import io.netty.channel.ChannelFuture;
|
||||
import io.netty.channel.ChannelInitializer;
|
||||
import io.netty.channel.ChannelOption;
|
||||
@ -80,7 +81,7 @@ public class TestServer extends ApplicationAdapter implements PacketProcessor {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void processPacket(ByteBuf bb) {
|
||||
public void processPacket(Channel ch, ByteBuf bb) {
|
||||
Gdx.app.debug(TAG, "Processing packet...");
|
||||
Gdx.app.log(TAG, " " + ByteBufUtil.hexDump(bb));
|
||||
}
|
||||
|
Reference in New Issue
Block a user