Class NettyChannelInjector

java.lang.Object
com.comphenix.protocol.injector.netty.channel.NettyChannelInjector
All Implemented Interfaces:
Injector

public class NettyChannelInjector extends Object implements Injector
  • Field Details

  • Constructor Details

    • NettyChannelInjector

      public NettyChannelInjector(org.bukkit.entity.Player player, org.bukkit.Server server, Object netManager, io.netty.channel.Channel channel, ChannelListener listener, InjectionFactory injector, ErrorReporter errorReporter)
  • Method Details

    • getProtocolVersion

      public int getProtocolVersion()
      Description copied from interface: Injector
      Retrieve the current protocol version of the player.
      Specified by:
      getProtocolVersion in interface Injector
      Returns:
      Protocol version.
    • inject

      public boolean inject()
      Description copied from interface: Injector
      Inject the current channel.

      Note that only active channels can be injected.

      Specified by:
      inject in interface Injector
      Returns:
      TRUE if we injected the channel, false if we could not inject or it was already injected.
    • uninject

      public void uninject()
      Specified by:
      uninject in interface Injector
    • close

      public void close()
      Description copied from interface: Injector
      Close the current injector.
      Specified by:
      close in interface Injector
    • sendServerPacket

      public void sendServerPacket(Object packet, NetworkMarker marker, boolean filtered)
      Description copied from interface: Injector
      Send a packet to a player's client.
      Specified by:
      sendServerPacket in interface Injector
      Parameters:
      packet - - the packet to send.
      marker - - the network marker.
      filtered - - whether or not the packet is filtered.
    • receiveClientPacket

      public void receiveClientPacket(Object packet)
      Specified by:
      receiveClientPacket in interface Injector
    • getCurrentProtocol

      public PacketType.Protocol getCurrentProtocol()
      Description copied from interface: Injector
      Retrieve the current protocol state.
      Specified by:
      getCurrentProtocol in interface Injector
      Returns:
      The current protocol.
    • getMarker

      public NetworkMarker getMarker(Object packet)
      Description copied from interface: Injector
      Retrieve the network marker associated with a given packet.
      Specified by:
      getMarker in interface Injector
      Parameters:
      packet - - the packet.
      Returns:
      The network marker.
    • saveMarker

      public void saveMarker(Object packet, NetworkMarker marker)
      Description copied from interface: Injector
      Associate a given network marker with a specific packet.
      Specified by:
      saveMarker in interface Injector
      Parameters:
      packet - - the NMS packet.
      marker - - the associated marker.
    • getPlayer

      public org.bukkit.entity.Player getPlayer()
      Description copied from interface: Injector
      Retrieve the current player or temporary player associated with the injector.
      Specified by:
      getPlayer in interface Injector
      Returns:
      The current player.
    • setPlayer

      public void setPlayer(org.bukkit.entity.Player player)
      Description copied from interface: Injector
      Set the current player instance.
      Specified by:
      setPlayer in interface Injector
      Parameters:
      player - - the current player.
    • disconnect

      public void disconnect(String message)
      Specified by:
      disconnect in interface Injector
    • isInjected

      public boolean isInjected()
      Description copied from interface: Injector
      Determine if the channel has already been injected.
      Specified by:
      isInjected in interface Injector
      Returns:
      TRUE if it has, FALSE otherwise.
    • isClosed

      public boolean isClosed()
      Description copied from interface: Injector
      Determine if this channel has been closed and cleaned up.
      Specified by:
      isClosed in interface Injector
      Returns:
      TRUE if it has, FALSE otherwise.
    • getWrappedChannel

      public io.netty.channel.Channel getWrappedChannel()