cpw.mods.fml.common.network.handshake

## Class NetworkDispatcher

- java.lang.Object
- - io.netty.channel.ChannelHandlerAdapter
  - - io.netty.channel.ChannelInboundHandlerAdapter
    - - io.netty.channel.SimpleChannelInboundHandler<Packet>
      - - cpw.mods.fml.common.network.handshake.NetworkDispatcher

- All Implemented Interfaces:
    io.netty.channel.ChannelHandler, io.netty.channel.ChannelInboundHandler, io.netty.channel.ChannelOutboundHandler

      public class NetworkDispatcher
      extends io.netty.channel.SimpleChannelInboundHandler<Packet>
      implements io.netty.channel.ChannelOutboundHandler

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from interface io.netty.channel.ChannelHandler

      `io.netty.channel.ChannelHandler.Sharable`

  - ### Field Summary

    Fields
    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 Summary

    Constructors
    Constructor and Description
    `NetworkDispatcher(NetworkManager manager)`
    `NetworkDispatcher(NetworkManager manager, ServerConfigurationManager scm)`

  - ### Method Summary

    Methods
    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)`

    - ### Methods inherited from class io.netty.channel.SimpleChannelInboundHandler

      `acceptInboundMessage, channelRead`

    - ### Methods inherited from class io.netty.channel.ChannelInboundHandlerAdapter

      `channelActive, channelInactive, channelReadComplete, channelRegistered, channelUnregistered, channelWritabilityChanged`

    - ### Methods inherited from class io.netty.channel.ChannelHandlerAdapter

      `handlerRemoved, isSharable`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

    - ### Methods inherited from interface io.netty.channel.ChannelHandler

      `handlerRemoved`

- - ### Field Detail

    - #### FML_DISPATCHER

          public static final io.netty.util.AttributeKey<NetworkDispatcher> FML_DISPATCHER

    - #### IS_LOCAL

          public static final io.netty.util.AttributeKey<java.lang.Boolean> IS_LOCAL

    - #### manager

          public final NetworkManager manager

  - ### Constructor Detail

    - #### NetworkDispatcher

          public NetworkDispatcher(NetworkManager manager)

    - #### NetworkDispatcher

          public NetworkDispatcher(NetworkManager manager,
                           ServerConfigurationManager scm)

  - ### Method Detail

    - #### get

          public static NetworkDispatcher get(NetworkManager manager)

    - #### allocAndSet

          public static NetworkDispatcher allocAndSet(NetworkManager manager)

    - #### allocAndSet

          public static NetworkDispatcher allocAndSet(NetworkManager manager,
                                      ServerConfigurationManager scm)

    - #### serverToClientHandshake

          public void serverToClientHandshake(EntityPlayerMP player)

    - #### clientToServerHandshake

          public void clientToServerHandshake()

    - #### handlerAdded

          public void handlerAdded(io.netty.channel.ChannelHandlerContext ctx)
                            throws java.lang.Exception

      Specified by:
        `handlerAdded` in interface `io.netty.channel.ChannelHandler`
      Overrides:
        `handlerAdded` in class `io.netty.channel.ChannelHandlerAdapter`
      Throws:
        `java.lang.Exception`

    - #### channelRead0

          protected void channelRead0(io.netty.channel.ChannelHandlerContext ctx,
                          Packet msg)
                               throws java.lang.Exception

      Specified by:
        `channelRead0` in class `io.netty.channel.SimpleChannelInboundHandler<Packet>`
      Throws:
        `java.lang.Exception`

    - #### getNetHandler

          public INetHandler getNetHandler()

    - #### userEventTriggered

          public void userEventTriggered(io.netty.channel.ChannelHandlerContext ctx,
                                java.lang.Object evt)
                                  throws java.lang.Exception

      Specified by:
        `userEventTriggered` in interface `io.netty.channel.ChannelInboundHandler`
      Overrides:
        `userEventTriggered` in class `io.netty.channel.ChannelInboundHandlerAdapter`
      Throws:
        `java.lang.Exception`

    - #### sendProxy

          public void sendProxy(FMLProxyPacket msg)

    - #### rejectHandshake

          public void rejectHandshake(java.lang.String result)

    - #### bind

          public void bind(io.netty.channel.ChannelHandlerContext ctx,
                  java.net.SocketAddress localAddress,
                  io.netty.channel.ChannelPromise promise)
                    throws java.lang.Exception

      Specified by:
        `bind` in interface `io.netty.channel.ChannelOutboundHandler`
      Throws:
        `java.lang.Exception`

    - #### connect

          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

      Specified by:
        `connect` in interface `io.netty.channel.ChannelOutboundHandler`
      Throws:
        `java.lang.Exception`

    - #### disconnect

          public void disconnect(io.netty.channel.ChannelHandlerContext ctx,
                        io.netty.channel.ChannelPromise promise)
                          throws java.lang.Exception

      Specified by:
        `disconnect` in interface `io.netty.channel.ChannelOutboundHandler`
      Throws:
        `java.lang.Exception`

    - #### close

          public void close(io.netty.channel.ChannelHandlerContext ctx,
                   io.netty.channel.ChannelPromise promise)
                     throws java.lang.Exception

      Specified by:
        `close` in interface `io.netty.channel.ChannelOutboundHandler`
      Throws:
        `java.lang.Exception`

    - #### deregister

          @Deprecated
          public void deregister(io.netty.channel.ChannelHandlerContext ctx,
                                   io.netty.channel.ChannelPromise promise)
                          throws java.lang.Exception

      Deprecated.
      Specified by:
        `deregister` in interface `io.netty.channel.ChannelOutboundHandler`
      Throws:
        `java.lang.Exception`

    - #### read

          public void read(io.netty.channel.ChannelHandlerContext ctx)
                    throws java.lang.Exception

      Specified by:
        `read` in interface `io.netty.channel.ChannelOutboundHandler`
      Throws:
        `java.lang.Exception`

    - #### write

          public void write(io.netty.channel.ChannelHandlerContext ctx,
                   java.lang.Object msg,
                   io.netty.channel.ChannelPromise promise)
                     throws java.lang.Exception

      Specified by:
        `write` in interface `io.netty.channel.ChannelOutboundHandler`
      Throws:
        `java.lang.Exception`

    - #### flush

          public void flush(io.netty.channel.ChannelHandlerContext ctx)
                     throws java.lang.Exception

      Specified by:
        `flush` in interface `io.netty.channel.ChannelOutboundHandler`
      Throws:
        `java.lang.Exception`

    - #### completeHandshake

          public void completeHandshake(Side target)

    - #### completeClientHandshake

          public void completeClientHandshake()

    - #### abortClientHandshake

          public void abortClientHandshake(java.lang.String type)

    - #### exceptionCaught

          public void exceptionCaught(io.netty.channel.ChannelHandlerContext ctx,
                             java.lang.Throwable cause)
                               throws java.lang.Exception

      Specified by:
        `exceptionCaught` in interface `io.netty.channel.ChannelHandler`
      Specified by:
        `exceptionCaught` in interface `io.netty.channel.ChannelInboundHandler`
      Overrides:
        `exceptionCaught` in class `io.netty.channel.ChannelInboundHandlerAdapter`
      Throws:
        `java.lang.Exception`