Class AbstractPlayerHandler
java.lang.Object
com.comphenix.protocol.injector.netty.AbstractPlayerHandler
- All Implemented Interfaces:
PlayerInjectionHandler
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.comphenix.protocol.injector.player.PlayerInjectionHandler
PlayerInjectionHandler.ConflictStrategy -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddPacketHandler(PacketType type, Set<ListenerOptions> options)Add an underlying packet handler of the given type.booleanWhether or not this player injection handler can also receive packets.voidcheckListener(PacketListener listener)Determine if a listener is valid or not.voidcheckListener(Set<PacketListener> listeners)Determine if the given listeners are valid.voidclose()Close any lingering proxy injections.org.bukkit.entity.PlayergetPlayerByConnection(DataInputStream inputStream)Retrieve a player by its DataInput connection.Retrieves how the server packets are read.getPlayerHook(GamePhase phase)Retrieves how the server packets are read.Retrieve the current list of registered sending listeners.voidremovePacketHandler(PacketType type)Remove an underlying packet handler of this type.voidsetPlayerHook(GamePhase phase, PlayerInjectHooks playerHook)Sets how the server packets are read.voidsetPlayerHook(PlayerInjectHooks playerHook)Sets how the server packets are read.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.comphenix.protocol.injector.player.PlayerInjectionHandler
getChannel, getProtocolVersion, handleDisconnect, handlePacketRecieved, hasMainThreadListener, injectPlayer, recieveClientPacket, sendServerPacket, uninjectPlayer, uninjectPlayer, updatePlayer
-
Field Details
-
sendingFilters
-
-
Constructor Details
-
AbstractPlayerHandler
-
-
Method Details
-
setPlayerHook
Description copied from interface:PlayerInjectionHandlerSets how the server packets are read.- Specified by:
setPlayerHookin interfacePlayerInjectionHandler- Parameters:
phase- - the current game phase.playerHook- - the new injection method for reading server packets.
-
setPlayerHook
Description copied from interface:PlayerInjectionHandlerSets how the server packets are read.- Specified by:
setPlayerHookin interfacePlayerInjectionHandler- Parameters:
playerHook- - the new injection method for reading server packets.
-
addPacketHandler
Description copied from interface:PlayerInjectionHandlerAdd an underlying packet handler of the given type.- Specified by:
addPacketHandlerin interfacePlayerInjectionHandler- Parameters:
type- - packet type to register.options- - any specified listener options.
-
removePacketHandler
Description copied from interface:PlayerInjectionHandlerRemove an underlying packet handler of this type.- Specified by:
removePacketHandlerin interfacePlayerInjectionHandler- Parameters:
type- - packet type to unregister.
-
getSendingFilters
Description copied from interface:PlayerInjectionHandlerRetrieve the current list of registered sending listeners.- Specified by:
getSendingFiltersin interfacePlayerInjectionHandler- Returns:
- List of the sending listeners's packet IDs.
-
close
public void close()Description copied from interface:PlayerInjectionHandlerClose any lingering proxy injections.- Specified by:
closein interfacePlayerInjectionHandler
-
getPlayerHook
Description copied from interface:PlayerInjectionHandlerRetrieves how the server packets are read.- Specified by:
getPlayerHookin interfacePlayerInjectionHandler- Parameters:
phase- - the current game phase.- Returns:
- Injection method for reading server packets.
-
canRecievePackets
public boolean canRecievePackets()Description copied from interface:PlayerInjectionHandlerWhether or not this player injection handler can also receive packets.- Specified by:
canRecievePacketsin interfacePlayerInjectionHandler- Returns:
- TRUE if it can, FALSE otherwise.
-
getPlayerHook
Description copied from interface:PlayerInjectionHandlerRetrieves how the server packets are read.- Specified by:
getPlayerHookin interfacePlayerInjectionHandler- Returns:
- Injection method for reading server packets.
-
getPlayerByConnection
public org.bukkit.entity.Player getPlayerByConnection(DataInputStream inputStream) throws InterruptedExceptionDescription copied from interface:PlayerInjectionHandlerRetrieve a player by its DataInput connection.- Specified by:
getPlayerByConnectionin interfacePlayerInjectionHandler- Parameters:
inputStream- - the associated DataInput connection.- Returns:
- The player.
- Throws:
InterruptedException- If the thread was interrupted during the wait.
-
checkListener
Description copied from interface:PlayerInjectionHandlerDetermine if a listener is valid or not.If not, a warning will be printed to the console.
- Specified by:
checkListenerin interfacePlayerInjectionHandler- Parameters:
listener- - listener to check.
-
checkListener
Description copied from interface:PlayerInjectionHandlerDetermine if the given listeners are valid.- Specified by:
checkListenerin interfacePlayerInjectionHandler- Parameters:
listeners- - listeners to check.
-