Kristian S. Stangeland
8bd7f75a6d
Updating POM to use Sonatype Nexus OSS.
2012-10-11 22:30:46 +02:00
Kristian S. Stangeland
ff0cd06b2e
[maven-release-plugin] prepare release ProtocolLib-1.3.1
2012-10-11 08:03:59 +02:00
Kristian S. Stangeland
97a22a0f6d
Revert to SNAPSHOT due to buggy maven.
2012-10-11 08:03:45 +02:00
Kristian S. Stangeland
5a8847a719
Updated POM to use my personal maven repo.
2012-10-11 08:00:00 +02:00
Kristian S. Stangeland
707b4511ce
Add repository information to POM.
2012-10-11 02:56:45 +02:00
Kristian S. Stangeland
b4d0c4a36d
Prepare POM for possibly being on the public maven repository.
2012-10-11 02:17:45 +02:00
Kristian S. Stangeland
8d3c1de9b9
Adding GPL v2 license information to every file.
2012-10-10 22:18:11 +02:00
Kristian S. Stangeland
dc75f34e11
Add a warning message for lost packets.
2012-10-10 22:12:29 +02:00
Kristian S. Stangeland
5bda655f39
Switching to Maven instead of Ant.
2012-10-10 21:35:55 +02:00
Kristian S. Stangeland
4301dc6525
Add the ability to customize the worker threads.
2012-10-10 07:16:01 +02:00
Kristian S. Stangeland
17b7526fe9
Set the queued index before enqueuing, not after.
2012-10-10 06:00:42 +02:00
Kristian S. Stangeland
cf68d229b0
Honor the sending index when the packet has finished processing.
2012-10-10 05:42:45 +02:00
Kristian S. Stangeland
7ed0bc82dd
Make it possible for threads to delay packet transmission.
...
Threads can now increment a shared counter indicating that a packet
should not be transmitted after the default packet listener
processing. This can be useful if a packet listener needs information
from additional packets before it can complete.
Packet listeners that whish to use this method begin by calling
incrementPacketDelay(). It is then responsible for calling
signalPacketTransmission() when it's done waiting. All processing
on PacketEvents outside packet listeners must be synchronized
with getProcessingLock().
2012-10-10 04:41:07 +02:00
Kristian S. Stangeland
20792aa09a
Reorder injection hooks.
...
We put the network manager hook to the bottom as it's the least
likely version to be compatible with other plugins.
2012-10-10 02:50:27 +02:00
Kristian S. Stangeland
eb328c41e8
Increase the player listener to MONITOR.
2012-10-10 02:48:24 +02:00
Kristian S. Stangeland
6053b9e64b
Added the ability to determine if any client or server packet is valid.
...
Also, added a warning when a plugin attempts to listen for a packet
ID that doesn't exist in the current Minecraft version.
2012-10-10 02:41:34 +02:00
Kristian S. Stangeland
f8bd36bf3c
Added the ability to enumerate IntEnums.
2012-10-09 22:37:33 +02:00
Kristian S. Stangeland
cecab6a169
Unwrap collections in the packet constructor.
2012-10-09 17:41:37 +02:00
Kristian S. Stangeland
2b90acf53e
Ensure that non-CraftBukkit item stacks are correctly converted.
2012-10-09 16:48:55 +02:00
Kristian S. Stangeland
5e36547aa2
Give automatically created worker threads sensible names.
2012-10-09 00:07:40 +02:00
Kristian S. Stangeland
12eab67db7
Fixed JavaDoc.
2012-10-05 04:43:41 +02:00
Kristian S. Stangeland
88da4e3272
Bumping to version 1.3.0
2012-10-05 03:50:28 +02:00
Kristian S. Stangeland
0e76d8ea2b
Make the proxy creation even more flexible.
...
Now we even support Orebfuscator without using Spout.
2012-10-05 03:12:35 +02:00
Kristian S. Stangeland
18ef06ea21
Adding "support" for Spout by proxying it's NetServerHandler.
...
While it may seem better to use a Spout PacketListener, we can't
prevent other spout listeners from stopping the listener
chain. For instance, Orebfuscator does supports Spout, but does this
by cancelling every chunk packet and sending them to be processed and
sent by Orebfuscator only. This can never be made compatible with
other plugins.
So, we choose to add some overhead and inject our proxy onto Spout.
Fortunately, Spout injects the proxy using a player listener on LOWEST,
so we get to override Spout again with our HIGHEST. The proxy method
should be generic enough to handle most proxy types.
2012-10-05 01:41:17 +02:00
Kristian S. Stangeland
af3e278e06
Moved all player related injection methods into a separate package.
...
This should make the code a little bit clearer.
2012-10-04 21:56:39 +02:00
Kristian S. Stangeland
eb12808483
Prevent method #3 from creating uneeded proxy objects.
...
This would happen if the NetServerHandler is already a proxy, and
the injection method is unable to create an instance of the proxy
type.
It's best to fail instead of polluting (due to constructors with
side-effects) Minecraft with failed proxy objects.
2012-10-04 17:43:46 +02:00
Kristian S. Stangeland
f0651f7170
Don't blow up the fallback method just because a plugin isn't
...
compatible.
2012-10-04 09:01:33 +02:00
Kristian S. Stangeland
debf8c4d88
Create the worker ID before it is run.
...
In addition, we'll prevent reuse of worker objects.
2012-10-04 06:23:27 +02:00
Kristian S. Stangeland
af2d692c59
Wait and notify on the correct lock.
2012-10-04 06:13:19 +02:00
Kristian S. Stangeland
db8db1fba1
Make it possible to identify the current worker.
2012-10-04 05:14:17 +02:00
Kristian S. Stangeland
e729583d74
Make the manual asynchronous worker closable.
...
Added a good deal of synchronization to deal with closing a
specific worker. This overhead can be avoided by simply closing
any given worker.
2012-10-04 03:20:09 +02:00
Kristian S. Stangeland
8a5e5e849b
Attempt to work around existing injected proxies.
...
This didn't work for Orebfuscator though.
2012-10-04 00:58:05 +02:00
Kristian S. Stangeland
558eab2253
Use an atomic integer instead of a volatile field.
...
Incrementing and decrementing is not thread-safe on volatile variables.
2012-10-03 23:13:05 +02:00
Kristian S. Stangeland
c6fb01e1e1
Adding the ability to use multiple worker threads.
2012-10-03 23:10:35 +02:00
Kristian S. Stangeland
eb8ac33a3e
Removed uncompleted code.
2012-10-02 23:07:03 +02:00
Kristian S. Stangeland
3f1b5d49e9
Ignore offline players when sending overdue packets.
2012-10-02 23:05:31 +02:00
Kristian S. Stangeland
1e1875cbd8
Speed up the proxy object by using a NoOp filter.
2012-10-02 04:36:47 +02:00
Kristian S. Stangeland
48cedd20d4
Add some size methods.
2012-10-02 04:02:54 +02:00
Kristian S. Stangeland
e4e4581717
Bumping to 1.2.2
2012-10-02 03:55:07 +02:00
Kristian S. Stangeland
2fceaa803e
Fixed the "moved too quickly" error that would cause players to
...
fall out into the void on 1.3.2.
2012-10-02 03:54:50 +02:00
Kristian S. Stangeland
0470b2335c
Bumping to 1.2.1
2012-10-01 21:47:36 +02:00
Kristian S. Stangeland
fe55bb2e56
Processed packets is now sorted by the sending index.
2012-10-01 21:47:19 +02:00
Kristian S. Stangeland
7b35dd954c
Switching to the network server object.
2012-10-01 20:30:56 +02:00
Kristian S. Stangeland
f4f28023fa
Always create the NullPacketListener (unless otherwise stated).
...
This functions like a crude "counter" that automatically unregisters
the packet injectors when every asynchronous listener has been removed.
2012-10-01 06:04:31 +02:00
Kristian S. Stangeland
961b34da38
Update documentation (may still need some work).
2012-10-01 04:59:27 +02:00
Kristian S. Stangeland
c2b4b5fce3
Ensure that the compiled structures respect the converter field.
...
In addition, fixed a bug that prevented client listeners from
receiving any packets.
2012-10-01 02:17:13 +02:00
Kristian S. Stangeland
46d9a6e975
Ensure that the structure compiler is thread safe.
2012-10-01 00:57:14 +02:00
Kristian S. Stangeland
e6de9ae705
Remove debug line.
2012-10-01 00:16:34 +02:00
Kristian S. Stangeland
3ad24921d9
Ensure that hook method #3 receieves Packet0KeepAlive.
2012-10-01 00:16:06 +02:00
Kristian S. Stangeland
9770257a74
Bumping to 1.2.0
2012-09-30 04:49:54 +02:00
Kristian S. Stangeland
f312ce278e
Increase the maximum.
2012-09-30 04:44:57 +02:00
Kristian S. Stangeland
73005e032b
Forgot to release a semaphore lock.
2012-09-30 04:42:58 +02:00
Kristian S. Stangeland
e666d17dc2
Don't try to find the isAsyncPacket method over and over again.
2012-09-30 04:25:56 +02:00
Kristian S. Stangeland
6063f437fd
Another diffcult to track down bug.
2012-09-30 04:24:27 +02:00
Kristian S. Stangeland
1c41f83305
Fixed (probably) a problem reported by Milkywayz.
...
Relevant crash dump:
2012-09-30 03:39:26 +02:00
Kristian S. Stangeland
801bf81f15
Incredibly difficult bug to track down.
...
Forgot to remove the "override" flag on cancelled packets when
they're sent again.
2012-09-30 03:24:13 +02:00
Kristian S. Stangeland
0cff9d1243
Ensure that asynchronous listeners are run, even if they have no
...
accompanying synchronous listener.
2012-09-30 00:51:59 +02:00
Kristian S. Stangeland
c77103246e
Small bug fixes.
2012-09-30 00:25:04 +02:00
Kristian S. Stangeland
711990fa15
Simplify the act of creating an asynchronous listener.
2012-09-30 00:13:36 +02:00
Kristian S. Stangeland
63197bbbd5
Add the other cases where we need to know if we're on the main thread
...
or not.
2012-09-29 23:52:28 +02:00
Kristian S. Stangeland
8a26d047b2
Client packets are processed on the server, so they must be
...
synchronized with the main thread.
2012-09-29 23:48:09 +02:00
Kristian S. Stangeland
d58ff1c4c1
Properly clean up after async listeners.
2012-09-29 23:21:09 +02:00
Kristian S. Stangeland
15b33925c0
Fixed a couple of minor bugs.
2012-09-29 22:25:09 +02:00
Kristian S. Stangeland
721d92bd4f
Fixed a minor bug.
2012-09-29 22:20:21 +02:00
Kristian S. Stangeland
b3098bc6ad
Pull up the important methods in the asynchronous packet handler.
2012-09-29 22:18:19 +02:00
Kristian S. Stangeland
e86c3d3a6e
We have to keep the setAsyncMarker method.
2012-09-29 22:12:30 +02:00
Kristian S. Stangeland
65b5a0e8ec
We don't expect consumers to create asynchronous markers, so
...
don't allow them to set it in the packet event.
2012-09-29 21:42:16 +02:00
Kristian S. Stangeland
a6db5419c0
Detect packet timeout.
2012-09-29 21:29:12 +02:00
Kristian S. Stangeland
4f4202185c
Make it even clearer that the listener loop method should be
...
called from a separate thread.
2012-09-29 21:18:21 +02:00
Kristian S. Stangeland
025e97ca95
Renamed the ListenerToken in the code as well.
2012-09-29 20:34:29 +02:00
Kristian S. Stangeland
880520cd94
Renamed the ListenerToken into a AsyncListenerHandler.
2012-09-29 20:32:18 +02:00
Kristian S. Stangeland
fad6a0a99c
Connect the asynchronous listeners to the system.
2012-09-29 20:30:22 +02:00
Kristian S. Stangeland
81321383d5
Renamed the async marker. Added handling of close.
2012-09-29 19:33:22 +02:00
Kristian S. Stangeland
285952b14d
Use the normal packet listener instead of an async listener.
2012-09-29 19:13:12 +02:00
Kristian S. Stangeland
6f02e79802
Still a work in progress.
...
I'm considering removing the async listener and use the packet listener
for both sync and async processing.
2012-09-29 18:05:08 +02:00
Kristian S. Stangeland
23e676533a
Beginning to add support for asynchronous packet listeners.
2012-09-29 01:00:12 +02:00
Kristian S. Stangeland
2012698275
Just in case, try to load the generated class first.
...
We might have generated it from a previous run.
2012-09-27 06:04:29 +02:00
Kristian S. Stangeland
42303ae0fc
Use the FieldAccessException instead of InvalidArgumentException.
...
Otherwise, the CompiledStructureModifier has a leaky abstraction.
2012-09-27 05:42:34 +02:00
Kristian S. Stangeland
0004fb530d
Update the package name in the compiler.
2012-09-27 05:28:52 +02:00
Kristian S. Stangeland
ea823e58f7
Move structure modifier compiler to the reflect package.
2012-09-27 05:28:13 +02:00
Kristian S. Stangeland
8293c71a4c
Make sure the packet IDs are actually valid.
2012-09-27 05:26:02 +02:00
Kristian S. Stangeland
eb8abd4635
Try to clean up after a failed hook.
2012-09-27 05:22:08 +02:00
Kristian S. Stangeland
240df9dc7a
Complicated feature - auto-compilation of structure modifier.
...
Using ASM we can automatically generate a faster structure modifier
that doesn't use reflection to read or write public fields.
Note that because the compilation itself is a bit slow (10 ms++),
we have to create a background compilation thread. Future work:
* Disable the thread if it's idle after 60 seconds.
* Don't recreate the thread when the server reloads.
2012-09-27 03:24:34 +02:00
Kristian S. Stangeland
90970d1b9b
Ensure that server operators are informed about incompatibility.
2012-09-26 06:00:26 +02:00
Kristian S. Stangeland
9efb85e7c3
Handle 1.3 correctly.
2012-09-26 04:06:10 +02:00
Kristian S. Stangeland
22f2f45d1e
Added support for a hook method that can intercept map chunk packets.
2012-09-26 03:31:59 +02:00
Kristian S. Stangeland
e04a78fc04
Added yet another player hook method.
...
This method works by injecting into the NetServerHandler object
of a player. That way, we can also intercept map chunk packets.
2012-09-26 02:26:44 +02:00
Kristian S. Stangeland
9e402a3ab4
Added a "canInject" property in the injectors.
2012-09-26 02:01:44 +02:00
Kristian S. Stangeland
d8b300e3a6
Try to get the local player object if possible.
2012-09-25 23:10:08 +02:00
Kristian S. Stangeland
e0c03186c3
Add support for Java serialization of PacketEvent. It might be useful.
2012-09-25 23:09:02 +02:00
Kristian S. Stangeland
7f69c0204d
Added a bit of commentary.
2012-09-25 17:13:23 +02:00
Kristian S. Stangeland
8839c03948
Fixed a number of simple bugs discovered by FindBugs.
2012-09-20 18:35:45 +02:00
Kristian S. Stangeland
3899704774
Merge pull request #1 from mbax/mbax
...
TagAPI is compatible as of version 1.7
2012-09-19 11:00:18 -07:00
mbax
9ad6dcb41c
TagAPI is compatible as of version 1.7
2012-09-19 13:47:38 -04:00
Kristian S. Stangeland
54242debaa
Made structure modifiers more overridable.
2012-09-19 19:25:11 +02:00
Kristian S. Stangeland
bc7b395889
Adding desperately needed async/sync documentation.
2012-09-19 03:48:46 +02:00
Kristian S. Stangeland
77376a2fa3
Make the Bukkit unwrapper use the actual return type.
2012-09-18 18:37:11 +02:00
Kristian S. Stangeland
cd9fa1cdf6
Fixing documentation.
2012-09-18 17:20:48 +02:00
Kristian S. Stangeland
ad6fbae5d6
Incrementing to version 1.1.0
2012-09-18 17:17:20 +02:00
Kristian S. Stangeland
8f9939f65c
Added the ability to refresh the apperance of entities and players.
2012-09-18 16:30:46 +02:00
Kristian S. Stangeland
3783328cb1
Forgot to convert the types to NMS.
2012-09-18 02:16:11 +02:00
Kristian S. Stangeland
140edabb4e
Fixed packet constructor and tons of other bugs.
2012-09-18 02:04:26 +02:00
Kristian S. Stangeland
ffbaed283a
Improved the API slightly.
2012-09-18 00:01:02 +02:00
Kristian S. Stangeland
e5beca4ea5
And the PacketConstructor class itself.
2012-09-17 22:59:41 +02:00
Kristian S. Stangeland
fb15ee1b22
Adding packet constructors.
...
This should simplify a lot of code.
2012-09-17 22:59:20 +02:00
Kristian S. Stangeland
7a60c5aac7
Made the server registry static.
2012-09-17 16:40:08 +02:00
Kristian S. Stangeland
f74a6e9832
Made the packet ids static and thus usable in a switch statement.
2012-09-17 16:38:26 +02:00
Kristian S. Stangeland
381484fc5d
Adding a simple packet registry.
2012-09-17 16:21:15 +02:00
Kristian S. Stangeland
455ffca63f
Adding a entity structure modifier.
2012-09-17 01:34:10 +02:00
Kristian S. Stangeland
286e1159e9
Made certain classes private. No need to expose them to the API.
2012-09-16 03:18:58 +02:00
Kristian S. Stangeland
b299886b62
Fixed the old server listener.
2012-09-16 02:07:18 +02:00
Kristian S. Stangeland
913ff7eed1
Removed pointless imports.
2012-09-16 01:41:08 +02:00
Kristian S. Stangeland
d04a666bc5
Readded a lighter version of network object injector.
...
This version only supports CraftBukkit 1.3.0 and later.
2012-09-15 23:07:14 +02:00
Kristian S. Stangeland
bdfbfa47c8
The NetworkObjectInjector is too unstable, so we'll remove it.
2012-09-15 20:10:35 +02:00
Kristian S. Stangeland
57c720681a
Made the object injector somewhat workable.
2012-09-15 20:09:34 +02:00
Kristian S. Stangeland
7e28aefb75
Moved the instance generator to a separate package.
...
In addition, added a new injection method. It's still not
finalized, and may get removed in the end.
2012-09-15 19:12:59 +02:00
Kristian S. Stangeland
aa2dcefa0d
Added two different player injection hooks, for compatibility with
...
TagAPI.
2012-09-15 13:47:14 +02:00
Kristian S. Stangeland
616213924b
Refactored the SortedCopyOnWriteArray out into a separate package.
...
Made it extend the java.util.Collection interface.
2012-09-15 13:07:44 +02:00
Kristian S. Stangeland
fffa3881dd
We won't try to fix TagAPI. Instead, we'll warn the users.
2012-09-15 02:39:38 +02:00
Kristian S. Stangeland
85f7360109
Refactored the hacked array list out of the player injector.
2012-09-15 01:58:13 +02:00
Kristian S. Stangeland
f2effab907
Improved documentation in a few places.
2012-09-15 01:04:08 +02:00
Kristian S. Stangeland
4505e31965
Prevented concurrency issues.
...
The SortedCopyOnWriteArray didn't wrap the iterator() in a
unmodifiable iterator. In addition, ConcurrentListenerMultimap
incorrectly used the iterator to remove objects from this Array.
Added a "remove(T value)" method that is thread-safe.
2012-09-14 22:33:15 +02:00
Kristian S. Stangeland
88dcf0cb32
Improved API and performance.
...
API changes:
* The PacketListener now uses a "ListeningWhitelist" class
to report which packet ids it wishes to listen in on for
either the client or the server. This makes it possible to
use your plugin class as the listener more easily.
* Added a priority system similar to Bukkit events.
Performance changes:
* Create and maintain a separate list of listeners for each packet
ID. This uses slightly more memory, but is far more efficient.
Especially in light of the priority system.
In addition, the listener lists are (hopefully) concurrent. They're
optimized for read-access, however. Adding or removing a listener
is a O(n) operation.
2012-09-14 19:12:08 +02:00
Kristian S. Stangeland
bb8bec907c
Added a priorty to every listener. Improved performance.
2012-09-14 12:41:57 +02:00
Kristian S. Stangeland
45169905fe
Fix documentation.
2012-09-13 21:15:30 +02:00
Kristian S. Stangeland
783281ca2c
Made "metrics" invisible. No point polluting the namespace.
2012-09-13 21:08:31 +02:00
Kristian S. Stangeland
0d35ab6038
Adding the license information. Using GPL2 as of now.
...
While libraries are sometimes licensed under LGPL, or even less
restrictive licenses, in this particular case it doesn't really
make sense to encourage direct copying. The problem is that
competing libraries would conflict with each other. It's better
to feed improvements back into a single project.
Though, it's of course possible to fork this project. You can change
the internal classes - for instance, improving or changing the hook
points - without worriying about the public API.
2012-09-13 21:04:46 +02:00
Kristian S. Stangeland
8bb397b90e
Adding the ItemDisguise example program.
2012-09-13 20:47:21 +02:00
Kristian S. Stangeland
0653dc8c15
Made the "getPlugin" method mandatory for all listeners.
...
It's pretty useful for the data collector, as well as the utility
method "removePacketListeners".
2012-09-13 17:29:37 +02:00
Kristian S. Stangeland
ed5ce19795
Added a plugin users report to metrics.
2012-09-13 17:06:48 +02:00
Kristian S. Stangeland
83f313ce89
Switching to Metrics full.
2012-09-13 16:46:11 +02:00
Kristian S. Stangeland
c02ffb569d
Adding metrics (lite).
2012-09-13 16:08:55 +02:00
Kristian S. Stangeland
1710ef343b
Syncronize before hacking into the packet list. In addition,
...
copy over any unprocessed packets into the new list.
When we're done, we'll also clean up properly by copying over
any remaining packets.
2012-09-13 16:08:41 +02:00
Kristian S. Stangeland
5a6f3be219
Fix the server packet cancelling feature.
2012-09-13 14:56:14 +02:00
Kristian S. Stangeland
16d231f778
Fixed test case.
2012-09-13 14:43:15 +02:00
Kristian S. Stangeland
0d531ecc4b
Added a custom exception. Simplified the event API.
2012-09-13 14:42:37 +02:00
Kristian S. Stangeland
353302fe5f
Changed the API slightly. Added WorldType to PacketContainer.
2012-09-13 14:25:01 +02:00
Kristian S. Stangeland
035277bdeb
Added support for at least Beta 1.8.
...
This involved a bunch of reflection magic, along with the removal
of every Apache Commons reference, in addition to every internal
Guava class.
2012-09-13 13:57:22 +02:00
Kristian S. Stangeland
f372b247f9
Add support for 1.3.2
2012-09-13 11:34:47 +02:00
Kristian S. Stangeland
4307cb9104
Added the default instance class.
2012-09-13 11:01:32 +02:00
Kristian S. Stangeland
da694ca5ed
Added support for default values in packets.
2012-09-13 11:01:08 +02:00
Kristian S. Stangeland
c65f6b006f
Initial commit.
2012-09-12 19:04:53 +02:00