public class NetworkDispatcher extends io.netty.channel.SimpleChannelInboundHandler<Packet<?>> implements io.netty.channel.ChannelOutboundHandler
Modifier and Type | Class and Description |
---|---|
static class |
NetworkDispatcher.ConnectionType |
Modifier and Type | Field and Description |
---|---|
static io.netty.util.AttributeKey<NetworkDispatcher> |
FML_DISPATCHER |
static io.netty.util.AttributeKey<java.util.Map<ResourceLocation,ForgeRegistry.Snapshot>> |
FML_GAMEDATA_SNAPSHOT |
static io.netty.util.AttributeKey<java.lang.Boolean> |
IS_LOCAL |
NetworkManager |
manager |
Constructor and Description |
---|
NetworkDispatcher(NetworkManager manager) |
NetworkDispatcher(NetworkManager manager,
PlayerList scm) |
Modifier and Type | Method and Description |
---|---|
void |
abortClientHandshake(java.lang.String type) |
static NetworkDispatcher |
allocAndSet(NetworkManager manager) |
static NetworkDispatcher |
allocAndSet(NetworkManager manager,
PlayerList 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) |
NetworkDispatcher.ConnectionType |
getConnectionType() |
java.util.Map<java.lang.String,java.lang.String> |
getModList()
The mod list returned by this method is in no way reliable because it is provided by the client
|
INetHandler |
getNetHandler() |
int |
getOverrideDimension(SPacketJoinGame packetIn) |
void |
read(io.netty.channel.ChannelHandlerContext ctx) |
void |
rejectHandshake(java.lang.String result) |
void |
sendProxy(FMLProxyPacket msg) |
void |
serverToClientHandshake(EntityPlayerMP player) |
protected void |
setModList(java.util.Map<java.lang.String,java.lang.String> modList) |
void |
setOverrideDimension(int overrideDim) |
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
ensureNotSharable, handlerAdded, handlerRemoved, isSharable
public static final io.netty.util.AttributeKey<NetworkDispatcher> FML_DISPATCHER
public static final io.netty.util.AttributeKey<java.lang.Boolean> IS_LOCAL
public static final io.netty.util.AttributeKey<java.util.Map<ResourceLocation,ForgeRegistry.Snapshot>> FML_GAMEDATA_SNAPSHOT
public final NetworkManager manager
public NetworkDispatcher(NetworkManager manager)
public NetworkDispatcher(NetworkManager manager, PlayerList scm)
public static NetworkDispatcher get(NetworkManager manager)
public static NetworkDispatcher allocAndSet(NetworkManager manager)
public static NetworkDispatcher allocAndSet(NetworkManager manager, PlayerList scm)
public void serverToClientHandshake(EntityPlayerMP player)
protected void setModList(java.util.Map<java.lang.String,java.lang.String> modList)
public void clientToServerHandshake()
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 java.util.Map<java.lang.String,java.lang.String> getModList()
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
public void setOverrideDimension(int overrideDim)
public int getOverrideDimension(SPacketJoinGame packetIn)
public NetworkDispatcher.ConnectionType getConnectionType()