diff --git a/Javadoc/allclasses-frame.html b/Javadoc/allclasses-frame.html index 99570c19..a83084a9 100644 --- a/Javadoc/allclasses-frame.html +++ b/Javadoc/allclasses-frame.html @@ -2,7 +2,7 @@
- +public interface AsynchronousManager
+Modifier and Type | +Method and Description | +
---|---|
void |
+cleanupAll()
+Remove listeners, close threads and transmit every delayed packet.
+ |
+
java.util.logging.Logger |
+getLogger()
+Retrieve the default error logger.
+ |
+
PacketStream |
+getPacketStream()
+Retrieve the default packet stream.
+ |
+
java.util.Set<java.lang.Integer> |
+getReceivingFilters()
+Retrieves a immutable set containing the ID of the recieved client packets that will be
+ observed by the asynchronous listeners.
+ |
+
java.util.Set<java.lang.Integer> |
+getSendingFilters()
+Retrieves a immutable set containing the ID of the sent server packets that will be
+ observed by the asynchronous listeners.
+ |
+
boolean |
+hasAsynchronousListeners(PacketEvent packet)
+Determine if a given synchronous packet has asynchronous listeners.
+ |
+
AsyncListenerHandler |
+registerAsyncHandler(PacketListener listener)
+Registers an asynchronous packet handler.
+ |
+
void |
+unregisterAsyncHandler(AsyncListenerHandler handler)
+Unregisters and closes the given asynchronous handler.
+ |
+
void |
+unregisterAsyncHandlers(org.bukkit.plugin.Plugin plugin)
+Unregisters every asynchronous handler associated with this plugin.
+ |
+
AsyncListenerHandler registerAsyncHandler(PacketListener listener)+
+ To start listening asynchronously, pass the getListenerLoop() runnable to a different thread.
plugin
- - the plugin that is registering the handler.listener
- - the packet listener that will recieve these asynchronous events.void unregisterAsyncHandler(AsyncListenerHandler handler)+
handler
- - asynchronous handler.void unregisterAsyncHandlers(org.bukkit.plugin.Plugin plugin)+
plugin
- - the original plugin.java.util.Set<java.lang.Integer> getSendingFilters()+
java.util.Set<java.lang.Integer> getReceivingFilters()+
boolean hasAsynchronousListeners(PacketEvent packet)+
packet
- - packet to test.PacketStream getPacketStream()+
java.util.logging.Logger getLogger()+
void cleanupAll()+
public interface PacketStream
+Modifier and Type | +Method and Description | +
---|---|
void |
+recieveClientPacket(org.bukkit.entity.Player sender,
+ PacketContainer packet)
+Simulate recieving a certain packet from a given player.
+ |
+
void |
+recieveClientPacket(org.bukkit.entity.Player sender,
+ PacketContainer packet,
+ boolean filters)
+Simulate recieving a certain packet from a given player.
+ |
+
void |
+sendServerPacket(org.bukkit.entity.Player reciever,
+ PacketContainer packet)
+Send a packet to the given player.
+ |
+
void |
+sendServerPacket(org.bukkit.entity.Player reciever,
+ PacketContainer packet,
+ boolean filters)
+Send a packet to the given player.
+ |
+
void sendServerPacket(org.bukkit.entity.Player reciever, + PacketContainer packet) + throws java.lang.reflect.InvocationTargetException+
reciever
- - the reciever.packet
- - packet to send.java.lang.reflect.InvocationTargetException
- - if an error occured when sending the packet.void sendServerPacket(org.bukkit.entity.Player reciever, + PacketContainer packet, + boolean filters) + throws java.lang.reflect.InvocationTargetException+
reciever
- - the reciever.packet
- - packet to send.filters
- - whether or not to invoke any packet filters.java.lang.reflect.InvocationTargetException
- - if an error occured when sending the packet.void recieveClientPacket(org.bukkit.entity.Player sender, + PacketContainer packet) + throws java.lang.IllegalAccessException, + java.lang.reflect.InvocationTargetException+
sender
- - the sender.packet
- - the packet that was sent.java.lang.reflect.InvocationTargetException
- If the reflection machinery failed.java.lang.IllegalAccessException
- If the underlying method caused an error.void recieveClientPacket(org.bukkit.entity.Player sender, + PacketContainer packet, + boolean filters) + throws java.lang.IllegalAccessException, + java.lang.reflect.InvocationTargetException+
sender
- - the sender.packet
- - the packet that was sent.filters
- - whether or not to invoke any packet filters.java.lang.reflect.InvocationTargetException
- If the reflection machinery failed.java.lang.IllegalAccessException
- If the underlying method caused an error.public class AsyncFilterManager +extends java.lang.Object +implements AsynchronousManager+
Constructor and Description | +
---|
AsyncFilterManager(java.util.logging.Logger logger,
+ org.bukkit.scheduler.BukkitScheduler scheduler,
+ ProtocolManager manager) |
+
Modifier and Type | +Method and Description | +
---|---|
void |
+cleanupAll()
+Remove listeners, close threads and transmit every delayed packet.
+ |
+
AsyncMarker |
+createAsyncMarker()
+Construct a asynchronous marker with all the default values.
+ |
+
AsyncMarker |
+createAsyncMarker(long sendingDelta,
+ long timeoutDelta)
+Construct an async marker with the given sending priority delta and timeout delta.
+ |
+
void |
+enqueueSyncPacket(PacketEvent syncPacket,
+ AsyncMarker asyncMarker)
+Enqueue a packet for asynchronous processing.
+ |
+
java.util.logging.Logger |
+getLogger()
+Retrieve the default error logger.
+ |
+
PacketStream |
+getPacketStream()
+Retrieve the default packet stream.
+ |
+
java.util.Set<java.lang.Integer> |
+getReceivingFilters()
+Retrieves a immutable set containing the ID of the recieved client packets that will be
+ observed by the asynchronous listeners.
+ |
+
java.util.Set<java.lang.Integer> |
+getSendingFilters()
+Retrieves a immutable set containing the ID of the sent server packets that will be
+ observed by the asynchronous listeners.
+ |
+
boolean |
+hasAsynchronousListeners(PacketEvent packet)
+Determine if a given synchronous packet has asynchronous listeners.
+ |
+
AsyncListenerHandler |
+registerAsyncHandler(PacketListener listener)
+Registers an asynchronous packet handler.
+ |
+
void |
+scheduleAsyncTask(org.bukkit.plugin.Plugin plugin,
+ java.lang.Runnable runnable)
+Used to create a default asynchronous task.
+ |
+
void |
+sendProcessedPackets(int tickCounter,
+ boolean onMainThread)
+Send any due packets, or clean up packets that have expired.
+ |
+
void |
+signalPacketUpdate(PacketEvent packet)
+Signal that a packet is ready to be transmitted.
+ |
+
void |
+signalProcessingDone(PacketEvent packet)
+Signal that a packet has finished processing.
+ |
+
void |
+unregisterAsyncHandler(AsyncListenerHandler handler)
+Unregisters and closes the given asynchronous handler.
+ |
+
void |
+unregisterAsyncHandlers(org.bukkit.plugin.Plugin plugin)
+Unregisters every asynchronous handler associated with this plugin.
+ |
+
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public AsyncFilterManager(java.util.logging.Logger logger, + org.bukkit.scheduler.BukkitScheduler scheduler, + ProtocolManager manager)+
public AsyncListenerHandler registerAsyncHandler(PacketListener listener)+
AsynchronousManager
+ To start listening asynchronously, pass the getListenerLoop() runnable to a different thread.
registerAsyncHandler
in interface AsynchronousManager
listener
- - the packet listener that will recieve these asynchronous events.public void unregisterAsyncHandler(AsyncListenerHandler handler)+
AsynchronousManager
unregisterAsyncHandler
in interface AsynchronousManager
handler
- - asynchronous handler.public void unregisterAsyncHandlers(org.bukkit.plugin.Plugin plugin)+
AsynchronousManager
unregisterAsyncHandlers
in interface AsynchronousManager
plugin
- - the original plugin.public void enqueueSyncPacket(PacketEvent syncPacket, + AsyncMarker asyncMarker)+
syncPacket
- - synchronous packet event.asyncMarker
- - the asynchronous marker to use.public java.util.Set<java.lang.Integer> getSendingFilters()+
AsynchronousManager
getSendingFilters
in interface AsynchronousManager
public java.util.Set<java.lang.Integer> getReceivingFilters()+
AsynchronousManager
getReceivingFilters
in interface AsynchronousManager
public void scheduleAsyncTask(org.bukkit.plugin.Plugin plugin, + java.lang.Runnable runnable)+
plugin
- - the calling plugin.runnable
- - the runnable.public boolean hasAsynchronousListeners(PacketEvent packet)+
AsynchronousManager
hasAsynchronousListeners
in interface AsynchronousManager
packet
- - packet to test.public AsyncMarker createAsyncMarker()+
public AsyncMarker createAsyncMarker(long sendingDelta, + long timeoutDelta)+
sendingDelta
- - how many packets we're willing to wait.timeoutDelta
- - how long (in ms) until the packet expire.public PacketStream getPacketStream()+
AsynchronousManager
getPacketStream
in interface AsynchronousManager
public java.util.logging.Logger getLogger()+
AsynchronousManager
getLogger
in interface AsynchronousManager
public void cleanupAll()+
AsynchronousManager
cleanupAll
in interface AsynchronousManager
public void signalPacketUpdate(PacketEvent packet)+
packet
- - packet to signal.public void signalProcessingDone(PacketEvent packet)+
packet
- - packet to signal.public void sendProcessedPackets(int tickCounter, + boolean onMainThread)+
public class AsyncListenerHandler
+extends java.lang.Object
+Constructor and Description | +
---|
AsyncListenerHandler(java.lang.Thread mainThread,
+ AsyncFilterManager filterManager,
+ PacketListener listener) |
+
Modifier and Type | +Method and Description | +
---|---|
void |
+cancel()
+Cancel the handler.
+ |
+
void |
+enqueuePacket(PacketEvent packet)
+Queue a packet for processing.
+ |
+
PacketListener |
+getAsyncListener() |
+
java.lang.Runnable |
+getListenerLoop()
+Create a runnable that will initiate the listener loop.
+ |
+
org.bukkit.plugin.Plugin |
+getPlugin()
+Retrieve the plugin associated with this async listener.
+ |
+
boolean |
+isCancelled() |
+
void |
+start()
+Start the asynchronous listener using the Bukkit scheduler.
+ |
+
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public AsyncListenerHandler(java.lang.Thread mainThread, + AsyncFilterManager filterManager, + PacketListener listener)+
public boolean isCancelled()+
public PacketListener getAsyncListener()+
public void cancel()+
public void enqueuePacket(PacketEvent packet)+
packet
- - a packet for processing.java.lang.IllegalStateException
- If the underlying packet queue is full.public java.lang.Runnable getListenerLoop()+
+ Warning: Never call the run() method in the main thread.
public org.bukkit.plugin.Plugin getPlugin()+
public void start()+
public class AsyncMarker +extends java.lang.Object +implements java.io.Serializable, java.lang.Comparable<AsyncMarker>+
+ Asynchronous listeners can use this to set packet timeout or transmission order.
Modifier and Type | +Field and Description | +
---|---|
static int |
+DEFAULT_SENDING_DELTA
+Default number of packets to skip.
+ |
+
static int |
+DEFAULT_TIMEOUT_DELTA
+Default number of milliseconds until a packet will rejected.
+ |
+
Modifier and Type | +Method and Description | +
---|---|
int |
+compareTo(AsyncMarker o) |
+
long |
+getInitialTime()
+Retrieve the time the packet was initially queued for asynchronous processing.
+ |
+
java.util.Iterator<PrioritizedListener<AsyncListenerHandler>> |
+getListenerTraversal()
+Retrieve iterator for the next listener in line.
+ |
+
long |
+getNewSendingIndex()
+Retrieve the desired sending order after processing has completed.
+ |
+
long |
+getOriginalSendingIndex()
+Retrieve the order the packet was originally transmitted.
+ |
+
PacketStream |
+getPacketStream()
+Retrieve the packet stream responsible for transmitting this packet.
+ |
+
long |
+getTimeout()
+Retrieve the time the packet will be forcefully rejected.
+ |
+
boolean |
+hasExpired()
+Determine if this packet has expired.
+ |
+
boolean |
+hasExpired(long currentTime)
+Determine if this packet has expired given this time.
+ |
+
boolean |
+isAsyncCancelled()
+Determine if the asynchronous handling should be cancelled.
+ |
+
boolean |
+isMinecraftAsync(PacketEvent event)
+Determine if Minecraft allows asynchronous processing of this packet.
+ |
+
boolean |
+isProcessed()
+Retrieve whether or not this packet has been processed by the async listeners.
+ |
+
boolean |
+isTransmitted()
+Retrieve whether or not this packet has already been sent.
+ |
+
void |
+sendPacket(PacketEvent event)
+Transmit a given packet to the current packet stream.
+ |
+
void |
+setAsyncCancelled(boolean asyncCancelled)
+Set whether or not the asynchronous handling should be cancelled.
+ |
+
void |
+setNewSendingIndex(long newSendingIndex)
+Sets the desired sending order after processing has completed.
+ |
+
void |
+setPacketStream(PacketStream packetStream)
+Sets the output packet stream responsible for transmitting this packet.
+ |
+
void |
+setTimeout(long timeout)
+Set the time the packet will be forcefully rejected.
+ |
+
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public static final int DEFAULT_TIMEOUT_DELTA+
public static final int DEFAULT_SENDING_DELTA+
public long getInitialTime()+
public long getTimeout()+
public void setTimeout(long timeout)+
timeout
- - time to reject the packet, in milliseconds since 01.01.1970 00:00.public long getOriginalSendingIndex()+
public long getNewSendingIndex()+
+ Higher sending order means lower priority.
public void setNewSendingIndex(long newSendingIndex)+
+ Higher sending order means lower priority.
newSendingIndex
- - new packet send index.public PacketStream getPacketStream()+
public void setPacketStream(PacketStream packetStream)+
packetStream
- - new output packet stream.public boolean isProcessed()+
public boolean isTransmitted()+
public boolean hasExpired()+
public boolean hasExpired(long currentTime)+
currentTime
- - the current time in milliseconds since 01.01.1970 00:00.public boolean isAsyncCancelled()+
public void setAsyncCancelled(boolean asyncCancelled)+
asyncCancelled
- - TRUE to cancel it, FALSE otherwise.public java.util.Iterator<PrioritizedListener<AsyncListenerHandler>> getListenerTraversal()+
public void sendPacket(PacketEvent event) + throws java.io.IOException+
event
- - the packet to send.java.io.IOException
- If the packet couldn't be sent.public boolean isMinecraftAsync(PacketEvent event) + throws FieldAccessException+
FieldAccessException
public int compareTo(AsyncMarker o)+
compareTo
in interface java.lang.Comparable<AsyncMarker>
Package | +Description | +
---|---|
com.comphenix.protocol.async | ++ |
Constructor and Description | +
---|
AsyncListenerHandler(java.lang.Thread mainThread,
+ AsyncFilterManager filterManager,
+ PacketListener listener) |
+
Package | +Description | +
---|---|
com.comphenix.protocol | ++ |
com.comphenix.protocol.async | ++ |
Modifier and Type | +Method and Description | +
---|---|
AsyncListenerHandler |
+AsynchronousManager.registerAsyncHandler(PacketListener listener)
+Registers an asynchronous packet handler.
+ |
+
Modifier and Type | +Method and Description | +
---|---|
void |
+AsynchronousManager.unregisterAsyncHandler(AsyncListenerHandler handler)
+Unregisters and closes the given asynchronous handler.
+ |
+
Modifier and Type | +Method and Description | +
---|---|
AsyncListenerHandler |
+AsyncFilterManager.registerAsyncHandler(PacketListener listener) |
+
Modifier and Type | +Method and Description | +
---|---|
java.util.Iterator<PrioritizedListener<AsyncListenerHandler>> |
+AsyncMarker.getListenerTraversal()
+Retrieve iterator for the next listener in line.
+ |
+
Modifier and Type | +Method and Description | +
---|---|
void |
+AsyncFilterManager.unregisterAsyncHandler(AsyncListenerHandler handler) |
+
Package | +Description | +
---|---|
com.comphenix.protocol.async | ++ |
com.comphenix.protocol.events | ++ |
Modifier and Type | +Method and Description | +
---|---|
AsyncMarker |
+AsyncFilterManager.createAsyncMarker()
+Construct a asynchronous marker with all the default values.
+ |
+
AsyncMarker |
+AsyncFilterManager.createAsyncMarker(long sendingDelta,
+ long timeoutDelta)
+Construct an async marker with the given sending priority delta and timeout delta.
+ |
+
Modifier and Type | +Method and Description | +
---|---|
int |
+AsyncMarker.compareTo(AsyncMarker o) |
+
void |
+AsyncFilterManager.enqueueSyncPacket(PacketEvent syncPacket,
+ AsyncMarker asyncMarker)
+Enqueue a packet for asynchronous processing.
+ |
+
Modifier and Type | +Method and Description | +
---|---|
AsyncMarker |
+PacketEvent.getAsyncMarker()
+Retrieve the asynchronous marker.
+ |
+
Modifier and Type | +Method and Description | +
---|---|
static PacketEvent |
+PacketEvent.fromSynchronous(PacketEvent event,
+ AsyncMarker marker)
+Create an asynchronous packet event from a synchronous event and a async marker.
+ |
+
void |
+PacketEvent.setAsyncMarker(AsyncMarker asyncMarker)
+Set the asynchronous marker.
+ |
+
Class | +Description | +
---|---|
AsyncFilterManager | +
+ Represents a filter manager for asynchronous packets.
+ |
+
AsyncListenerHandler | +
+ Represents a handler for an asynchronous event.
+ |
+
AsyncMarker | +
+ Contains information about the packet that is being processed by asynchronous listeners.
+ |
+
Package | +Description | +
---|---|
com.comphenix.protocol | ++ |
com.comphenix.protocol.async | ++ |
com.comphenix.protocol.events | ++ |
Class and Description | +
---|
AsyncListenerHandler
+ Represents a handler for an asynchronous event.
+ |
+
Class and Description | +
---|
AsyncFilterManager
+ Represents a filter manager for asynchronous packets.
+ |
+
AsyncListenerHandler
+ Represents a handler for an asynchronous event.
+ |
+
AsyncMarker
+ Contains information about the packet that is being processed by asynchronous listeners.
+ |
+
Class and Description | +
---|
AsyncMarker
+ Contains information about the packet that is being processed by asynchronous listeners.
+ |
+
Package | +Description | +
---|---|
com.comphenix.protocol | ++ |
com.comphenix.protocol.async | ++ |
com.comphenix.protocol.injector | ++ |
Modifier and Type | +Method and Description | +
---|---|
AsynchronousManager |
+ProtocolManager.getAsynchronousManager()
+Retrieve the current asyncronous packet manager.
+ |
+
Modifier and Type | +Class and Description | +
---|---|
class |
+AsyncFilterManager
+Represents a filter manager for asynchronous packets.
+ |
+
Modifier and Type | +Method and Description | +
---|---|
AsynchronousManager |
+PacketFilterManager.getAsynchronousManager() |
+
Package | +Description | +
---|---|
com.comphenix.protocol | ++ |
com.comphenix.protocol.async | ++ |
com.comphenix.protocol.injector | ++ |
Modifier and Type | +Interface and Description | +
---|---|
interface |
+ProtocolManager
+Represents an API for accessing the Minecraft protocol.
+ |
+
Modifier and Type | +Method and Description | +
---|---|
PacketStream |
+AsynchronousManager.getPacketStream()
+Retrieve the default packet stream.
+ |
+
Modifier and Type | +Method and Description | +
---|---|
PacketStream |
+AsyncMarker.getPacketStream()
+Retrieve the packet stream responsible for transmitting this packet.
+ |
+
PacketStream |
+AsyncFilterManager.getPacketStream() |
+
Modifier and Type | +Method and Description | +
---|---|
void |
+AsyncMarker.setPacketStream(PacketStream packetStream)
+Sets the output packet stream responsible for transmitting this packet.
+ |
+
Modifier and Type | +Class and Description | +
---|---|
class |
+PacketFilterManager |
+
public abstract class AbstractConcurrentListenerMultimap<TListener>
+extends java.lang.Object
+Constructor and Description | +
---|
AbstractConcurrentListenerMultimap() |
+
Modifier and Type | +Method and Description | +
---|---|
void |
+addListener(TListener listener,
+ ListeningWhitelist whitelist)
+Adds a listener to its requested list of packet recievers.
+ |
+
protected void |
+clearListeners()
+Remove all packet listeners.
+ |
+
java.util.Collection<PrioritizedListener<TListener>> |
+getListener(int packetID)
+Retrieve the registered listeners, in order from the lowest to the highest priority.
+ |
+
java.util.Set<java.lang.Integer> |
+keySet()
+Retrieve every registered packet ID:
+ |
+
java.util.List<java.lang.Integer> |
+removeListener(TListener listener,
+ ListeningWhitelist whitelist)
+Removes the given listener from the packet event list.
+ |
+
java.lang.Iterable<PrioritizedListener<TListener>> |
+values()
+Retrieve every listener.
+ |
+
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public AbstractConcurrentListenerMultimap()+
public void addListener(TListener listener, + ListeningWhitelist whitelist)+
listener
- - listener with a list of packets to recieve notifcations for.whitelist
- - the packet whitelist to use.public java.util.List<java.lang.Integer> removeListener(TListener listener, + ListeningWhitelist whitelist)+
listener
- - listener to remove.whitelist
- - the packet whitelist that was used.public java.util.Collection<PrioritizedListener<TListener>> getListener(int packetID)+
+ The returned list is thread-safe and doesn't require synchronization.
packetID
- - packet ID.public java.lang.Iterable<PrioritizedListener<TListener>> values()+
public java.util.Set<java.lang.Integer> keySet()+
protected void clearListeners()+
public class NetworkServerInjector
+extends java.lang.Object
+Modifier and Type | +Field and Description | +
---|---|
protected java.io.DataInputStream |
+cachedInput |
+
protected boolean |
+hasInitialized |
+
protected static java.lang.reflect.Field |
+inputField |
+
protected PacketFilterManager |
+manager |
+
protected java.lang.Object |
+netHandler |
+
protected static java.lang.reflect.Field |
+netHandlerField |
+
protected java.lang.Object |
+networkManager |
+
protected static java.lang.reflect.Field |
+networkManagerField |
+
protected VolatileField |
+networkManagerRef |
+
protected static StructureModifier<java.lang.Object> |
+networkModifier |
+
protected org.bukkit.entity.Player |
+player |
+
protected static java.lang.reflect.Method |
+processMethod |
+
protected static java.lang.reflect.Method |
+queueMethod |
+
protected java.util.Set<java.lang.Integer> |
+sendingFilters |
+
protected java.lang.Object |
+serverHandler |
+
protected static java.lang.reflect.Field |
+serverHandlerField |
+
protected VolatileField |
+serverHandlerRef |
+
Constructor and Description | +
---|
NetworkServerInjector(org.bukkit.entity.Player player,
+ PacketFilterManager manager,
+ java.util.Set<java.lang.Integer> sendingFilters,
+ com.comphenix.protocol.injector.InjectedServerConnection serverInjection) |
+
Modifier and Type | +Method and Description | +
---|---|
void |
+checkListener(PacketListener listener)
+Invoked before a new listener is registered.
+ |
+
void |
+cleanupAll()
+Remove all hooks and modifications.
+ |
+
protected net.minecraft.server.EntityPlayer |
+getEntityPlayer()
+Retrieve the notch (NMS) entity player object.
+ |
+
java.io.DataInputStream |
+getInputStream(boolean cache)
+Retrieve the current player's input stream.
+ |
+
protected java.lang.Object |
+getNetHandler()
+Retrieves the current net handler for this player.
+ |
+
protected void |
+initialize() |
+
void |
+injectManager()
+Inject a hook to catch packets sent to the current player.
+ |
+
void |
+processPacket(net.minecraft.server.Packet packet)
+Processes the given packet as if it was transmitted by the current player.
+ |
+
void |
+sendServerPacket(net.minecraft.server.Packet packet,
+ boolean filtered)
+Send a packet to the client.
+ |
+
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
protected static java.lang.reflect.Field serverHandlerField+
protected static java.lang.reflect.Field networkManagerField+
protected static java.lang.reflect.Field inputField+
protected static java.lang.reflect.Field netHandlerField+
protected static StructureModifier<java.lang.Object> networkModifier+
protected static java.lang.reflect.Method queueMethod+
protected static java.lang.reflect.Method processMethod+
protected org.bukkit.entity.Player player+
protected boolean hasInitialized+
protected VolatileField networkManagerRef+
protected VolatileField serverHandlerRef+
protected java.lang.Object networkManager+
protected java.lang.Object serverHandler+
protected java.lang.Object netHandler+
protected PacketFilterManager manager+
protected java.util.Set<java.lang.Integer> sendingFilters+
protected java.io.DataInputStream cachedInput+
public NetworkServerInjector(org.bukkit.entity.Player player, + PacketFilterManager manager, + java.util.Set<java.lang.Integer> sendingFilters, + com.comphenix.protocol.injector.InjectedServerConnection serverInjection) + throws java.lang.IllegalAccessException+
java.lang.IllegalAccessException
protected void initialize() + throws java.lang.IllegalAccessException+
java.lang.IllegalAccessException
public void sendServerPacket(net.minecraft.server.Packet packet, + boolean filtered) + throws java.lang.reflect.InvocationTargetException+
packet
- - server packet to send.filtered
- - whether or not the packet will be filtered by our listeners.java.lang.reflect.InvocationTargetException
public void injectManager()+
public void cleanupAll()+
public void checkListener(PacketListener listener)+
+ The player injector should throw an exception if this listener cannot be properly supplied with packet events.
listener
- - the listener that is about to be registered.protected net.minecraft.server.EntityPlayer getEntityPlayer()+
protected java.lang.Object getNetHandler() + throws java.lang.IllegalAccessException+
java.lang.IllegalAccessException
- Unable to find or retrieve net handler.public void processPacket(net.minecraft.server.Packet packet) + throws java.lang.IllegalAccessException, + java.lang.reflect.InvocationTargetException+
packet
- - packet to process.java.lang.IllegalAccessException
- If the reflection machinery failed.java.lang.reflect.InvocationTargetException
- If the underlying method caused an error.public java.io.DataInputStream getInputStream(boolean cache)+
cache
- - whether or not to cache the result of this method.public class PrioritizedListener<TListener> +extends java.lang.Object +implements java.lang.Comparable<PrioritizedListener<TListener>>+
Constructor and Description | +
---|
PrioritizedListener(TListener listener,
+ ListenerPriority priority) |
+
Modifier and Type | +Method and Description | +
---|---|
int |
+compareTo(PrioritizedListener<TListener> other) |
+
boolean |
+equals(java.lang.Object obj) |
+
TListener |
+getListener()
+Retrieve the underlying listener.
+ |
+
ListenerPriority |
+getPriority()
+Retrieve the priority of this listener.
+ |
+
int |
+hashCode() |
+
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
public PrioritizedListener(TListener listener, + ListenerPriority priority)+
public int compareTo(PrioritizedListener<TListener> other)+
compareTo
in interface java.lang.Comparable<PrioritizedListener<TListener>>
public boolean equals(java.lang.Object obj)+
equals
in class java.lang.Object
public int hashCode()+
hashCode
in class java.lang.Object
public TListener getListener()+
public ListenerPriority getPriority()+
Package | +Description | +
---|---|
com.comphenix.protocol.async | ++ |
com.comphenix.protocol.concurrency | ++ |
com.comphenix.protocol.injector | ++ |
Modifier and Type | +Method and Description | +
---|---|
java.util.Iterator<PrioritizedListener<AsyncListenerHandler>> |
+AsyncMarker.getListenerTraversal()
+Retrieve iterator for the next listener in line.
+ |
+
Modifier and Type | +Method and Description | +
---|---|
java.util.Collection<PrioritizedListener<TListener>> |
+AbstractConcurrentListenerMultimap.getListener(int packetID)
+Retrieve the registered listeners, in order from the lowest to the highest priority.
+ |
+
java.lang.Iterable<PrioritizedListener<TListener>> |
+AbstractConcurrentListenerMultimap.values()
+Retrieve every listener.
+ |
+
Modifier and Type | +Method and Description | +
---|---|
int |
+PrioritizedListener.compareTo(PrioritizedListener<TListener> other) |
+
public class BackgroundCompiler
+extends java.lang.Object
++ This is necessary as we cannot block the main thread.
Modifier and Type | +Field and Description | +
---|---|
static int |
+SHUTDOWN_DELAY_MS |
+
Constructor and Description | +
---|
BackgroundCompiler(java.lang.ClassLoader loader)
+Initialize a background compiler.
+ |
+
BackgroundCompiler(java.lang.ClassLoader loader,
+ java.util.concurrent.ExecutorService executor)
+Initialize a background compiler utilizing the given thread pool.
+ |
+
Modifier and Type | +Method and Description | +
---|---|
StructureCompiler |
+getCompiler()
+Retrieve the current structure compiler.
+ |
+
static BackgroundCompiler |
+getInstance()
+Retrieves the current background compiler.
+ |
+
boolean |
+isEnabled()
+Retrieve whether or not the background compiler is enabled.
+ |
+
void |
+scheduleCompilation(java.util.Map<java.lang.Class,StructureModifier> cache,
+ java.lang.Class key)
+Ensure that the indirectly given structure modifier is eventually compiled.
+ |
+
<TKey> void |
+scheduleCompilation(StructureModifier<TKey> uncompiled,
+ CompileListener<TKey> listener)
+Ensure that the given structure modifier is eventually compiled.
+ |
+
void |
+setEnabled(boolean enabled)
+Sets whether or not the background compiler is enabled.
+ |
+
static void |
+setInstance(BackgroundCompiler backgroundCompiler)
+Sets the single background compiler we're using.
+ |
+
void |
+shutdownAll()
+Clean up after ourselves using the default timeout.
+ |
+
void |
+shutdownAll(long timeout,
+ java.util.concurrent.TimeUnit unit)
+Clean up after ourselves.
+ |
+
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public static final int SHUTDOWN_DELAY_MS+
public BackgroundCompiler(java.lang.ClassLoader loader)+
loader
- - class loader from Bukkit.public BackgroundCompiler(java.lang.ClassLoader loader, + java.util.concurrent.ExecutorService executor)+
loader
- - class loader from Bukkit.executor
- - thread pool we'll use.public static BackgroundCompiler getInstance()+
public static void setInstance(BackgroundCompiler backgroundCompiler)+
backgroundCompiler
- - current background compiler, or NULL if the library is not loaded.public void scheduleCompilation(java.util.Map<java.lang.Class,StructureModifier> cache, + java.lang.Class key)+
cache
- - store of structure modifiers.key
- - key of the structure modifier to compile.public <TKey> void scheduleCompilation(StructureModifier<TKey> uncompiled, + CompileListener<TKey> listener)+
uncompiled
- - structure modifier to compile.listener
- - listener responsible for responding to the compilation.public void shutdownAll()+
public void shutdownAll(long timeout, + java.util.concurrent.TimeUnit unit)+
timeout
- - the maximum time to wait.unit
- - the time unit of the timeout argument.public boolean isEnabled()+
public void setEnabled(boolean enabled)+
enabled
- - TRUE to enable it, FALSE otherwise.public StructureCompiler getCompiler()+
TKey
- - type of the structure modifier field.public interface CompileListener<TKey>
+Modifier and Type | +Method and Description | +
---|---|
void |
+onCompiled(StructureModifier<TKey> compiledModifier)
+Invoked when a structure modifier has been successfully compiled.
+ |
+
void onCompiled(StructureModifier<TKey> compiledModifier)+
compiledModifier
- - the compiled structure modifier.TField
- Field type.public abstract class CompiledStructureModifier<TField> +extends StructureModifier<TField>+
Modifier and Type | +Field and Description | +
---|---|
protected StructureCompiler |
+compiler |
+
converter, customConvertHandling, data, defaultFields, fieldType, subtypeCache, target, targetType
Constructor and Description | +
---|
CompiledStructureModifier() |
+
Modifier and Type | +Method and Description | +
---|---|
TField |
+read(int fieldIndex)
+Reads the value of a field given its index.
+ |
+
protected abstract java.lang.Object |
+readGenerated(int fieldIndex) |
+
StructureModifier<TField> |
+withTarget(java.lang.Object target)
+Retrieves a structure modifier of the same type for a different object target.
+ |
+
StructureModifier<TField> |
+write(int index,
+ java.lang.Object value)
+Writes the value of a field given its index.
+ |
+
StructureModifier<TField> |
+writeDefaults()
+Sets all non-primitive fields to a more fitting default value.
+ |
+
protected abstract StructureModifier<TField> |
+writeGenerated(int index,
+ java.lang.Object value) |
+
getFields, getFieldType, getTarget, getTargetType, getValues, initialize, initialize, modify, readSafely, setConverter, size, withFieldType, withType, withType, writeSafely
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
protected StructureCompiler compiler+
public CompiledStructureModifier()+
public StructureModifier<TField> writeDefaults() + throws FieldAccessException+
StructureModifier
DefaultInstances.getDefault(Class)
.writeDefaults
in class StructureModifier<TField>
FieldAccessException
- If we're unable to write to the fields due to a security limitation.public final TField read(int fieldIndex) + throws FieldAccessException+
StructureModifier
read
in class StructureModifier<TField>
fieldIndex
- - index of the field.FieldAccessException
- The field doesn't exist, or it cannot be accessed under the current security contraints.protected abstract java.lang.Object readGenerated(int fieldIndex) + throws FieldAccessException+
FieldAccessException
public StructureModifier<TField> write(int index, + java.lang.Object value) + throws FieldAccessException+
StructureModifier
write
in class StructureModifier<TField>
index
- - index of the field.value
- - new value of the field.FieldAccessException
- The field doesn't exist, or it cannot be accessed under the current security contraints.protected abstract StructureModifier<TField> writeGenerated(int index, + java.lang.Object value) + throws FieldAccessException+
FieldAccessException
public StructureModifier<TField> withTarget(java.lang.Object target)+
StructureModifier
withTarget
in class StructureModifier<TField>
target
- - different target of the same type.public final class StructureCompiler
+extends java.lang.Object
+Modifier and Type | +Method and Description | +
---|---|
<TField> StructureModifier<TField> |
+compile(StructureModifier<TField> source)
+Compiles the given structure modifier.
+ |
+
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public <TField> StructureModifier<TField> compile(StructureModifier<TField> source)+
+ WARNING: Do NOT call this method in the main thread. Compiling may easily take 10 ms, which is already + over 1/4 of a tick (50 ms). Let the background thread automatically compile the structure modifiers instead.
source
- - structure modifier to compile.Package | +Description | +
---|---|
com.comphenix.protocol.reflect.compiler | ++ |
Modifier and Type | +Method and Description | +
---|---|
static BackgroundCompiler |
+BackgroundCompiler.getInstance()
+Retrieves the current background compiler.
+ |
+
Modifier and Type | +Method and Description | +
---|---|
static void |
+BackgroundCompiler.setInstance(BackgroundCompiler backgroundCompiler)
+Sets the single background compiler we're using.
+ |
+
Package | +Description | +
---|---|
com.comphenix.protocol.reflect.compiler | ++ |
Modifier and Type | +Method and Description | +
---|---|
<TKey> void |
+BackgroundCompiler.scheduleCompilation(StructureModifier<TKey> uncompiled,
+ CompileListener<TKey> listener)
+Ensure that the given structure modifier is eventually compiled.
+ |
+
Package | +Description | +
---|---|
com.comphenix.protocol.reflect.compiler | ++ |
Modifier and Type | +Field and Description | +
---|---|
protected StructureCompiler |
+CompiledStructureModifier.compiler |
+
Modifier and Type | +Method and Description | +
---|---|
StructureCompiler |
+BackgroundCompiler.getCompiler()
+Retrieve the current structure compiler.
+ |
+
Interface | +Description | +
---|---|
CompileListener<TKey> | +
+ Used to save the result of an compilation.
+ |
+
Class | +Description | +
---|---|
BackgroundCompiler | +
+ Compiles structure modifiers on a background thread.
+ |
+
CompiledStructureModifier<TField> | +
+ Represents a compiled structure modifier.
+ |
+
StructureCompiler | +
+ Represents a StructureModifier compiler.
+ |
+
Package | +Description | +
---|---|
com.comphenix.protocol.reflect.compiler | ++ |
Class and Description | +
---|
BackgroundCompiler
+ Compiles structure modifiers on a background thread.
+ |
+
CompileListener
+ Used to save the result of an compilation.
+ |
+
StructureCompiler
+ Represents a StructureModifier compiler.
+ |
+
public class ExistingGenerator +extends java.lang.Object +implements InstanceProvider+
+ Only one instance per individual class.
Modifier and Type | +Method and Description | +
---|---|
java.lang.Object |
+create(java.lang.Class<?> type)
+Create an instance given a type, if possible.
+ |
+
static ExistingGenerator |
+fromObjectArray(java.lang.Object[] values)
+Create an instance generator from a pre-defined array of values.
+ |
+
static ExistingGenerator |
+fromObjectFields(java.lang.Object object)
+Automatically create an instance provider from a objects public and private fields.
+ |
+
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public static ExistingGenerator fromObjectFields(java.lang.Object object)+
+ If two or more fields share the same type, the last declared non-null field will take + precedent.
object
- - object to create an instance generator from.public static ExistingGenerator fromObjectArray(java.lang.Object[] values)+
values
- - values to provide.public java.lang.Object create(@Nullable + java.lang.Class<?> type)+
InstanceProvider
create
in interface InstanceProvider
type
- - type to create.Package | +Description | +
---|---|
com.comphenix.protocol.reflect.instances | ++ |
Modifier and Type | +Method and Description | +
---|---|
static ExistingGenerator |
+ExistingGenerator.fromObjectArray(java.lang.Object[] values)
+Create an instance generator from a pre-defined array of values.
+ |
+
static ExistingGenerator |
+ExistingGenerator.fromObjectFields(java.lang.Object object)
+Automatically create an instance provider from a objects public and private fields.
+ |
+