Commit Graph

1051 Commits

Author SHA1 Message Date
Dan Mulloy
ac05781111 Update .gitignore 2014-11-15 13:06:34 -05:00
Dan Mulloy
cfb5944990 Update to 1.7.10, update readme, organize imports 2014-11-15 13:02:03 -05:00
Kristian S. Stangeland
d8181b7bf3 Use the correct sender instance. 2014-09-24 01:00:02 +02:00
Kristian S. Stangeland
25cb648cfa Prevent plugins from sending a packet in the wrong direcetion. 2014-09-18 21:56:32 +02:00
Kristian S. Stangeland
78b6a651dc Add a way to skip the plugin verifier. 2014-09-07 21:28:01 +02:00
Kristian S. Stangeland
f0fd904396 Adding support for retrieving the protocol version. 2014-09-05 02:00:39 +02:00
Kristian S. Stangeland
b901f029d2 [TinyProtocol] Adding to Maven repository under version 0.1.0 2014-08-22 14:32:03 +02:00
Kristian S. Stangeland
b68579bcb7 Switch to yellow instead of blue, as its more readable in console. 2014-08-05 03:52:37 +02:00
Kristian S. Stangeland
c443fc3da6 Execute onPacketSending() on the main thread for monitor listeners.
A special-case occurs when a plugin sends a packet to a client 
with filters set to FALSE (that is, bypassing most packet listeners) - 
a new packet event is constructed solely for all MONITOR listeners, as
they are informed regardless of the value of FILTER.

Unfortunately, the sending method may be invoked on a thread other 
than the main thread, which will invoke onPacketSending() 
asynchronously. This violate the assumed thread affinity of 
onPacketSending(), so we will now schedule the packet sending on 
the main thread to correct this - but only if there are monitor
listeners, and they have not specified ListenerOptions.ASYNC (which 
means onPacketSending() is thread safe).
2014-08-02 23:39:29 +02:00
Kristian S. Stangeland
b3cda21fe5 Correct the WrappedGameProfile unit test. 2014-07-30 03:49:37 +02:00
Kristian S. Stangeland
4bd9a1f01e Warn plugins that never call start/syncStart on AsyncListenerHandler.
This is almost always incorrect as it will simply block the 
transmission or reception of every packet of a given type.
2014-07-28 01:16:23 +02:00
Kristian S. Stangeland
ba88d292c0 Last commit added to the API. Incrementing minor version to 3.5.0 2014-07-26 17:29:35 +02:00
Kristian S. Stangeland
f378b7bbd9 Added support for closing asynchronous listeners by packet listener. 2014-07-26 17:28:05 +02:00
Kristian S. Stangeland
d717ff1586 Hack for WrappedSignedProperty on Cauldron 1.7.10. FIXES #54 2014-07-23 03:28:12 +02:00
Kristian S. Stangeland
4ccd8853c4 Allow any string in WrappedGameProfile(String, String).
We now accept any string in this constructor, to preserve 
backwards compatibility. But, we depreciate its use, as 
WrappedGameProfile(UUID, String) can be used in every Minecraft
version that supports a game profile.

There's also a new warning system that will identify the plugin 
that is using the depreciated method, and print its name to the 
console (at most once every hour).
2014-07-14 04:54:44 +02:00
Kristian S. Stangeland
09e45977f2 Added support for Guava 11 (and later) in Spigot #1506-1508.
Note that build #1509 reverted to Guava 10, so this is merely a 
future proof.
2014-06-27 11:57:34 +02:00
Kristian S. Stangeland
7e5abecfe2 Increment to 3.4.1-SNAPSHOT 2014-06-27 11:37:05 +02:00
Kristian S. Stangeland
aaecb08892 Added MassiveCore to the list of plugins exluded from the verifier. 2014-06-23 02:50:47 +02:00
Kristian S. Stangeland
0375ad5391 [TinyProtocol] Fix NULL player in the packet interception methods. 2014-06-19 15:28:27 +02:00
Kristian S. Stangeland
0c940711ac Increment version to 3.4.0. 2014-06-16 00:29:59 +02:00
Kristian S. Stangeland
c50bc55f77 Improve JavaDoc documentation of WrappedGameProfile. 2014-06-12 21:16:31 +02:00
Kristian S. Stangeland
ce216d0371 Add a way to retrieve the underlying UUID in WrappedGameProfile. 2014-06-11 21:05:08 +02:00
Kristian S. Stangeland
5b21f4d61c Don't cache equivalent converters in StructureModifier.
This should hopefully fix a memory leak discovered by Stevenpcc 
(thanks).
2014-06-10 23:01:24 +02:00
Kristian S. Stangeland
1141c0ba71 Ignore NuSuchElementExceptions when removing channel handlers. 2014-05-21 23:04:29 +02:00
Kristian S. Stangeland
8067799306 Merge pull request #48 from glen3b/patch-1
Minor improvements to ClassLoader
2014-05-18 12:30:52 +02:00
Glen Husman
1ee68d4e09 attemptLoadFrom will throw IllegalArgumentException for arrays of length
1 with a null element
2014-05-17 20:00:40 -07:00
Kristian S. Stangeland
82be6bfecc May solve a race condition in ticket 220 on BukkitDev.
It is possible, though not confirmed, that ProtocolLib has not been
fully cleaned up after a "reload" command and the next instance of 
ProtocolLib is loaded. In that case, it may be possible that a channel
is injected in the main thread while its cleanup procedure is still
running.

This is an attempt to solve this problem. Though, it is not confirmed
to work.
2014-05-17 23:01:27 +02:00
Glen Husman
0f5be7f1f1 Add ClassSource.empty, ClassSource.attemptLoadFrom will also not
tolerate nulls
2014-05-17 12:23:59 -07:00
Kristian S. Stangeland
b272322105 Fix a bug preventing ClassSource.retry() from working correctly.
We returned the class of the other ClassSource, instead of invoking
its loadClass() method.
2014-05-17 17:29:37 +02:00
Kristian S. Stangeland
bbaea894d4 Merge pull request #49 from glen3b/patch-2
Update sample code in readme
2014-05-17 17:13:38 +02:00
Kristian S. Stangeland
d3e37df343 Added the ability to toggle whether or not a given player is injected.
We also ensure we can run multiple instances of TinyProtocol without
requiring implementers to override getHandlerName(). 

Also fixed a potential memory leak, as the channel map was set to 
weakKeys() instead of the correct weakValues().
2014-05-17 17:10:17 +02:00
glen3b
b2425dcc6b Update sample code in readme
The current sample code uses the magic packet IDs, which are deprecated in the current version of the library. This commit changes the sample code to use the non-deprecated enum-like packet identifiers, the sample code which is present on the BukkitDev page for this plugin (with some minor tweaks).
2014-05-14 21:30:40 -07:00
Glen Husman
95087a5b9f attemptLoadFrom now ignores null values properly 2014-05-14 16:51:56 -07:00
Glen Husman
e0449b2db6 Add ClassSource.attemptLoadFrom method
This method is an alternative to chaining retry calls
2014-05-14 16:40:22 -07:00
Glen Husman
324e6de284 Document new fromMap behavior 2014-05-14 16:26:51 -07:00
glen3b
ccecdf216f Throw ClassNotFoundException when appropriate
Currently, the ClassSource returned by ClassSource.fromMap will return null if the Class cannot be found (as that is the behavior of maps). However, other ClassSources throw a ClassNotFoundException if the class cannot be loaded. This commit changes the behavior of ClassSource.fromMap to throw a ClassNotFoundException if the class was not found in the map (or was mapped to null). This commit also changes the method to interpret a null map as an empty map.
2014-05-14 16:06:26 -07:00
Kristian S. Stangeland
818ac5cbde Correct a bug that would lead to IllegalStateException in plugins.
This was caused by the fact that "requireInputBuffer" used 
findLegacy(int) to get the correct PacketType, instead of 
findLegacy(int, Sender.CLIENT). The latter is justified by the fact 
that only client-side packets require an input buffer.
2014-05-11 15:33:15 +02:00
Kristian S. Stangeland
d415bd7643 Workaround for ServerConnection not being constructed yet. 2014-05-11 14:26:12 +02:00
Kristian S. Stangeland
180caed6b9 Allow users to construct signed property instances. 2014-05-10 03:47:45 +02:00
Kristian S. Stangeland
a6dfa60d79 Merge pull request #47 from glen3b/patch-1
Update MinecraftReflection exception messages
2014-05-03 19:25:35 +02:00
Kristian S. Stangeland
8a2e696363 Adding partial support for MCPC-Plus 1.7.2.
This doesn't include handling the different package names of 
net.minecraft.util.io.netty in MCPC.
2014-05-03 19:13:20 +02:00
glen3b
0c9f5e8992 Update MinecraftReflection exception messages
The messages incorrectly identified the minecraft server package as "net.mineraft.server"
This commit fixes that
Although it is only a minor spelling error, it is worth fixing
2014-05-02 19:44:33 -07:00
Kristian S. Stangeland
71ce362c8e Add support for reading and writing tile entities. 2014-05-03 02:52:03 +02:00
Kristian S. Stangeland
f9cd2b3db4 Fix JavaDoc of a copy-paste error. 2014-05-02 17:17:01 +02:00
Kristian S. Stangeland
2244f986bb Print a hex dump in the case of very large arrays. 2014-05-02 03:50:40 +02:00
Kristian S. Stangeland
d8e8a88076 Add the "compare" flag to the "packet add" command.
This instructs ProtocolLib to fetch the original state of the packet, 
before its processed by any packet listeners above LOWEST. Then, 
it displays this state in the console, along with the final state as 
retrieved in MONITOR.
2014-05-01 20:14:03 +02:00
Kristian S. Stangeland
1ef602416d Added the ability to schedule packets after an event has succeeded.
Also fixes post listeners and asynchronous packet listeners.
2014-04-26 00:21:05 +02:00
Kristian S. Stangeland
f7c4fd4ec9 Added support for "post packet events".
NetworkMarker now contains a list of post listeners that are invoked 
(in no particular order) when a packet has been serialize and sent
to a player, OR, when it has been enqueued for processing by the 
server.

This works for both 1.7.2+ (Netty) and 1.6.4 and earlier, though the
1.6.4 version has a good deal more overhead.
2014-04-25 02:55:17 +02:00
Kristian S. Stangeland
5185442f35 Added support for retrieving the signed property map of a profile.
In addition, we also allow WrappedGameProfile to be retrieved from a
player.
2014-04-21 15:51:38 +02:00
Kristian S. Stangeland
ce8d115b5a Incrementing to 3.4.0-SNAPSHOT 2014-04-21 15:50:54 +02:00