Interface Injector
- All Known Implementing Classes:
NettyChannelInjector
public interface Injector
Represents an injected client connection.
-
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.booleaninject()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()
-
Method Details
-
getProtocolVersion
int getProtocolVersion()Retrieve the current protocol version of the player.- Returns:
- Protocol version.
-
inject
boolean inject()Inject the current channel.Note that only active channels can be injected.
- Returns:
- TRUE if we injected the channel, false if we could not inject or it was already injected.
-
uninject
void uninject() -
close
void close()Close the current injector. -
sendServerPacket
Send a packet to a player's client.- Parameters:
packet- - the packet to send.marker- - the network marker.filtered- - whether or not the packet is filtered.
-
receiveClientPacket
-
getCurrentProtocol
PacketType.Protocol getCurrentProtocol()Retrieve the current protocol state.- Returns:
- The current protocol.
-
getMarker
Retrieve the network marker associated with a given packet.- Parameters:
packet- - the packet.- Returns:
- The network marker.
-
saveMarker
Associate a given network marker with a specific packet.- Parameters:
packet- - the NMS packet.marker- - the associated marker.
-
getPlayer
org.bukkit.entity.Player getPlayer()Retrieve the current player or temporary player associated with the injector.- Returns:
- The current player.
-
setPlayer
void setPlayer(org.bukkit.entity.Player player) Set the current player instance.- Parameters:
player- - the current player.
-
disconnect
-
isInjected
boolean isInjected()Determine if the channel has already been injected.- Returns:
- TRUE if it has, FALSE otherwise.
-
isClosed
boolean isClosed()Determine if this channel has been closed and cleaned up.- Returns:
- TRUE if it has, FALSE otherwise.
-