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, org.bukkit.Server server, Object netManager, io.netty.channel.Channel channel, ChannelListener listener, InjectionFactory injector, ErrorReporter errorReporter) -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Close the current injector.voiddisconnect(String message) Retrieve the current protocol state.Retrieve the network marker associated with a given packet.org.bukkit.entity.PlayerRetrieve the current player or temporary player associated with the injector.intRetrieve the current protocol version of the player.io.netty.channel.Channelbooleaninject()Inject the current channel.booleanisClosed()Determine if this channel has been closed and cleaned up.booleanDetermine if the channel has already been injected.voidreceiveClientPacket(Object packet) voidsaveMarker(Object packet, NetworkMarker marker) Associate a given network marker with a specific packet.voidsendServerPacket(Object packet, NetworkMarker marker, boolean filtered) Send a packet to a player's client.voidsetPlayer(org.bukkit.entity.Player player) Set the current player instance.voiduninject()
-
Field Details
-
processedPackets
-
-
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:InjectorRetrieve the current protocol version of the player.- Specified by:
getProtocolVersionin interfaceInjector- Returns:
- Protocol version.
-
inject
public boolean inject()Description copied from interface:InjectorInject the current channel.Note that only active channels can be injected.
-
uninject
public void uninject() -
close
public void close()Description copied from interface:InjectorClose the current injector. -
sendServerPacket
Description copied from interface:InjectorSend a packet to a player's client.- Specified by:
sendServerPacketin interfaceInjector- Parameters:
packet- - the packet to send.marker- - the network marker.filtered- - whether or not the packet is filtered.
-
receiveClientPacket
- Specified by:
receiveClientPacketin interfaceInjector
-
getCurrentProtocol
Description copied from interface:InjectorRetrieve the current protocol state.- Specified by:
getCurrentProtocolin interfaceInjector- Returns:
- The current protocol.
-
getMarker
Description copied from interface:InjectorRetrieve the network marker associated with a given packet. -
saveMarker
Description copied from interface:InjectorAssociate a given network marker with a specific packet.- Specified by:
saveMarkerin interfaceInjector- Parameters:
packet- - the NMS packet.marker- - the associated marker.
-
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. -
disconnect
- Specified by:
disconnectin 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. -
getWrappedChannel
public io.netty.channel.Channel getWrappedChannel()
-