Class BukkitSocketInjector
java.lang.Object
com.comphenix.protocol.injector.server.BukkitSocketInjector
- All Implemented Interfaces:
SocketInjector
-
Constructor Summary
ConstructorsConstructorDescriptionBukkitSocketInjector(org.bukkit.entity.Player player)Represents a temporary socket injector. -
Method Summary
Modifier and TypeMethodDescriptionvoiddisconnect(String message)Attempt to disconnect the current client.Retrieve the associated address of this player.org.bukkit.entity.PlayerRetrieve the hooked player.Retrieve the associated socket of this player.org.bukkit.entity.PlayerRetrieve the hooked player object OR the more up-to-date player instance.booleanDetermines if the player is currently connected.voidsendServerPacket(Object packet, NetworkMarker marker, boolean filtered)Send a packet to the client.voidsetUpdatedPlayer(org.bukkit.entity.Player updatedPlayer)Set the real Bukkit player that we will use.voidtransferState(SocketInjector delegate)Invoked when a delegated socket injector transfers the state of one injector to the next.
-
Constructor Details
-
BukkitSocketInjector
public BukkitSocketInjector(org.bukkit.entity.Player player)Represents a temporary socket injector.- Parameters:
player- - a temporary player.
-
-
Method Details
-
getSocket
Description copied from interface:SocketInjectorRetrieve the associated socket of this player.- Specified by:
getSocketin interfaceSocketInjector- Returns:
- The associated socket.
- Throws:
IllegalAccessException- If we're unable to read the socket field.
-
getAddress
Description copied from interface:SocketInjectorRetrieve the associated address of this player.- Specified by:
getAddressin interfaceSocketInjector- Returns:
- The associated address.
- Throws:
IllegalAccessException- If we're unable to read the socket field.
-
disconnect
Description copied from interface:SocketInjectorAttempt to disconnect the current client.- Specified by:
disconnectin interfaceSocketInjector- Parameters:
message- - the message to display.- Throws:
InvocationTargetException- If disconnection failed.
-
sendServerPacket
public void sendServerPacket(Object packet, NetworkMarker marker, boolean filtered) throws InvocationTargetExceptionDescription copied from interface:SocketInjectorSend a packet to the client.- Specified by:
sendServerPacketin interfaceSocketInjector- Parameters:
packet- - server packet to send.marker- - the network marker.filtered- - whether or not the packet will be filtered by our listeners.- Throws:
InvocationTargetException- If an error occured when sending the packet.
-
getPlayer
public org.bukkit.entity.Player getPlayer()Description copied from interface:SocketInjectorRetrieve the hooked player.- Specified by:
getPlayerin interfaceSocketInjector- Returns:
- The hooked player.
-
getUpdatedPlayer
public org.bukkit.entity.Player getUpdatedPlayer()Description copied from interface:SocketInjectorRetrieve the hooked player object OR the more up-to-date player instance.- Specified by:
getUpdatedPlayerin interfaceSocketInjector- Returns:
- The hooked player, or a more up-to-date instance.
-
transferState
Description copied from interface:SocketInjectorInvoked when a delegated socket injector transfers the state of one injector to the next.- Specified by:
transferStatein interfaceSocketInjector- Parameters:
delegate- - the new injector.
-
setUpdatedPlayer
public void setUpdatedPlayer(org.bukkit.entity.Player updatedPlayer)Description copied from interface:SocketInjectorSet the real Bukkit player that we will use.- Specified by:
setUpdatedPlayerin interfaceSocketInjector- Parameters:
updatedPlayer- - the real Bukkit player.
-
isConnected
public boolean isConnected()Description copied from interface:SocketInjectorDetermines if the player is currently connected.- Specified by:
isConnectedin interfaceSocketInjector- Returns:
- true if the player is connected.
-