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
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.netty.channel.ChannelHandler
io.netty.channel.ChannelHandler.Sharable -
Field Summary
Fields inherited from class org.geysermc.mcprotocollib.network.session.NetworkSession
disconnected, packetHandlerExecutor, protocol, remoteAddress -
Constructor Summary
ConstructorsConstructorDescriptionServerNetworkSession(@NonNull SocketAddress remoteAddress, @NonNull MinecraftProtocol protocol, @NonNull NetworkServer server, @NonNull Executor packetHandlerExecutor) -
Method Summary
Modifier and TypeMethodDescriptionvoidchannelActive(io.netty.channel.ChannelHandlerContext ctx) voidchannelInactive(io.netty.channel.ChannelHandlerContext ctx) getFlags()Gets this session's set flags.<T> TgetFlagSupplied(Flag<T> flag, Supplier<T> defSupplier) Gets the value of the given flag as an instance of the given type.booleanChecks whether this session has a flag set.Methods inherited from class org.geysermc.mcprotocollib.network.session.NetworkSession
addListener, callEvent, callPacketReceived, callPacketSent, channelRead0, disconnect, exceptionCaught, getChannel, getGenericDisconnectMessage, getListeners, getLocalAddress, getPacketHandlerExecutor, getPacketProtocol, getRemoteAddress, isConnected, removeListener, send, setAutoRead, setCompression, setEncryption, setFlag, setFlagsMethods inherited from class io.netty.channel.SimpleChannelInboundHandler
acceptInboundMessage, channelReadMethods inherited from class io.netty.channel.ChannelInboundHandlerAdapter
channelReadComplete, channelRegistered, channelUnregistered, channelWritabilityChanged, userEventTriggeredMethods inherited from class io.netty.channel.ChannelHandlerAdapter
ensureNotSharable, handlerAdded, handlerRemoved, isSharableMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.netty.channel.ChannelHandler
handlerAdded, handlerRemovedMethods inherited from interface org.geysermc.mcprotocollib.network.Session
addListener, callEvent, callPacketReceived, callPacketSent, disconnect, disconnect, disconnect, disconnect, getChannel, getFlag, getFlag, getListeners, getLocalAddress, getPacketHandlerExecutor, getPacketProtocol, getRemoteAddress, isConnected, removeListener, send, send, setAutoRead, setCompression, setEncryption, setFlag, setFlags, switchInboundState, switchOutboundState
-
Constructor Details
-
ServerNetworkSession
public ServerNetworkSession(@NonNull SocketAddress remoteAddress, @NonNull MinecraftProtocol protocol, @NonNull NetworkServer server, @NonNull Executor packetHandlerExecutor)
-
-
Method Details
-
getFlags
Description copied from interface:SessionGets this session's set flags. If this session belongs to a server, the server's flags will be included in the results.- Specified by:
getFlagsin interfaceSession- Overrides:
getFlagsin classNetworkSession- Returns:
- This session's flags.
-
hasFlag
Description copied from interface:SessionChecks whether this session has a flag set. If this session belongs to a server, the server's flags will also be checked.- Specified by:
hasFlagin interfaceSession- Overrides:
hasFlagin classNetworkSession- Parameters:
flag- Flag to check for.- Returns:
- Whether this session has a flag set.
-
getFlagSupplied
Description copied from interface:SessionGets 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:
getFlagSuppliedin interfaceSession- Overrides:
getFlagSuppliedin classNetworkSession- Type Parameters:
T- Type of the flag.- Parameters:
flag- Flag to check for.defSupplier- Default value supplier.- Returns:
- Value of the flag.
-
channelActive
- Specified by:
channelActivein interfaceio.netty.channel.ChannelInboundHandler- Overrides:
channelActivein classNetworkSession- Throws:
Exception
-
channelInactive
- Specified by:
channelInactivein interfaceio.netty.channel.ChannelInboundHandler- Overrides:
channelInactivein classNetworkSession- Throws:
Exception
-