Class NettyChannelInjector
java.lang.Object
com.comphenix.protocol.injector.netty.channel.NettyChannelInjector
- All Implemented Interfaces:
Injector
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionNettyChannelInjector(org.bukkit.entity.Player player, Object networkManager, io.netty.channel.Channel channel, ListenerManager listenerManager, InjectionFactory injector, ErrorReporter errorReporter) -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Close the current injector.voiddisconnect(String message) getCurrentProtocol(PacketType.Sender sender) Retrieve the current protocol state.org.bukkit.entity.PlayerRetrieve the current player or temporary player associated with the injector.intRetrieve the current protocol version of the player.voidinject()Inject the current channel.booleanisClosed()Determine if this channel has been closed and cleaned up.booleanbooleanDetermine if the channel has already been injected.voidreadServerboundPacket(Object packet) voidsendClientboundPacket(Object packet, NetworkMarker marker, boolean filtered) Send a packet to a player's client.voidsendWirePacket(WirePacket packet) voidsetPlayer(org.bukkit.entity.Player player) Set the current player instance.
-
Field Details
-
processedPackets
-
-
Constructor Details
-
NettyChannelInjector
public NettyChannelInjector(org.bukkit.entity.Player player, Object networkManager, io.netty.channel.Channel channel, ListenerManager listenerManager, InjectionFactory injector, ErrorReporter errorReporter)
-
-
Method Details
-
getAddress
- Specified by:
getAddressin interfaceInjector
-
getProtocolVersion
public int getProtocolVersion()Description copied from interface:InjectorRetrieve the current protocol version of the player.- Specified by:
getProtocolVersionin interfaceInjector- Returns:
- Protocol version.
-
inject
public void inject()Description copied from interface:InjectorInject the current channel.Note that only active channels can be injected.
-
close
public void close()Description copied from interface:InjectorClose the current injector. -
sendClientboundPacket
Description copied from interface:InjectorSend a packet to a player's client.- Specified by:
sendClientboundPacketin interfaceInjector- Parameters:
packet- - the packet to send.marker- - the network marker.filtered- - whether or not the packet is filtered.
-
readServerboundPacket
- Specified by:
readServerboundPacketin interfaceInjector
-
sendWirePacket
- Specified by:
sendWirePacketin interfaceInjector
-
disconnect
- Specified by:
disconnectin interfaceInjector
-
getCurrentProtocol
Description copied from interface:InjectorRetrieve the current protocol state. Note that since 1.20.2 the client and server direction can be in different protocol states.- Specified by:
getCurrentProtocolin interfaceInjector- Parameters:
sender- the side for which the state should be resolved.- Returns:
- The current protocol.
-
getPlayer
public org.bukkit.entity.Player getPlayer()Description copied from interface:InjectorRetrieve the current player or temporary player associated with the injector. -
setPlayer
public void setPlayer(org.bukkit.entity.Player player) Description copied from interface:InjectorSet the current player instance. -
isConnected
public boolean isConnected()- Specified by:
isConnectedin interfaceInjector
-
isInjected
public boolean isInjected()Description copied from interface:InjectorDetermine if the channel has already been injected.- Specified by:
isInjectedin interfaceInjector- Returns:
- TRUE if it has, FALSE otherwise.
-
isClosed
public boolean isClosed()Description copied from interface:InjectorDetermine if this channel has been closed and cleaned up.
-