12807 Commits

Author SHA1 Message Date
Dylan K. Taylor
dde2e7e66f generation: drop AsyncWorker thread-local storage in favour of a more specialized storage 2020-12-03 19:28:22 +00:00
Dylan K. Taylor
999defd20d World: remove create params from loadChunk() and loadChunkAtPosition() 2020-12-03 18:49:14 +00:00
Dylan K. Taylor
a67f0d1f75 World->registerChunkLoader() no longer causes creation of an empty chunk
this only made sense to work around the server crashing when creating a player in ungenerated terrain, but spawning at y=256 is hardly preferable, and it'll crash since fd99445c5bbd2a5a6fdd0109d8a196ea6160e0a3 anyway ...
2020-12-03 18:41:53 +00:00
Dylan K. Taylor
1e7f9214cc Entity: flag for despawn if entering ungenerated terrain
previously this created an empty chunk for the entity to hang around in until the terrain was generated, but that's problematic for several reasons, most importantly the fact that non-generated chunks are not saved.
2020-12-03 18:36:54 +00:00
Dylan K. Taylor
ec2feeffcb World->populateChunk() no longer causes ChunkLoadEvent to fire with an empty chunk
instead, it will fire when the chunk comes out of PopulationTask and is set into the world using setChunk().
There is still one place left where auto-creation of empty chunks is used by the core, and that's an issue i'm still deciding how to deal with.
2020-12-03 18:23:03 +00:00
Dylan K. Taylor
fa9be2477d World: do not fire ChunkListener->onChunkChanged() when a new chunk is set
the documentation expressly describes a chunk being _replaced_ by a new chunk. This doesn't fit when the chunk didn't exist to begin with.
2020-12-03 18:20:43 +00:00
Dylan K. Taylor
74744fd498 World: fire ChunkLoadEvent in setChunk() if the chunk did not previously exist
I'm of two minds whether this should continue to fire onChunkChanged() on chunk loaders or not, since the chunks won't be referenced by any chunk loader anyway by virtue of not existing ...
2020-12-03 18:15:09 +00:00
Dylan K. Taylor
5197707d32 Separated TimingsRecord from TimingsHandler (different lifetimes)
this fixes #3906.
TimingsHandler will now be automatically destroyed when there are no TimingsRecord referencing it and its owner has no references left to it.
TimingsRecord will be automatically destroyed at the end of the timings session (if active).

This fixes records from temporary timers being lost after the timings handlers are removed, while also fixing TimingsHandlers piling up regardless of whether timings are running or not.
This opens the doors to have more volatile timers, such as per-player/per-session timers, which are destroyed on player quit, but which won't result in the timings disappearing from the final timings result.
2020-12-03 15:45:49 +00:00
Dylan K. Taylor
29f6ed3f68 Use Snooze to improve AsyncTask collection times
regardless of how long an async task takes to run, it will take a multiple of 50ms to get the result processed. This delay causes issues in some cases for stuff like generation, which causes locking of adjacent chunks, and async packet compression, which experiences elevated latency because of this problem.
This is not an ideal solution for packet compression since it will cause the sleeper handler to get hammered, but since it's already getting hammered by every packet from RakLib, I don't think that's a big problem.
2020-12-02 19:34:34 +00:00
Dylan K. Taylor
1775fb669b SurvivalBlockBreakHandler: fixed block break effects stopping beyond 4 blocks distance
this was actually intended to be 16 blocks ...
2020-12-02 18:56:39 +00:00
Dylan K. Taylor
0574b59df9 Network: fixed interfaces registered after raw packet handlers not respecting raw packet handler filters 2020-12-02 17:11:15 +00:00
Dylan K. Taylor
bc2fafca27 Fixed players losing all permissions when being de-opped after joining as op 2020-12-02 17:04:37 +00:00
Dylan K. Taylor
687ad28fa6 Added a PacketBroadcaster interface
this gives a bit more control over how packets are broadcasted, which might be useful if the batch format changes (e.g. adding a length prefix) for multi version.
This really ought to be unique to a protocol context instead of a network interface, but for now this is the best we can do.
2020-12-02 16:34:14 +00:00
Dylan K. Taylor
6001f69d52 Network->registerInterface() now returns whether the registration succeeded or not 2020-12-02 16:16:04 +00:00
Dylan K. Taylor
807474b3fb PermissibleBase: do not assign any permissions by default
there is no longer such a thing as a permission granted to 'everyone', since we're no longer limited to true/false/op/notop, and regular players are now assigned the pocketmine.group.user permission.
It's possible we might want to add more restricted groups than 'user' in the future, in which case it would be behaviour-BC-breaking to change the default assigned permissions when creating a new PermissibleBase. Therefore, it's better to not assign any permissions at all and let the caller decide.
In addition, this solves the problem of implied permission subscriptions and leak on PermissibleBase construction - if base permissions are provided, it should be expected that the permissible will subscribe to those permissions.
2020-12-02 15:56:54 +00:00
Dylan K. Taylor
05c52fef46 Updated DevTools submodule to pmmp/DevTools@7c2d05cafc 2020-12-02 14:41:28 +00:00
Dylan K. Taylor
b51c6e89b3 Introduced pocketmine.group.console
this is only used for /dumpmemory right now, but it's planned to be used for more stuff.
2020-12-02 13:35:48 +00:00
Dylan K. Taylor
c5e12bb11f PermissibleBase: simplify diff calculation 2020-12-02 11:29:45 +00:00
Dylan K. Taylor
506e76917e PermissionAttachmentInfo now includes a reference to the PermissionAttachmentInfo that caused its assignment (if any)
this allows plugins to easily identify which permission group caused a permission to be assigned (particularly if multiple groups might cause it).
2020-12-02 11:23:35 +00:00
Dylan K. Taylor
880635603c PermissibleBase: allow injecting more dynamic base permissions 2020-12-02 10:12:40 +00:00
Dylan K. Taylor
13e8854ec0 PermissibleBase: fixed express denying of a root permission not working
this only took effect when a permission was applied as a root. When overridden with a permission attachment, the problem did not manifest.
2020-12-02 01:39:43 +00:00
Dylan K. Taylor
f5bb5c1208 Permissible->recalculatePermissions() now returns a map of changed permissions with their old values 2020-12-02 01:13:19 +00:00
Dylan K. Taylor
0634426c26 PermissibleBase: compute permission diff, do not fire callbacks when diff is empty
this fixes AvailableCommandsPacket getting sent twice when adding a PermissionAttachment.
2020-12-02 01:09:29 +00:00
Dylan K. Taylor
6720e658bd Remove useless group permission nodes
the only value these have is for convenience, and a permission manager plugin can easily generate them by parsing the permission IDs.
2020-12-02 00:00:21 +00:00
Dylan K. Taylor
07dc0f2dd5 resource packs: added metadata to manifest models 2020-12-01 23:37:36 +00:00
Dylan K. Taylor
10067c1043 Improve painting performance
these really shouldn't hit the CPU at all considering they are simply static objects ...
2020-12-01 23:31:38 +00:00
Dylan K. Taylor
6d6f8c3c38 custom threads: use PTHREADS_INHERIT_NONE by default
this has the most reliable behaviour, because some stuff like respect/validation likes to include files unconditionally which declare functions that are already declared, which breaks due to the lack of function autoloading.
2020-12-01 22:32:59 +00:00
Dylan K. Taylor
541cfee615 RakLibServer: do not try to export exceptions across threads (they might contain Threaded objects whose references get invalidated) 2020-12-01 22:31:55 +00:00
Dylan K. Taylor
cc473184ac Player: added API method getUsedChunks() 2020-12-01 19:40:22 +00:00
Dylan K. Taylor
1905c01c87 PermissibleBase no longer circularly references its parent permissible
this was used for 2 things:
- to notify parent permissibles on recalculate permissions (not needed anymore thanks to callbacks)
- subscription to chat broadcast permissions (now handled separately, again using callbacks)

therefore, it's no longer needed for PermissibleBase to reference its parent, meaning that we can have one less circular dependency in our lives.
2020-12-01 18:46:39 +00:00
Dylan K. Taylor
341d8747b7 Living: wipe out effect add/remove hooks onDispose() 2020-12-01 18:27:10 +00:00
Dylan K. Taylor
8fb74258f4 Implemented a better method for detecting permission recalculation
this allows anyone to listen to permissions being recalculated, which is useful for stuff like broadcast channel subscriptions.
2020-12-01 18:23:42 +00:00
Dylan K. Taylor
c20893aa4b PermissibleBase: more robust cycle destruction 2020-12-01 17:57:55 +00:00
Dylan K. Taylor
87033592b1 Timings: remove obsolete timings handler 2020-12-01 17:40:09 +00:00
Dylan K. Taylor
d602547941 PermissionAttachmentInfo no longer references Permissible
since the only way to obtain PermissionAttachmentInfo via the API is from the Permissible API, it makes zero sense to ask the attachmentinfo for its permissible, since we obviously already had it to be able to get the info in the first place. Therefore, this is just another useless reference stopping Permissibles from being garbage-collected.
2020-12-01 17:38:30 +00:00
Dylan K. Taylor
d48af3f4ca Merge branch 'stable'
# Conflicts:
#	composer.lock
#	resources/vanilla
#	src/permission/BanEntry.php
#	src/permission/PermissionAttachmentInfo.php
2020-12-01 17:35:30 +00:00
Dylan K. Taylor
b550cf5163 phpunit 9.4.4 2020-12-01 17:32:27 +00:00
Dylan K. Taylor
48fa19fdcd PermissionAttachmentInfo::__construct() never throws an exception 2020-12-01 17:30:35 +00:00
Dylan K. Taylor
f28bdb5aa2 [ci skip] update changelog to reflect permission changes 2020-12-01 17:24:38 +00:00
Dylan T
6d8833ccd3
Removal of permission defaults (in favour of permission cascading) (#3937) 2020-12-01 17:13:54 +00:00
DerDevHD
bac986d0b2
Fixed crash when executing command /version with multiple authors declared in 'author' (#3940)
closes #3902
2020-12-01 15:47:55 +00:00
Dylan K. Taylor
215bac8dd7 phpstan 0.12.58 2020-11-30 22:11:43 +00:00
Dylan K. Taylor
3709ba172b Sync composer dependencies 2020-11-30 22:02:01 +00:00
Dylan K. Taylor
1eabc3fe75 NetworkStackLatencyPacket: added named constructors 2020-11-30 21:29:51 +00:00
Dylan K. Taylor
d56cf35385 Permissions are now always false when permission calculation hasn't been done yet
lack of permission calculation means that child permissions might not have been set correctly, so this might lead to users being able to access things they aren't supposed to.
2020-11-28 21:55:26 +00:00
Dylan K. Taylor
97a4d80854 PlayerDataSaveEvent: provide online player if possible, otherwise don't load offline data from disk for no reason (we already have it, that's the whole point of the event ...) 2020-11-28 21:43:23 +00:00
Dylan K. Taylor
614891f8a2 OfflinePlayer no longer depends on Server
it also doesn't provide stuff like isOnline() (you had to have a Server reference to get an OfflinePlayer anyway, just ask the Server if the player is online ...) and getPlayer().
2020-11-28 21:29:41 +00:00
Dylan K. Taylor
c102477f91 OfflinePlayer: remove more useless junk
to obtain an OfflinePlayer instance you had to have a server instance to start with, which means getServer() is pointless, and also that isOp() and setOp() (which can be removed thanks to the fact that OfflinePlayer is not a Permissible) can be done by just asking the server.
2020-11-28 21:16:04 +00:00
Dylan K. Taylor
3e9a37ca77 PermissionParser: remove unmaintained code 2020-11-28 20:51:09 +00:00
Dylan K. Taylor
9867424117 [ci skip] reflect today's changes to Server in changelog 2020-11-28 19:35:12 +00:00