Class ServerNetworkSession

java.lang.Object
io.netty.channel.ChannelHandlerAdapter
io.netty.channel.ChannelInboundHandlerAdapter
io.netty.channel.SimpleChannelInboundHandler<Packet>
org.geysermc.mcprotocollib.network.session.NetworkSession
org.geysermc.mcprotocollib.network.session.ServerNetworkSession
All Implemented Interfaces:
io.netty.channel.ChannelHandler, io.netty.channel.ChannelInboundHandler, ServerSession, Session

public class ServerNetworkSession extends NetworkSession implements ServerSession
  • Constructor Details

  • Method Details

    • getCodecHelper

      public PacketCodecHelper getCodecHelper()
      Description copied from interface: Session
      Gets the session's PacketCodecHelper.
      Specified by:
      getCodecHelper in interface Session
      Returns:
      The session's packet codec helper.
    • getFlags

      public Map<String,Object> getFlags()
      Description copied from interface: Session
      Gets this session's set flags. If this session belongs to a server, the server's flags will be included in the results.
      Specified by:
      getFlags in interface Session
      Overrides:
      getFlags in class NetworkSession
      Returns:
      This session's flags.
    • hasFlag

      public boolean hasFlag(Flag<?> flag)
      Description copied from interface: Session
      Checks whether this session has a flag set. If this session belongs to a server, the server's flags will also be checked.
      Specified by:
      hasFlag in interface Session
      Overrides:
      hasFlag in class NetworkSession
      Parameters:
      flag - Flag to check for.
      Returns:
      Whether this session has a flag set.
    • getFlagSupplied

      public <T> T getFlagSupplied(Flag<T> flag, Supplier<T> defSupplier)
      Description copied from interface: Session
      Gets the value of the given flag as an instance of the given type. If this session belongs to a server, the server's flags will be checked for the flag as well. If the flag is not set, the specified default value will be returned.
      Specified by:
      getFlagSupplied in interface Session
      Overrides:
      getFlagSupplied in class NetworkSession
      Type Parameters:
      T - Type of the flag.
      Parameters:
      flag - Flag to check for.
      defSupplier - Default value supplier.
      Returns:
      Value of the flag.
    • channelActive

      public void channelActive(io.netty.channel.ChannelHandlerContext ctx) throws Exception
      Specified by:
      channelActive in interface io.netty.channel.ChannelInboundHandler
      Overrides:
      channelActive in class NetworkSession
      Throws:
      Exception
    • channelInactive

      public void channelInactive(io.netty.channel.ChannelHandlerContext ctx) throws Exception
      Specified by:
      channelInactive in interface io.netty.channel.ChannelInboundHandler
      Overrides:
      channelInactive in class NetworkSession
      Throws:
      Exception