public class NetworkManager
extends io.netty.channel.SimpleChannelInboundHandler
Modifier and Type | Field and Description |
---|---|
static io.netty.util.AttributeKey |
attrKeyConnectionState |
static LazyLoadBase |
CLIENT_LOCAL_EVENTLOOP |
static LazyLoadBase |
CLIENT_NIO_EVENTLOOP |
static org.apache.logging.log4j.Marker |
logMarkerNetwork |
static org.apache.logging.log4j.Marker |
logMarkerPackets |
Constructor and Description |
---|
NetworkManager(EnumPacketDirection packetDirection) |
Modifier and Type | Method and Description |
---|---|
io.netty.channel.Channel |
channel() |
void |
channelActive(io.netty.channel.ChannelHandlerContext p_channelActive_1_) |
void |
channelInactive(io.netty.channel.ChannelHandlerContext p_channelInactive_1_) |
protected void |
channelRead0(io.netty.channel.ChannelHandlerContext p_channelRead0_1_,
java.lang.Object p_channelRead0_2_) |
protected void |
channelRead0(io.netty.channel.ChannelHandlerContext p_channelRead0_1_,
Packet p_channelRead0_2_) |
void |
checkDisconnected() |
void |
closeChannel(IChatComponent message) |
void |
disableAutoRead() |
void |
enableEncryption(javax.crypto.SecretKey key) |
void |
exceptionCaught(io.netty.channel.ChannelHandlerContext p_exceptionCaught_1_,
java.lang.Throwable p_exceptionCaught_2_) |
EnumPacketDirection |
getDirection() |
IChatComponent |
getExitMessage() |
boolean |
getIsencrypted() |
INetHandler |
getNetHandler() |
java.net.SocketAddress |
getRemoteAddress() |
boolean |
hasNoChannel() |
boolean |
isChannelOpen() |
boolean |
isLocalChannel() |
void |
processReceivedPackets() |
static NetworkManager |
provideLanClient(java.net.InetAddress address,
int port) |
static NetworkManager |
provideLocalClient(java.net.SocketAddress address) |
void |
sendPacket(Packet packetIn) |
void |
sendPacket(Packet packetIn,
io.netty.util.concurrent.GenericFutureListener listener,
io.netty.util.concurrent.GenericFutureListener... listeners) |
void |
setCompressionTreshold(int treshold) |
void |
setConnectionState(EnumConnectionState newState) |
void |
setNetHandler(INetHandler handler) |
acceptInboundMessage, channelRead
channelReadComplete, channelRegistered, channelUnregistered, channelWritabilityChanged, userEventTriggered
handlerAdded, handlerRemoved, isSharable
public static final org.apache.logging.log4j.Marker logMarkerNetwork
public static final org.apache.logging.log4j.Marker logMarkerPackets
public static final io.netty.util.AttributeKey attrKeyConnectionState
public static final LazyLoadBase CLIENT_NIO_EVENTLOOP
public static final LazyLoadBase CLIENT_LOCAL_EVENTLOOP
public NetworkManager(EnumPacketDirection packetDirection)
public EnumPacketDirection getDirection()
public void channelActive(io.netty.channel.ChannelHandlerContext p_channelActive_1_) throws java.lang.Exception
channelActive
in interface io.netty.channel.ChannelInboundHandler
channelActive
in class io.netty.channel.ChannelInboundHandlerAdapter
java.lang.Exception
public void setConnectionState(EnumConnectionState newState)
public void channelInactive(io.netty.channel.ChannelHandlerContext p_channelInactive_1_)
channelInactive
in interface io.netty.channel.ChannelInboundHandler
channelInactive
in class io.netty.channel.ChannelInboundHandlerAdapter
public void exceptionCaught(io.netty.channel.ChannelHandlerContext p_exceptionCaught_1_, java.lang.Throwable p_exceptionCaught_2_)
exceptionCaught
in interface io.netty.channel.ChannelHandler
exceptionCaught
in interface io.netty.channel.ChannelInboundHandler
exceptionCaught
in class io.netty.channel.ChannelInboundHandlerAdapter
protected void channelRead0(io.netty.channel.ChannelHandlerContext p_channelRead0_1_, Packet p_channelRead0_2_)
public void setNetHandler(INetHandler handler)
public void sendPacket(Packet packetIn)
public void sendPacket(Packet packetIn, io.netty.util.concurrent.GenericFutureListener listener, io.netty.util.concurrent.GenericFutureListener... listeners)
public void processReceivedPackets()
public java.net.SocketAddress getRemoteAddress()
public void closeChannel(IChatComponent message)
public boolean isLocalChannel()
public static NetworkManager provideLanClient(java.net.InetAddress address, int port)
public static NetworkManager provideLocalClient(java.net.SocketAddress address)
public void enableEncryption(javax.crypto.SecretKey key)
public boolean getIsencrypted()
public boolean isChannelOpen()
public boolean hasNoChannel()
public INetHandler getNetHandler()
public IChatComponent getExitMessage()
public void disableAutoRead()
public void setCompressionTreshold(int treshold)
public void checkDisconnected()
protected void channelRead0(io.netty.channel.ChannelHandlerContext p_channelRead0_1_, java.lang.Object p_channelRead0_2_)
channelRead0
in class io.netty.channel.SimpleChannelInboundHandler
public io.netty.channel.Channel channel()