public class NetworkDispatcher extends io.netty.channel.SimpleChannelInboundHandler<Packet> implements io.netty.channel.ChannelOutboundHandler
Modifier and Type | Field and Description |
---|---|
static io.netty.util.AttributeKey<NetworkDispatcher> |
FML_DISPATCHER |
static io.netty.util.AttributeKey<java.lang.Boolean> |
IS_LOCAL |
NetworkManager |
manager |
Constructor and Description |
---|
NetworkDispatcher(NetworkManager manager) |
NetworkDispatcher(NetworkManager manager,
ServerConfigurationManager scm) |
Modifier and Type | Method and Description |
---|---|
void |
abortClientHandshake(java.lang.String type) |
static NetworkDispatcher |
allocAndSet(NetworkManager manager) |
static NetworkDispatcher |
allocAndSet(NetworkManager manager,
ServerConfigurationManager scm) |
void |
bind(io.netty.channel.ChannelHandlerContext ctx,
java.net.SocketAddress localAddress,
io.netty.channel.ChannelPromise promise) |
protected void |
channelRead0(io.netty.channel.ChannelHandlerContext ctx,
Packet msg) |
void |
clientToServerHandshake() |
void |
close(io.netty.channel.ChannelHandlerContext ctx,
io.netty.channel.ChannelPromise promise) |
void |
completeClientHandshake() |
void |
completeHandshake(Side target) |
void |
connect(io.netty.channel.ChannelHandlerContext ctx,
java.net.SocketAddress remoteAddress,
java.net.SocketAddress localAddress,
io.netty.channel.ChannelPromise promise) |
void |
deregister(io.netty.channel.ChannelHandlerContext ctx,
io.netty.channel.ChannelPromise promise)
Deprecated.
|
void |
disconnect(io.netty.channel.ChannelHandlerContext ctx,
io.netty.channel.ChannelPromise promise) |
void |
exceptionCaught(io.netty.channel.ChannelHandlerContext ctx,
java.lang.Throwable cause) |
void |
flush(io.netty.channel.ChannelHandlerContext ctx) |
static NetworkDispatcher |
get(NetworkManager manager) |
INetHandler |
getNetHandler() |
void |
handlerAdded(io.netty.channel.ChannelHandlerContext ctx) |
void |
read(io.netty.channel.ChannelHandlerContext ctx) |
void |
rejectHandshake(java.lang.String result) |
void |
sendProxy(FMLProxyPacket msg) |
void |
serverToClientHandshake(EntityPlayerMP player) |
void |
userEventTriggered(io.netty.channel.ChannelHandlerContext ctx,
java.lang.Object evt) |
void |
write(io.netty.channel.ChannelHandlerContext ctx,
java.lang.Object msg,
io.netty.channel.ChannelPromise promise) |
acceptInboundMessage, channelRead
channelActive, channelInactive, channelReadComplete, channelRegistered, channelUnregistered, channelWritabilityChanged
public static final io.netty.util.AttributeKey<NetworkDispatcher> FML_DISPATCHER
public static final io.netty.util.AttributeKey<java.lang.Boolean> IS_LOCAL
public final NetworkManager manager
public NetworkDispatcher(NetworkManager manager)
public NetworkDispatcher(NetworkManager manager, ServerConfigurationManager scm)
public static NetworkDispatcher get(NetworkManager manager)
public static NetworkDispatcher allocAndSet(NetworkManager manager)
public static NetworkDispatcher allocAndSet(NetworkManager manager, ServerConfigurationManager scm)
public void serverToClientHandshake(EntityPlayerMP player)
public void clientToServerHandshake()
public void handlerAdded(io.netty.channel.ChannelHandlerContext ctx) throws java.lang.Exception
handlerAdded
in interface io.netty.channel.ChannelHandler
handlerAdded
in class io.netty.channel.ChannelHandlerAdapter
java.lang.Exception
protected void channelRead0(io.netty.channel.ChannelHandlerContext ctx, Packet msg) throws java.lang.Exception
channelRead0
in class io.netty.channel.SimpleChannelInboundHandler<Packet>
java.lang.Exception
public INetHandler getNetHandler()
public void userEventTriggered(io.netty.channel.ChannelHandlerContext ctx, java.lang.Object evt) throws java.lang.Exception
userEventTriggered
in interface io.netty.channel.ChannelInboundHandler
userEventTriggered
in class io.netty.channel.ChannelInboundHandlerAdapter
java.lang.Exception
public void sendProxy(FMLProxyPacket msg)
public void rejectHandshake(java.lang.String result)
public void bind(io.netty.channel.ChannelHandlerContext ctx, java.net.SocketAddress localAddress, io.netty.channel.ChannelPromise promise) throws java.lang.Exception
bind
in interface io.netty.channel.ChannelOutboundHandler
java.lang.Exception
public void connect(io.netty.channel.ChannelHandlerContext ctx, java.net.SocketAddress remoteAddress, java.net.SocketAddress localAddress, io.netty.channel.ChannelPromise promise) throws java.lang.Exception
connect
in interface io.netty.channel.ChannelOutboundHandler
java.lang.Exception
public void disconnect(io.netty.channel.ChannelHandlerContext ctx, io.netty.channel.ChannelPromise promise) throws java.lang.Exception
disconnect
in interface io.netty.channel.ChannelOutboundHandler
java.lang.Exception
public void close(io.netty.channel.ChannelHandlerContext ctx, io.netty.channel.ChannelPromise promise) throws java.lang.Exception
close
in interface io.netty.channel.ChannelOutboundHandler
java.lang.Exception
@Deprecated public void deregister(io.netty.channel.ChannelHandlerContext ctx, io.netty.channel.ChannelPromise promise) throws java.lang.Exception
deregister
in interface io.netty.channel.ChannelOutboundHandler
java.lang.Exception
public void read(io.netty.channel.ChannelHandlerContext ctx) throws java.lang.Exception
read
in interface io.netty.channel.ChannelOutboundHandler
java.lang.Exception
public void write(io.netty.channel.ChannelHandlerContext ctx, java.lang.Object msg, io.netty.channel.ChannelPromise promise) throws java.lang.Exception
write
in interface io.netty.channel.ChannelOutboundHandler
java.lang.Exception
public void flush(io.netty.channel.ChannelHandlerContext ctx) throws java.lang.Exception
flush
in interface io.netty.channel.ChannelOutboundHandler
java.lang.Exception
public void completeHandshake(Side target)
public void completeClientHandshake()
public void abortClientHandshake(java.lang.String type)
public void exceptionCaught(io.netty.channel.ChannelHandlerContext ctx, java.lang.Throwable cause) throws java.lang.Exception
exceptionCaught
in interface io.netty.channel.ChannelHandler
exceptionCaught
in interface io.netty.channel.ChannelInboundHandler
exceptionCaught
in class io.netty.channel.ChannelInboundHandlerAdapter
java.lang.Exception