Class NetworkManagerInjector
java.lang.Object
com.comphenix.protocol.injector.netty.manager.NetworkManagerInjector
- All Implemented Interfaces:
ChannelListener
-
Constructor Summary
ConstructorsConstructorDescriptionNetworkManagerInjector(org.bukkit.plugin.Plugin plugin, org.bukkit.Server server, ListenerInvoker listenerInvoker, ErrorReporter reporter) -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Retrieve the current error reporter.booleanhasListener(Class<?> packetClass) Determine if there is a packet listener for the given packet.booleanbooleanhasMainThreadListener(Class<?> packetClass) Determine if there is a server packet listener that must be executed on the main thread.voidinject()booleanisDebug()Determine if debug mode is enabled.onPacketReceiving(Injector injector, Object packet, NetworkMarker marker) Invoked when a packet is being received from a client.onPacketSending(Injector injector, Object packet, NetworkMarker marker) Invoked when a packet is being sent to the client.voidsetDebug(boolean debug)
-
Constructor Details
-
NetworkManagerInjector
public NetworkManagerInjector(org.bukkit.plugin.Plugin plugin, org.bukkit.Server server, ListenerInvoker listenerInvoker, ErrorReporter reporter)
-
-
Method Details
-
onPacketSending
Description copied from interface:ChannelListenerInvoked when a packet is being sent to the client.This is invoked on the main thread.
- Specified by:
onPacketSendingin interfaceChannelListener- Parameters:
injector- - the channel injector.packet- - the packet.marker- - the network marker.- Returns:
- The packet even that was passed to the listeners, with a possible packet change, or NULL.
-
onPacketReceiving
Description copied from interface:ChannelListenerInvoked when a packet is being received from a client.This is invoked on an asynchronous worker thread.
- Specified by:
onPacketReceivingin interfaceChannelListener- Parameters:
injector- - the channel injector.packet- - the packet.marker- - the associated network marker, if any.- Returns:
- The packet even that was passed to the listeners, with a possible packet change, or NULL.
-
hasListener
Description copied from interface:ChannelListenerDetermine if there is a packet listener for the given packet.- Specified by:
hasListenerin interfaceChannelListener- Parameters:
packetClass- - the packet class to check.- Returns:
- TRUE if there is such a listener, FALSE otherwise.
-
hasMainThreadListener
Description copied from interface:ChannelListenerDetermine if there is a server packet listener that must be executed on the main thread.- Specified by:
hasMainThreadListenerin interfaceChannelListener- Parameters:
packetClass- - the packet class to check.- Returns:
- TRUE if there is, FALSE otherwise.
-
hasMainThreadListener
- Specified by:
hasMainThreadListenerin interfaceChannelListener
-
getReporter
Description copied from interface:ChannelListenerRetrieve the current error reporter.- Specified by:
getReporterin interfaceChannelListener- Returns:
- The error reporter.
-
isDebug
public boolean isDebug()Description copied from interface:ChannelListenerDetermine if debug mode is enabled.- Specified by:
isDebugin interfaceChannelListener- Returns:
- TRUE if it is, FALSE otherwise.
-
setDebug
public void setDebug(boolean debug) -
inject
public void inject() -
close
public void close() -
getPacketInjector
-
getPlayerInjectionHandler
-