Commit Graph

1659 Commits

Author SHA1 Message Date
Kristian S. Stangeland
dfba924561 Clean up every static field, preempting potential ClassLoader leaks.
Note that this method is using some fairly ugly hacks and must be 
maintained/updated manually whenever a new class is added or removed.
2012-10-29 02:25:29 +01:00
Kristian S. Stangeland
bdc41221db Fixed a serious misuse causing the creation of too many new classes.
The different injectors using CGLib was using a custom CallbackFilter
to optimize the resulting generated class. Unfortunately, the custom
filter didn't properly implement equals() and hashCode(), and so every
time a player logged, a new injector class had to be generated. 

This was fixed by making the injectors share a single CallbackFilter.

In addition, I've begun adding cleanup code that will reset all static
fields once the plugin has unloaded.
2012-10-29 01:42:22 +01:00
Kristian S. Stangeland
eaf0b73c00 Increment version to 1.4.4-SNAPSHOT (skipping release of 1.4.3) 2012-10-28 06:10:31 +01:00
Kristian S. Stangeland
cb2c7b4e0a Use a class cache when constructing the packet interceptor. 2012-10-28 06:09:29 +01:00
Kristian S. Stangeland
4e9b5009c8 Don't print messages to the console without a plugin prefix.
It's bad practice.
2012-10-23 00:54:41 +02:00
Kristian S. Stangeland
7536815e58 Set as SNAPSHOT in the plugin-file as well. 2012-10-23 00:41:53 +02:00
Kristian S. Stangeland
96ad954cf7 Prevent the PlayerQuitEvent from being fired twice. FIXES Ticket-2. 2012-10-23 00:37:35 +02:00
Kristian S. Stangeland
0aac8ebf0a Increment to 1.4.3 snapshot. 2012-10-21 22:40:26 +02:00
Kristian S. Stangeland
a60dc3d778 Make the client packet reader thread-safe. 2012-10-21 22:39:56 +02:00
Kristian S. Stangeland
01c481dc93 Release of 1.4.2 2012-10-21 20:42:29 +02:00
Kristian S. Stangeland
a51ad1f50f Properly remove previous hook, even if socket is NULL. FIXES Ticket-1. 2012-10-21 20:31:20 +02:00
Kristian S. Stangeland
c08106a923 Increment to 1.4.2 snapshot. 2012-10-21 16:33:52 +02:00
Kristian S. Stangeland
63c468eff0 Packet constructor can now handle primitive parameter types. 2012-10-21 16:33:41 +02:00
Kristian S. Stangeland
43c0b5d8f1 Don't save NULL injectors in a ConcurrentHashMap. 2012-10-21 12:11:59 +02:00
Kristian S. Stangeland
331fc94190 Sending or receiving packets now work without listeners. 2012-10-19 16:27:49 +02:00
Kristian S. Stangeland
caed0dcb11 Removed the spammy "Entity does not exist" error. 2012-10-19 00:54:03 +02:00
Kristian S. Stangeland
90f2caa5e8 Incremented to 1.4.1 2012-10-17 09:54:28 +02:00
Kristian S. Stangeland
69a5675161 Fixed a bug causing a StackOverflowException on packet construction. 2012-10-17 09:53:59 +02:00
Kristian S. Stangeland
f8a8a645eb Added JavaDoc again. What the ... feels like everything is falling
apart.
2012-10-17 08:16:18 +02:00
Kristian S. Stangeland
32ed35d409 Adding GamePhase too. 2012-10-17 08:11:11 +02:00
Kristian S. Stangeland
242ddd5f40 Updated JavaDoc for 1.4.0 2012-10-17 08:07:20 +02:00
Kristian S. Stangeland
b9ed36641f Merge branch 'master' into gh-pages
Conflicts:
	ProtocolLib/.classpath
	ProtocolLib/.settings/org.eclipse.core.resources.prefs
2012-10-17 08:01:30 +02:00
Kristian S. Stangeland
0622322ef4 Merged. 2012-10-17 07:58:24 +02:00
Kristian S. Stangeland
d5028b584d Put the provided CGLib dependency in the com.comphenix namespace. 2012-10-17 06:57:05 +02:00
Kristian S. Stangeland
2b6a4570ab Added a couple of extra constructors. 2012-10-17 05:58:47 +02:00
Kristian S. Stangeland
4717cca2ec Increment to 1.4.0. 2012-10-17 05:32:46 +02:00
Kristian S. Stangeland
dd5303ea88 Use a boolean lookup table instead of a ConcurrentHashMap. 2012-10-17 04:13:25 +02:00
Kristian S. Stangeland
fee9a32e4b Store a current player injection hook for each game phase.
That way, one failing the other won't cause any problems.
2012-10-17 03:33:49 +02:00
Kristian S. Stangeland
3a8a4d15cf Fixed a couple of small bugs. 2012-10-17 01:19:06 +02:00
Kristian S. Stangeland
4cd5d04cae Wait 5 seconds before unhooking every player in the server. 2012-10-17 00:46:51 +02:00
Kristian S. Stangeland
476a918794 Dynamically add or remove injected hooks depending on the listeners.
This occurs whenever a listener is added or removed. A listener can
now specify whether or not it's listening for packets sent BEFORE
a player has logged in (every packet upto Packet1Login and a few more),
or AFTER. By default, listeners only receive notifcation of packets
sent and received after. 

ProtocolLib will now only hook NetLoginHandler if there's a login 
listener, and vice versa. Thus, the new login feature will only
tax the server if another plugin is using it. In addition, ProtocolLib
will not consume any resources when it's not serving any listeners.
2012-10-16 22:24:30 +02:00
Kristian S. Stangeland
ecdc9b4b6c Let's be generous and clean up the injection before the other plugins. 2012-10-16 17:01:34 +02:00
Kristian S. Stangeland
94efb38324 Retrieve the updated player entity as fast as we can. 2012-10-16 16:42:27 +02:00
Kristian S. Stangeland
09348343dd NetLoginInjector should not be public. 2012-10-16 08:01:04 +02:00
Kristian S. Stangeland
d88f507337 Removed debug listener. 2012-10-16 07:59:03 +02:00
Kristian S. Stangeland
b52670c4b3 Switching to overriding an ArrayList directly.
This makes the injection code compatible with earlier versions of
Minecraft (even 1.0.0).
2012-10-16 07:58:30 +02:00
Kristian S. Stangeland
93468b53b3 Massive update that adds support for intercepting packets during login.
This is achieved by injecting the NetLoginHandler when it's added
to the DedicatedServerConnectionThread's list of current login handlers.

PacketEvents during this phase uses "fake" Player objects that only
support a subset of methods. Consumers can expect the following methods
to be functional:
 * getPlayer()
 * getAddress()
 * getServer()
 * chat(String)
 * sendMessage(String)
 * sendMessage(String[])
 * kickPlayer(String)

A "fake" Player object can be converted to its real counterpart by
calling getPlayer().
2012-10-16 07:28:54 +02:00
Kristian S. Stangeland
9b4b161602 First test of the pre-login injector. 2012-10-15 00:31:55 +02:00
Kristian S. Stangeland
39805c5502 Incremented version to 1.3.3 2012-10-13 22:19:07 +02:00
Kristian S. Stangeland
98ae5c6e29 Added a monitor every packet listener. 2012-10-13 22:19:01 +02:00
Kristian S. Stangeland
a173824b3f Switching to the public repository group. 2012-10-13 18:07:02 +02:00
Kristian S. Stangeland
51c5a23c83 Switching to the "repo" virtual website instead. 2012-10-13 17:19:45 +02:00
Kristian S. Stangeland
61cd8a3ae4 Using a self-hosted repository for now. 2012-10-12 04:09:38 +02:00
Kristian S. Stangeland
fe3a69bd3d Switching from UTF-8 to cp1252. 2012-10-12 00:49:47 +02:00
Kristian S. Stangeland
8e70a56768 CGlib must be in the compile scope, otherwise it's not included.
In addition, updated the README with information about Maven.
2012-10-12 00:24:15 +02:00
Kristian S. Stangeland
28fc096740 Bumping to version 1.3.2 2012-10-12 00:04:59 +02:00
Kristian S. Stangeland
129687772f Mark CraftBukkit and cglib as provided.
CraftBukkit, or just Bukkit, will already be a dependecy for any
plugin. CGlib will be provided by ProtocolLib, so that's not needed
either.
2012-10-12 00:04:05 +02:00
Kristian S. Stangeland
768d169f27 Added the same NULL check to the generic Bukkit unwrapper. 2012-10-12 00:01:05 +02:00
Kristian S. Stangeland
57add8e26f Handling the case where someone is writing a NULL element to
a equivalent converter.
2012-10-11 23:57:45 +02:00
Kristian S. Stangeland
8bd7f75a6d Updating POM to use Sonatype Nexus OSS. 2012-10-11 22:30:46 +02:00