9289 Commits

Author SHA1 Message Date
Dylan K. Taylor
bbc8bc4df5 Move some error handling stuff to SPL 2019-01-17 19:16:03 +00:00
Dylan K. Taylor
e341f3dce2 Level: rename getName() to getDisplayName() 2019-01-17 16:46:56 +00:00
Dylan K. Taylor
76f1ee1827 Add restrictions on packet send directions with interfaces
This prevents plugins sending wrong packets at the compiler level (or would, if we had a compiler). It's more robust than a getter for client/server and throwing an exception since a static analysis tool can detect faults created by sending wrong packets from the server. This is also used to deny service to dodgy clients which send wrong packets to the server to attack it.
2019-01-17 12:51:24 +00:00
Dylan K. Taylor
b82e00ffdf Extract a Packet interface from DataPacket
this is in preparation for clientbound/serverbound packet separation. I did this already on another branch, but the changeset was dependent on a massive refactor to split apart packets and binarystream which i'm still not fully happy with.
2019-01-17 12:21:56 +00:00
Dylan K. Taylor
9c0ebb6350 Minor formatting fixes 2019-01-16 22:14:40 +00:00
Dylan K. Taylor
38afe22b79 Move Event cancellable parts to trait 2019-01-16 22:14:25 +00:00
Dylan K. Taylor
2e7e56de1e Merge branch '3.5' 2019-01-16 21:52:03 +00:00
Dylan K. Taylor
cb591a98f4 NetworkBinaryStream: Skip item NBT which is too large when encoded
Encoded tags larger than 32KB overflow the length field, so we can't send these over network. However, it's unreasonable to randomly throw this burden off onto users by crashing their servers, so the next best solution is to just not send the NBT. This is also not an ideal solution (books and the like with too-large tags won't work on the client side) but it's better than crashing the server or client due to a protocol bug. Mojang have confirmed this will be resolved by a future MCPE release, so we'll just work around this problem until then.
2019-01-16 21:50:43 +00:00
Dylan K. Taylor
2656993223 AAAAAAAAAAAAAAAAAAAAAAAAAAAAA 2019-01-16 21:31:17 +00:00
Dylan K. Taylor
fc98f4c42b Address more error cases, some minor cleanup 2019-01-16 21:30:31 +00:00
Dylan K. Taylor
44ef9fc577 LoginPacket: account for some missed error cases 2019-01-16 21:00:28 +00:00
Dylan K. Taylor
c9c6a5dc94 Fixed some doc comments 2019-01-16 20:48:26 +00:00
Dylan K. Taylor
23269da1a6 Fixed the disaster of packet receive error handling 2019-01-16 19:53:48 +00:00
Dylan T
ddc2bed63f
Add an API change request template 2019-01-16 19:21:37 +00:00
Dylan K. Taylor
8bc33a849a Remove built-in pcntl support
This is a bolt-on feature that can't be disabled and causes serious grief for Unix server users, because it prevents ctrl+c aborting the server the normal way.
Instead, we prefer introducing a plugin to implement this functionality, so that users can opt-in or opt-out.
2019-01-16 14:13:08 -05:00
Dylan K. Taylor
390501ec35 Merge branch '3.5' 2019-01-16 18:57:17 +00:00
Dylan K. Taylor
e9d1af0aee Fixed stack trace encoding bug in CrashDump
it was encoding the real (full) trace, instead of emitting the printable version.
2019-01-16 18:56:56 +00:00
Dylan K. Taylor
728bc95d73 NetworkSession: remove premature GC optimization
The only cyclic references here are both destroyed during normal collection directly (net interface removes from sessions array, player destroys its session reference), so there's no need to destroy them again here. This just causes a giant swathe of potential crashes for no real benefit.

close #2669
2019-01-16 16:50:16 +00:00
Dylan K. Taylor
acdd0fec5f NetworkSession: player may be null 2019-01-16 16:19:39 +00:00
Dylan K. Taylor
f647b1b7a5 Some cleanup to internal sounds handling 2019-01-15 21:32:41 +00:00
Dylan K. Taylor
c34a4f45d4 Merge branch '3.5' 2019-01-15 14:46:03 +00:00
Dylan K. Taylor
0f545c410a Bow: Improve consistency with vanilla (JE at least), closes #2660
This change causes the existing test I did to now report ~55-60 blocks, which is much closer to parity with vanilla.
2019-01-15 14:42:41 +00:00
Dylan K. Taylor
f882f557fb Merge branch '3.5' 2019-01-15 10:33:58 +00:00
Dylan K. Taylor
1c2ed0836f Sync composer dependencies 2019-01-15 10:26:33 +00:00
Dylan K. Taylor
242c7e3777 Grass: remove premature optimization
this is reading full-block from the chunk every access, which is slower than accessing the level block-cache.
2019-01-14 23:14:31 +00:00
Dylan K. Taylor
797aabdf15 Entity: Protect move() to avoid stupidity 2019-01-14 19:57:46 +00:00
Dylan K. Taylor
ff5cb84b81 Server: fixed an oops 2019-01-13 21:00:16 +00:00
Dylan K. Taylor
3e1aa3e2b4 Network: remove Server dependency 2019-01-13 20:41:17 +00:00
Dylan K. Taylor
9c53b41851 Added PlayerInfo, Player is no longer accessible during PlayerPreLoginEvent 2019-01-13 19:32:30 +00:00
Dylan K. Taylor
d2082c0383 Explosion: Recalculate light on destroyed blocks
this has been a bug for a long long time. I think the reason it was never addressed is because of the performance impact associated with it. However, that performance impact is now gone thanks to light update batching.
2019-01-13 14:22:35 +00:00
Dylan K. Taylor
1dca9074d5 Remove hacks for triggering adjacent light refill 2019-01-13 14:17:56 +00:00
Dylan K. Taylor
82788774b0 Level: Queue all block updates until the end of tick
this allows deduplicating block updates when lots of adjacent blocks are set on a tick, which has beneficial effects on performance. It also fixes #2659.

Future scope:
- Use this mechanism to deal with explosions properly.
- Don't execute block updates for air blocks.
2019-01-13 13:24:02 +00:00
Dylan K. Taylor
d2768188e8 LevelManager: remove unnecessary message 2019-01-12 19:52:28 +00:00
Dylan K. Taylor
5052b75565 Separate Level management functionality from Server, clean up a bunch of mess 2019-01-12 19:11:05 +00:00
Dylan K. Taylor
27761ac26e Fixed casing: Gamemode -> GameMode
it's two words, not one.
2019-01-12 16:19:31 +00:00
Dylan K. Taylor
a756519e6b Move gamemode constants & functions to their own class
future enhancements:
- make gamemode an object containing information about abilities that players have in this gamemode (gamemodes are just predefined ability sets)
- get the magic numbers out of the API
2019-01-12 16:10:14 +00:00
Dylan T
6cf30dc813 build 7.3 on travis 2019-01-11 23:54:44 +00:00
Dylan K. Taylor
49bdd92faa LoginPacket: Assert that extradata must exist 2019-01-11 17:56:18 +00:00
Dylan K. Taylor
e9f023fe69 LoginPacket: fix corruption false-positives in offline mode 2019-01-11 17:55:58 +00:00
Dylan K. Taylor
19614ed25e Entity: move some NBT usages out of constructor, fix missing property defaults 2019-01-10 21:01:19 +00:00
Dylan K. Taylor
f4d07f0c1e Merge branch '3.5' 2019-01-10 19:31:01 +00:00
Dylan K. Taylor
f7d9247d39 Server: Permit NULL value entries in pocketmine.yml worlds
this permits listing worlds to load as keys without values.
2019-01-10 19:30:37 +00:00
Dylan K. Taylor
1f54760dae Config: Make load() private 2019-01-10 18:03:15 +00:00
Dylan K. Taylor
5d8fa2e126 Crash main server thread when RakLib dies
this way we get crashdumps and find out what's actually wrong with RakLib in the wild.
2019-01-09 19:04:12 +00:00
Dylan K. Taylor
cc230034f9 Fixed TransactionData->actions default value, closes #2652 2019-01-09 14:15:06 +00:00
Dylan K. Taylor
b9ce6537a8 Sync composer dependencies (master) 2019-01-09 00:22:42 +00:00
Dylan K. Taylor
8452c7bdbd Sync composer dependencies 2019-01-09 00:18:55 +00:00
Dylan K. Taylor
2924303169 Sync NBT dependency 2019-01-07 22:38:04 +00:00
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