12008 Commits

Author SHA1 Message Date
Dylan K. Taylor
d64561b0b1 Fixed internal server error when deleting book pages that only exist client side 2020-06-01 12:39:17 +01:00
Dylan K. Taylor
d234d3e45e ParticleCommand: added mobflame, closes #3102 2020-05-31 20:28:57 +01:00
Dylan K. Taylor
5056754cea NetworkBinaryStream: do not round vectors directly on reading
fixes #3199
2020-05-31 20:17:42 +01:00
Dylan K. Taylor
2dc3cf8162 InventoryTransaction: sync inventories before throwing validation exception to caller
fixes #3226

really the transaction shouldn't be handling inventory sync at all, but that's a job for another commit.
2020-05-31 20:10:29 +01:00
Dylan K. Taylor
8c5a81cf5c Living: improved projectile knockback
this isn't pretty, but it works. I have a nicer idea how to do this on PM4, but it's going to involve BC breaks (as usual).
closes #3382
2020-05-31 20:04:12 +01:00
Dylan K. Taylor
2b58f2bafd FallingBlock: remove superfluous transparent check, closes #3339 2020-05-31 19:54:47 +01:00
Dylan K. Taylor
5dadf12374 Living: fixed cooldown damage logic, closes #2939 2020-05-31 19:46:51 +01:00
Dylan K. Taylor
0d4e473bdd Reduce ResourcePackChunkData chunk size to 128 KB
while this is slightly less bandwidth efficient (1 in 92 datagrams not full vs 1 in 733), this is significantly less memory-hard.
I made this decision looking at the memory pressures that 1MB chunks exert - especially on RakNet. Client-side, these resource pack chunks all hang around in RakNet memory until the whole thing is received, and it's a lot more costly to receive 733 datagrams than it is to receive 92, especially since it's much more likely that some of the 733 will disappear along the way.
If, for example, the first couple of hundred KB split parts arrived out of 1MB, and then one of the parts got lost, all the already-received parts would hang around in memory not getting processed. With smaller chunks this is much less of a problem.
I explored taking the chunk size all the way down to 1KB to reduce the bandwidth waste caused by split packets (split headers), but this made resource pack downloading unbearably slow, so it wasn't acceptable.
2020-05-31 19:29:26 +01:00
Dylan K. Taylor
11cedc4011 Player: added a constant for resource pack chunk sending size 2020-05-31 19:23:21 +01:00
Dylan K. Taylor
bbf3f4c476 Merge branch 'next-minor' 2020-05-31 18:40:19 +01:00
Dylan K. Taylor
3f2455f090 SnowLayer: fixed layer stacking, closes #2775 2020-05-31 17:38:24 +01:00
Dylan K. Taylor
9d26a224a2 DoublePlant: add flammability info, closes #2465 2020-05-31 17:04:50 +01:00
Dylan K. Taylor
c4ad390463 pocketmine.yml: raise default population-queue-size to 32
the old limit was made in the php5 days when performance was far worse and it was much more costly to generate chunks that weren't needed. Now it's significantly less and having a higher limit allows terrain to be sent more quickly in new worlds and to fast-moving players.
This limit really ought to go away completely but considering the technical barriers in the way it'll have to stay for now.
2020-05-31 16:58:53 +01:00
Dylan K. Taylor
42e14f749e Do not blanket-ban all inventory transactions in spectator mode, fixes #2627
instead, we cancel the appropriate events before they are called, so that plugins can uncancel them if they choose.
2020-05-31 16:32:06 +01:00
Dylan K. Taylor
484557935e Level: remove dead block placement code (player movements are now always processed immediately, just not immediately broadcasted) 2020-05-31 16:06:48 +01:00
Dylan T
485f573955
Player: remove move buffering, implement simple rate limited movement… (#3167)
Introduction
This PR is a second attempt at improving movement processing to fix #1215 , #2730 and more.

This is significantly less complex than the previous attempt #2646 -- it gets rid of the movement buffering system entirely and instead relies on a simple rate limit counter to restrict on-the-fly movement processing.

Movement is rate limited to a max average of 2 per tick. It allows up to 5 seconds' backlog to accommodate network lag. The rate limit counter is increased by 2 per tick and decreased once for every movement processed. This prevents movement processing being abused for denial of service attacks.

Changes
API changes
This PR, while obviously highly beneficial for most current users, poses some BC-breaking issues because of changes to the internal Player API.

Player->processMovement() (protected) has been removed. This is a BC concern for custom player classes which overrode it and called it as a parent. In addition, child implementations won't be called every tick any more, which could break some custom movement processing systems.
Player->newPosition (protected) has been removed. This internal field may have been accessed by custom movement implementations.
Player->isTeleporting (protected) has been removed. BC concern is same as previous point.
Player->getNextPosition() (public) has been @deprecated.
Added the following protected Player class members:
int $moveRateLimit
?Vector3 $forceMoveSync
handleMovement()
processMostRecentMovements()
revertMovement()
Behavioural changes
Player movement is now subject to less rubberbanding and has more reliable behaviour.
2020-05-31 15:51:30 +01:00
Dylan K. Taylor
4bf40df770 tools: added a script to remove garbage from region files 2020-05-31 15:10:28 +01:00
Dylan K. Taylor
31f4735ce5 Merge branch 'next-minor'
# Conflicts:
#	composer.lock
#	resources/vanilla
2020-05-31 15:05:44 +01:00
Dylan K. Taylor
e9e8055238 Merge commit '3f07f0687' 2020-05-31 15:05:11 +01:00
Dylan K. Taylor
9c50ad4c83 Merge commit '10279e11e' 2020-05-31 15:04:58 +01:00
Dylan K. Taylor
1974afec78 updated build/php submodule to pmmp/pthreads@653d685628 2020-05-31 15:04:37 +01:00
Dylan K. Taylor
8dc5b9e712 Merge commit '673e44445'
# Conflicts:
#	composer.lock
#	resources/vanilla
2020-05-31 15:03:48 +01:00
Dylan K. Taylor
7e86354519 updated composer lockfile 2020-05-31 14:59:00 +01:00
Dylan K. Taylor
6df43338df Merge commit 'c3a795e87'
# Conflicts:
#	resources/vanilla
#	src/pocketmine/Player.php
#	src/pocketmine/entity/Entity.php
2020-05-31 14:56:37 +01:00
Dylan K. Taylor
0a730db030 Merge commit '4199c3796f4c6d8da0eccba64fe4cd9812acadeb'
# Conflicts:
#	resources/vanilla
#	src/pocketmine/block/Water.php
2020-05-31 14:46:51 +01:00
Dylan K. Taylor
71e0521286 Merge branch 'stable' into next-minor
# Conflicts:
#	composer.lock
2020-05-31 14:43:53 +01:00
Dylan K. Taylor
3f07f06874 updated composer lockfile 2020-05-31 14:42:31 +01:00
Dylan K. Taylor
10279e11ed updated build/php submodule to pmmp/php-build-scripts@d475b694e4 2020-05-31 14:33:26 +01:00
Dylan K. Taylor
673e444456 phpstan: fix build failure 2020-05-31 13:02:32 +01:00
Dylan K. Taylor
89c49d77c6 ditch irstea/phpunit-shim, more trouble than it's worth 2020-05-31 12:03:38 +01:00
Dylan K. Taylor
cc549630e5 HandlerListManager: fixed @param doc comment not referring to correct ReflectionClass
phpstan doesn't notice this because of the phpstan-param doc directly underneath.
2020-05-30 22:29:30 +01:00
Govdim
4ce5f2a6c6
WorldManager: Add access to WorldProviderManager (#3527)
* WorldProvider: Add access to WorldProviderManager

* WorldManager: Updated getProvider method

Co-authored-by: Govdim <govdim.govorek@gmail.com>
2020-05-26 06:59:19 +01:00
Dylan K. Taylor
c93038f574 Inject WorldProviderManager to WorldManager's constructor, no longer singleton 2020-05-24 19:22:04 +01:00
Dylan K. Taylor
437e4d75ab WorldProviderManager: use $this-> instead of self:: 2020-05-24 19:16:57 +01:00
Dylan K. Taylor
81d11ea4e3 Player: make selectChunks() non-dependent on the player's current view distance & location 2020-05-24 18:59:43 +01:00
Dylan K. Taylor
63d622a3cc Remove GlobalConstants
the constants described in this file are now provided by pocketmine\utils\Limits in the BinaryUtils dependency.
2020-05-24 18:37:09 +01:00
Dylan K. Taylor
41566e8077 Server: remove unused BOOTUP_RANDOM constant
this used to be used for /dumpmemory filenames, but those were confusing and stupid, and it's not used anymore since March 2018.
2020-05-24 18:33:04 +01:00
Dylan K. Taylor
3473254d01 added Timings::INCLUDED_BY_OTHER_TIMINGS constant 2020-05-24 16:09:45 +01:00
Dylan K. Taylor
fe649d8d70 Extract ServerConfigGroup from Server
this API isn't very nice, but it's pretty much the same as the original, and at least this can be _kinda_ unit-tested...
2020-05-24 15:48:03 +01:00
Dylan K. Taylor
b05fab3e3c FormatConverter: do not hardcode progress update interval 2020-05-24 14:30:59 +01:00
Dylan K. Taylor
c95951479c FormatConverter: beware paths with \ on linux 2020-05-24 14:28:07 +01:00
Dylan K. Taylor
49bd58a86a DiskResourceProvider: do not trim backslashes from path when we're not on Windows 2020-05-24 14:26:12 +01:00
Dylan K. Taylor
2170f81cdd PluginManager: remove dead function isCompatibleApi()
moved to ApiVersion static class
2020-05-24 14:14:47 +01:00
Govdim
c3a795e876
Fix walk sounds (#3492)
Co-authored-by: Govdim <govdim.govorek@gmail.com>
2020-05-24 14:03:14 +01:00
Muqsit Rayyan
4199c3796f
Water: Remove duplicate call to Entity->resetFallDistance() (#3524)
It's not clear what the intended goal of this code was, but the duplicate call is obviously useless.
2020-05-24 14:00:19 +01:00
Dylan K. Taylor
5eadb0ac44 ConsoleCommandSender: be honest about Server dependency 2020-05-23 12:31:22 +01:00
Dylan K. Taylor
5f2e65d608 QueryHandler: be honest about dependency on Server 2020-05-23 12:28:12 +01:00
Dylan K. Taylor
23ab6a283b Separate QueryInfo from QueryRegenerateEvent
this removes some useless and confusing APIs from query info.
2020-05-23 11:55:29 +01:00
Dylan K. Taylor
0025196a81 Merge branch 'next-minor'
# Conflicts:
#	resources/vanilla
#	src/network/upnp/UPnP.php
2020-05-23 11:16:19 +01:00
Dylan K. Taylor
14dd7f306b Merge commit '45c89d084'
# Conflicts:
#	resources/vanilla
#	src/command/defaults/TimeCommand.php
2020-05-23 11:14:12 +01:00