Commit Graph

838 Commits

Author SHA1 Message Date
Kristian S. Stangeland
be238f6ac6 Don't remove channel handlers in the main thread - can case deadlock. 2014-04-09 02:57:52 +02:00
Kristian S. Stangeland
8cb9e050a5 Don't attempt to register a client packet as a server packet.
And vice versa. This is a leftover from the time we used ConnectionSide
and packet IDs.
2014-04-08 02:00:13 +02:00
Kristian S. Stangeland
a800a505f5 Update gitignore 2014-04-08 01:59:37 +02:00
Kristian S. Stangeland
24de835440 Add the ability to load or save NBT compounds from files. 2014-04-01 23:20:24 +02:00
Kristian S. Stangeland
4f871c64d7 Warn instead of throwing an exception on packet type change.
We don't want to crash plugins over this, since it doesn't 
automatically cause problems. But it may trip up plugins that 
assume the packet types they set when registering a listener is the 
only ones they'll ever recieve in the method body, which is not true
if a preceeding packet listener can change a packet to an arbitrary 
type.

I'm open for better suggestions here. But for now, I'll just print a 
warning and hope people use sendServerPacket() instead.
2014-03-30 00:50:45 +01:00
Kristian S. Stangeland
839c186609 Added a way to compute a "histogram" (ordered by time slices).
This allows us to see snapshots of the online statistics algorihm.
2014-03-29 23:29:25 +01:00
Kristian S. Stangeland
300d3c2475 Handle errors in Apache. 2014-03-28 20:50:10 +01:00
Kristian S. Stangeland
485c3856c1 Don't fetch NetworkMarker uncessarily. 2014-03-27 23:23:45 +01:00
Kristian S. Stangeland
3b26940385 Don't poll the current time more than once a second for updates. 2014-03-27 21:00:36 +01:00
Kristian S. Stangeland
3257d6069a Compare packet type with equals(), just in case. 2014-03-22 23:21:57 +01:00
Kristian S. Stangeland
45e236b54a Adds some sanity checks in PacketEvent.setPacket().
Thanks libraryaddict. :)
2014-03-22 23:20:16 +01:00
Kristian S. Stangeland
7adb6548aa Ensure output handlers function correctly in 1.7.2 2014-03-21 22:19:24 +01:00
Kristian S. Stangeland
bd3a60b7eb Don't intercept catastrophic errors such as ThreadDeath and OOM.
May fix ticket 206.
2014-03-20 23:26:07 +01:00
Kristian S. Stangeland
d76d4247b0 Ensure Player.getAddress() returns the client's address.
I mistakenly returned the server's address instead.
2014-03-16 03:51:44 +01:00
Kristian S. Stangeland
5e0000d139 Properly cancel or modify packets intercepted in the channel thread.
This fixes ticket #204 on BukkitDev.
2014-03-15 19:25:40 +01:00
Kristian S. Stangeland
ad060b10af Fixed a bug introduced in #218 causing packet loops. FIXES 202.
In 659f01cc63, I attempted to 
execute packet listeners for receiveClientPacket() on the channel
thread, inadvertently causing them to be executed regardless if 
filtered was FALSE, and twice if it is TRUE.

Since asynchronous packet listeners use this feature to take out
packets from the packet stream, they wound up causing an infinite 
packet loop. This prevented them from ever being received by the
server.
2014-03-15 03:59:28 +01:00
Kristian S. Stangeland
75a5efcaa1 Add the ability to see registered asynchronous listeners. 2014-03-13 23:55:33 +01:00
Kristian S. Stangeland
f4f8817fd5 Undo mocking when we're done with the test. 2014-03-13 03:34:51 +01:00
Kristian S. Stangeland
38c62c4cfd Ensure sendServerPacket() works in the channel thread as well.
If we're already in the channel event thread, we won't go through
the ChannelProxy code, so, check scheduledProcessing in the write 
method as well.
2014-03-13 03:02:41 +01:00
Kristian S. Stangeland
4259a86740 Optimize lookup of getBukkitEntity. 2014-03-03 23:11:05 +01:00
Kristian S. Stangeland
b84aace585 Increment to 3.3.0-SNAPSHOT. 2014-02-23 22:49:46 +01:00
Kristian S. Stangeland
e8c77af92b Get rid of the other weak maps, and use thread local fields instead.
This should improve performance, and prevent the possibility of not 
informing plugins of sent packets.
2014-02-23 22:13:46 +01:00
Kristian S. Stangeland
659f01cc63 Remove concurrent "processed" and "ignore" hash maps.
We can rely on the fact that channel handlers are processed in a single 
thread, and simply enable/disable a flag.
2014-02-23 18:55:41 +01:00
Kristian S. Stangeland
6e0a44f9df Don't cache the NetHandler when checking if it has changed. 2014-02-21 19:28:07 +01:00
Kristian S. Stangeland
5f66dc6b4a Update to 3.2.2-SNAPSHOT. 2014-02-21 19:15:31 +01:00
Kristian S. Stangeland
eb7760236f Don't update the player instances on the LOGIN packet.
Instead, always check for the presence of NetServerHandler, 
and update then.
2014-02-21 19:14:58 +01:00
Kristian S. Stangeland
eb421dd31e Don't load converters that belong in 1.7.2. 2014-02-21 19:14:05 +01:00
Kristian S. Stangeland
7503470cb1 No need to throw an exception if the "last updated" file is corrupt. 2014-02-18 21:46:42 +01:00
Kristian S. Stangeland
6443de6257 Properly display blocks using the packet monitoring system. 2014-02-15 12:47:30 +01:00
Kristian S. Stangeland
a8378d4e6f Regression: Add back support for CraftBukkit 1.1.0 2014-02-11 23:58:57 +01:00
Kristian S. Stangeland
4e650ec7bf Quote replacement string. 2014-02-11 13:44:56 +01:00
Kristian S. Stangeland
f71ed90b04 Refresh the Netty registry when packet listeners are added. FIXES #40 2014-02-07 19:37:08 +01:00
Kristian S. Stangeland
345cc74b3c Fixed a bug preventing dual side packets from working in 1.6.4.
An example of a dual side packet is Packet101CloseWindow, which is 
sent by the server when it forces a inventory window to close, or 
by the client to the server when the player voluntarily closes it.

The bug prevented the client-side of a dual side packet from being 
recognized in 1.6.4. Thanks to Shevchikden for discovering the bug, 
and finding the correct build number where it was introduced.
2014-02-04 22:53:56 +01:00
Kristian S. Stangeland
9ef9475b61 Correct a concurrency bug discovered by mibby. FIXES #39.
It's another lazy initialization problem. I only check a single 
field before initializing two related fields, which can cause 
problems when two threads execute handleLogin() concurrently. 

If thread A detects that PACKET_LOGIN_CLIENT is null, it updates both
it and LOGIN_GAME_PROFILE. However, thread B may only see the 
PACKET_LOGIN_CLIENT update, and still believe LOGIN_GAME_PROFILE is 
NULL. Hence why it causes a NullPointerException in issue #39.
2014-02-03 01:38:52 +01:00
Kristian S. Stangeland
ea7b550bda Use PacketType in PacketContainerTest. 2014-02-02 19:54:49 +01:00
Kristian S. Stangeland
8bd177daf5 Update the integration test for Minecraft 1.7.2. 2014-02-02 19:46:03 +01:00
Kristian S. Stangeland
12286ebaa7 Expose configuration to plugins. 2014-02-02 19:45:30 +01:00
Kristian S. Stangeland
b59f55e2e5 Added support for serializing/deserializing WrappedServerPing to JSON. 2014-02-02 16:50:56 +01:00
Kristian S. Stangeland
752807fa5f Split up TinyProtocol and its built-in reflection system. 2014-02-01 16:38:24 +01:00
Kristian S. Stangeland
96cc518fb0 Throw a more descriptive error of a packet type hasn't got a class. 2014-01-30 02:04:38 +01:00
Kristian S. Stangeland
6e3583b300 Increment to 3.2.1-SNAPSHOT
Use Maven resource filtering to automatically update plugin.yml.
2014-01-30 02:03:09 +01:00
Kristian S. Stangeland
cfde9ecce8 Incrementing to 3.2.0 2014-01-29 04:00:40 +01:00
Kristian S. Stangeland
ef4bd2ddcd Race condition that would occationally skip STATUS packets. Fixes 198 2014-01-29 01:06:05 +01:00
Kristian S. Stangeland
bf8c16e22d Construct missing packet types. Possible fix for #197. 2014-01-28 01:38:34 +01:00
Kristian S. Stangeland
fb07a91fb0 Updating TinyProtocol significantly.
Added the ability to send and recieve packets, along with a more 
powerful reflection system. You can now retireve Minecraft classes 
by name.
2014-01-28 00:58:57 +01:00
Kristian S. Stangeland
5d7895d741 Fixed a VERY long standing bug discovered by libraryaddict.
Constructing a WrappedWatchableObject with a 
net.minecraft.server.ItemStack would cause ProtocolLib to throw an
IllegalArgumentException, even though WrappedWatchableObject.
setValue(Object) accepts ItemStacks without trouble.

This is because WrappedWatchableObject.getUnwrappedType() didn't handle 
ItemStacks at all.
2014-01-23 02:55:47 +01:00
Kristian S. Stangeland
385bae8bda Increment to 3.1.3-SNAPSHOT 2014-01-20 06:21:51 +01:00
Kristian S. Stangeland
7ae0399721 Lookup packet types by name as well. 2014-01-20 06:21:20 +01:00
Kristian S. Stangeland
5cffccd8ca Bumping to version 3.1.2 2014-01-19 17:01:45 +01:00
Kristian S. Stangeland
c87c0a9299 Add support for legacy /packet commands. 2014-01-19 00:27:57 +01:00