1013 Commits

Author SHA1 Message Date
Dylan K. Taylor
9c16caf27b Fixed an edge-case in AvailableCommandsPacket decoding 2019-01-07 22:23:51 +00:00
Dylan K. Taylor
4f50119b74 LoginPacket: Cater for more error cases
This now doesn't crash unexpectedly at the first sign of broken data.
2019-01-07 14:45:44 +00:00
Dylan K. Taylor
adc1069ed2 Merge branch '3.5' 2019-01-04 23:28:44 +00:00
Dylan K. Taylor
4b9a142a5d Import global functions and constants for enhanced performance
This is better for performance because these then don't need to be reevaluated every time they are called.

When encountering an unqualified function or constant reference, PHP will first try to locate a symbol in the current namespace by that name, and then fall back to the global namespace.
This short-circuits the check, which has substantial performance effects in some cases - in particular, ord(), chr() and strlen() show ~1500x faster calls when they are fully qualified.

However, this doesn't mean that PM is getting a massive amount faster. In real world terms, this translates to about 10-15% performance improvement.
But before anyone gets excited, you should know that the CodeOptimizer in the PreProcessor repo has been applying fully-qualified symbol optimizations to Jenkins builds for years, which is one of the reasons why Jenkins builds have better performance than home-built or source installations.
We're choosing to do this for the sake of future SafePHP integration and also to be able to get rid of the buggy CodeOptimizer, so that phar and source are more consistent.
2019-01-04 20:43:15 +00:00
Dylan K. Taylor
febf1b1801 Merge branch '3.5' 2019-01-04 11:46:12 +00:00
Dylan K. Taylor
11b59498d9 TakeItemEntityPacket: add missing decode, close #2633 2019-01-04 11:45:37 +00:00
Dylan K. Taylor
8ef15d728a HandshakeSessionHandler: fix a doc comment bug
thank you PHPStan ❤️
2019-01-03 22:36:31 +00:00
Dylan K. Taylor
c559dfccfe DataPacket: encode() and decode() are now final, encodePayload() and decodePayload() are now abstract 2019-01-03 21:14:54 +00:00
Dylan K. Taylor
60687d8d6c Merge branch '3.5' 2019-01-03 18:02:33 +00:00
Dylan K. Taylor
0f941410f6 Use more appropriate exceptions in the protocol layer 2019-01-03 17:57:06 +00:00
Dylan K. Taylor
9840a3c980 Merge branch '3.5' 2019-01-03 17:29:53 +00:00
Dylan K. Taylor
4d15eb3327 Cleaned up the InventoryTransactionPacket decoding clusterfuck
@shoghicp, y u do dis... I almost created a sub-packet architecture to deal with this shit :(

This mess really ought to be split into multiple packets. Perhaps the PacketPool can be extended to do that in the future.
2019-01-03 17:24:30 +00:00
Dylan K. Taylor
504cc3bf8b AddEntityPacket: fix some bugs in legacy ID conversion handling 2019-01-03 17:00:16 +00:00
Dylan K. Taylor
171be946c6 Network: burn some deprecated stuff 2019-01-01 20:53:33 +00:00
Dylan K. Taylor
f81bbd60e8 Avoid use of internal fields in BinaryStream 2019-01-01 16:42:14 +00:00
Dylan K. Taylor
4a629e1a26 DataPacket: remove dead function clean() 2019-01-01 15:43:05 +00:00
Dylan K. Taylor
c6a32ccf2a Merge branch 'release/3.5' 2019-01-01 14:08:20 +00:00
Dylan K. Taylor
f7de6eb59f Network: Deprecate some garbage
Deprecations on a patch version breaks release protocol, but I don't care at this point. Nobody should have been using this shit anyway.
2018-12-31 22:52:39 +00:00
Dylan K. Taylor
75a0627bf2 Network: cut this catch-all bullshit out as well
If a network interface crashes, it should take out the whole server, not try to keep on ticking.
2018-12-31 22:40:13 +00:00
Dylan K. Taylor
8752e363c9 EXCUSE ME, HOW DARE YOU NOT LOG NETWORK ERRORS?! 2018-12-31 22:33:56 +00:00
Dylan K. Taylor
3b183447b0 Merge branch 'release/3.5' 2018-12-31 21:52:48 +00:00
Dylan K. Taylor
ae497a828f Merge branch 'release/3.5' 2018-12-30 17:33:31 +00:00
Dylan K. Taylor
daf56e990b Get rid of some network-layer asserts
NEVER assert on user data. 🤦
2018-12-30 12:42:52 +00:00
Dylan K. Taylor
7b3115c00c Moved network NBT serializer into network namespace 2018-12-29 20:12:00 +00:00
Dylan K. Taylor
e6381297c7 NetworkCipher: fix some missing typehints 2018-12-28 17:35:37 +00:00
Dylan K. Taylor
3ebd7e8ba6 Add network-wide API to filter raw packets by regex, stricter validation for Query 2018-12-28 16:30:52 +00:00
Dylan K. Taylor
02efa93e3a PlayerPreLoginEvent: New, more elegant way to control authentication requirement
Previously the only way to deal with this was to cancel the PlayerKickEvent generated by lack of authentication. Now, plugins can decide whether auth should be required for a specific player. The default is whatever xbox-auth is set to in server.properties.

cc @Johnmacrocraft
2018-12-23 18:24:33 +00:00
Dylan K. Taylor
a2e4fdc8a2 Merge branch 'release/3.5' 2018-12-20 20:02:16 +00:00
Dylan K. Taylor
70df1579a8 Merge branch 'release/3.4' into release/3.5 2018-12-20 20:02:00 +00:00
Dylan K. Taylor
2506947641 Merge branch 'release/3.5' 2018-12-20 20:01:02 +00:00
Dylan K. Taylor
ea9f9aa250 Update some non-critical protocol magic numbers 2018-12-20 19:59:42 +00:00
Dylan K. Taylor
34a899e28b Clean up Utils error handling functions (internal) 2018-12-16 17:50:00 +00:00
Dylan K. Taylor
c05697f506 Merge branch 'release/3.4' into release/3.5 2018-12-14 09:39:21 +00:00
Dylan T
660d42e8d1
Backport usage of SetLocalPlayerAsInitializedPacket to 3.4 (#2558)
This fixes various problems, such as forms not working on PlayerJoinEvent.
2018-12-13 20:07:17 +00:00
Dylan K. Taylor
125cc28aa0 Merge branch 'release/3.5' 2018-12-13 10:54:30 +00:00
Dylan K. Taylor
dbeceb02f9 fixup 1.8 crafting, take 2 2018-12-13 10:54:15 +00:00
Dylan K. Taylor
fd77dd0066 Revert "Fixed crafting grid transaction handling, close #2559"
This reverts commit dfeb62491a74a402aa269e06c51de8f1a60238e9.
2018-12-13 10:38:04 +00:00
Dylan K. Taylor
e92aac847c Merge branch 'release/3.5' 2018-12-13 09:56:54 +00:00
Dylan K. Taylor
87ce87112b Merge branch 'release/3.4' into release/3.5 2018-12-13 09:56:21 +00:00
Dylan K. Taylor
1d71f5edb3 DataPacket: more detail in error messages for undefined fields 2018-12-13 09:55:50 +00:00
Dylan K. Taylor
ffa733fe0c Merge branch 'release/3.5' 2018-12-12 19:51:41 +00:00
Dylan K. Taylor
ec4c61e113 fix extradata defaults for broadcastLevelSoundEvent
fixes TNT sounds not working, amongst other things
2018-12-12 17:42:52 +00:00
Dylan K. Taylor
231e491bb9 Fixed black spawn eggs 2018-12-12 17:14:13 +00:00
Dylan K. Taylor
69cdc6f13a Remove misleading default value for NetworkInventoryAction windowId 2018-12-12 16:08:47 +00:00
Dylan K. Taylor
dfeb62491a Fixed crafting grid transaction handling, close #2559 2018-12-12 15:41:54 +00:00
Dylan K. Taylor
178eedb536 Merge branch 'release/3.4' into release/3.5 2018-12-12 10:12:12 +00:00
Dylan K. Taylor
4975da2aae NetworkInventoryAction: additional validity checks 2018-12-12 10:11:44 +00:00
Dylan K. Taylor
30f5a8fac6 Protocol changes for 1.8.0 release 2018-12-11 21:05:03 +00:00
Dylan K. Taylor
75482124f2 Merge branch 'release/3.3' into release/3.4 2018-12-01 10:09:46 +00:00
Dylan K. Taylor
1a6db1c7ce DataPacket: add missing field
this must have been missing for how many years now? thanks @shoghicp

this is why we don't do releases on friday night... in my defence my device had the beta installed...
2018-12-01 09:29:53 +00:00