public class NetworkDispatcher extends io.netty.channel.SimpleChannelInboundHandler<Packet<?>> implements io.netty.channel.ChannelOutboundHandler
| Modifier and Type | Class and Description |
|---|---|
private static class |
NetworkDispatcher.ConnectionState |
static class |
NetworkDispatcher.ConnectionType |
private class |
NetworkDispatcher.MultiPartCustomPayload |
| Modifier and Type | Field and Description |
|---|---|
private NetworkDispatcher.ConnectionType |
connectionType |
private static boolean |
DEBUG_HANDSHAKE |
static io.netty.util.AttributeKey<NetworkDispatcher> |
FML_DISPATCHER |
static io.netty.util.AttributeKey<java.util.Map<ResourceLocation,ForgeRegistry.Snapshot>> |
FML_GAMEDATA_SNAPSHOT |
private io.netty.channel.embedded.EmbeddedChannel |
handshakeChannel |
static io.netty.util.AttributeKey<java.lang.Boolean> |
IS_LOCAL |
NetworkManager |
manager |
private java.util.Map<java.lang.String,java.lang.String> |
modList |
private NetworkDispatcher.MultiPartCustomPayload |
multipart |
private INetHandler |
netHandler |
private int |
overrideLoginDim |
private EntityPlayerMP |
player |
private PlayerList |
scm |
private NetHandlerPlayServer |
serverHandler |
private Side |
side |
private NetworkDispatcher.ConnectionState |
state |
| 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) |
private void |
cleanAttributes(io.netty.channel.ChannelHandlerContext ctx) |
(package private) void |
clientListenForServerHandshake() |
void |
clientToServerHandshake() |
void |
close(io.netty.channel.ChannelHandlerContext ctx,
io.netty.channel.ChannelPromise promise) |
void |
completeClientHandshake() |
private void |
completeClientSideConnection(NetworkDispatcher.ConnectionType type) |
void |
completeHandshake(Side target) |
private void |
completeServerSideConnection(NetworkDispatcher.ConnectionType type) |
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) |
private boolean |
handleClientSideCustomPacket(SPacketCustomPayload msg,
io.netty.channel.ChannelHandlerContext context) |
private boolean |
handleMultiPartCustomPacket(SPacketCustomPayload msg,
io.netty.channel.ChannelHandlerContext context) |
private boolean |
handleServerSideCustomPacket(CPacketCustomPayload msg,
io.netty.channel.ChannelHandlerContext context) |
private boolean |
handleVanilla(Packet<?> msg) |
private void |
insertIntoChannel() |
private void |
kickVanilla() |
private void |
kickWithMessage(java.lang.String message) |
void |
read(io.netty.channel.ChannelHandlerContext ctx) |
void |
rejectHandshake(java.lang.String result) |
void |
sendProxy(FMLProxyPacket msg) |
(package private) int |
serverInitiateHandshake() |
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, channelReadchannelActive, channelInactive, channelReadComplete, channelRegistered, channelUnregistered, channelWritabilityChangedensureNotSharable, handlerAdded, handlerRemoved, isSharableprivate static boolean DEBUG_HANDSHAKE
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
private final PlayerList scm
private EntityPlayerMP player
private NetworkDispatcher.ConnectionState state
private NetworkDispatcher.ConnectionType connectionType
private final Side side
private final io.netty.channel.embedded.EmbeddedChannel handshakeChannel
private NetHandlerPlayServer serverHandler
private INetHandler netHandler
private java.util.Map<java.lang.String,java.lang.String> modList
private int overrideLoginDim
private NetworkDispatcher.MultiPartCustomPayload multipart
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)
private void insertIntoChannel()
public void clientToServerHandshake()
int serverInitiateHandshake()
void clientListenForServerHandshake()
private void completeClientSideConnection(NetworkDispatcher.ConnectionType type)
private void completeServerSideConnection(NetworkDispatcher.ConnectionType type)
protected void channelRead0(io.netty.channel.ChannelHandlerContext ctx,
Packet<?> msg)
throws java.lang.Exception
channelRead0 in class io.netty.channel.SimpleChannelInboundHandler<Packet<?>>java.lang.Exceptionprivate boolean handleVanilla(Packet<?> msg)
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.ChannelInboundHandleruserEventTriggered in class io.netty.channel.ChannelInboundHandlerAdapterjava.lang.Exceptionprivate void kickVanilla()
private void kickWithMessage(java.lang.String message)
private boolean handleClientSideCustomPacket(SPacketCustomPayload msg, io.netty.channel.ChannelHandlerContext context)
private boolean handleMultiPartCustomPacket(SPacketCustomPayload msg, io.netty.channel.ChannelHandlerContext context)
private boolean handleServerSideCustomPacket(CPacketCustomPayload msg, io.netty.channel.ChannelHandlerContext context)
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.ChannelOutboundHandlerjava.lang.Exceptionpublic 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.ChannelOutboundHandlerjava.lang.Exceptionpublic void disconnect(io.netty.channel.ChannelHandlerContext ctx,
io.netty.channel.ChannelPromise promise)
throws java.lang.Exception
disconnect in interface io.netty.channel.ChannelOutboundHandlerjava.lang.Exceptionpublic void close(io.netty.channel.ChannelHandlerContext ctx,
io.netty.channel.ChannelPromise promise)
throws java.lang.Exception
close in interface io.netty.channel.ChannelOutboundHandlerjava.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.ChannelOutboundHandlerjava.lang.Exceptionpublic void read(io.netty.channel.ChannelHandlerContext ctx)
throws java.lang.Exception
read in interface io.netty.channel.ChannelOutboundHandlerjava.lang.Exceptionpublic 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.ChannelOutboundHandlerjava.lang.Exceptionpublic void flush(io.netty.channel.ChannelHandlerContext ctx)
throws java.lang.Exception
flush in interface io.netty.channel.ChannelOutboundHandlerjava.lang.Exceptionpublic 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.ChannelHandlerexceptionCaught in interface io.netty.channel.ChannelInboundHandlerexceptionCaught in class io.netty.channel.ChannelInboundHandlerAdapterjava.lang.Exceptionprivate void cleanAttributes(io.netty.channel.ChannelHandlerContext ctx)
public void setOverrideDimension(int overrideDim)
public int getOverrideDimension(SPacketJoinGame packetIn)
public NetworkDispatcher.ConnectionType getConnectionType()