Commit Graph

12774 Commits

Author SHA1 Message Date
87033592b1 Timings: remove obsolete timings handler 2020-12-01 17:40:09 +00:00
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
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
b550cf5163 phpunit 9.4.4 2020-12-01 17:32:27 +00:00
48fa19fdcd PermissionAttachmentInfo::__construct() never throws an exception 2020-12-01 17:30:35 +00:00
f28bdb5aa2 [ci skip] update changelog to reflect permission changes 2020-12-01 17:24:38 +00:00
6d8833ccd3 Removal of permission defaults (in favour of permission cascading) (#3937) 2020-12-01 17:13:54 +00:00
bac986d0b2 Fixed crash when executing command /version with multiple authors declared in 'author' (#3940)
closes #3902
2020-12-01 15:47:55 +00:00
215bac8dd7 phpstan 0.12.58 2020-11-30 22:11:43 +00:00
3709ba172b Sync composer dependencies 2020-11-30 22:02:01 +00:00
1eabc3fe75 NetworkStackLatencyPacket: added named constructors 2020-11-30 21:29:51 +00:00
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
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
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
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
3e9a37ca77 PermissionParser: remove unmaintained code 2020-11-28 20:51:09 +00:00
9867424117 [ci skip] reflect today's changes to Server in changelog 2020-11-28 19:35:12 +00:00
dd200ca8cd Rewrite message broadcasting system to not depend on PermissionManager subscriptions
relying on permission subscriptions for this was unreliable (a permissible is not always subscribed to a permission even when it does have it), and also difficult to control (for example there have been various bugs in the past where a Player ended up subscribed to broadcast permissions when it didn't expect to be, thanks to permission recalculation happening too early).
In addition, we might in the future want to have broadcast receivers which are not permissibles (i.e. a more general interface than CommandSender (why does a broadcast receiver need to also be a command sender, anyway?)), which the permission system wouldn't be suitable for.
2020-11-28 19:28:47 +00:00
ee7fad2271 PermissibleBase: fixed root permissible being unaware of changes in some cases
for example, Player->recalculatePermissions() was not called when a player's op status changed, nor when a permission attachment altered permissions (potential secvuln for broadcasting).
2020-11-28 19:22:30 +00:00
011d1713c0 [ci skip] changelog updates 2020-11-28 18:33:08 +00:00
b40720749b ZippedResourcePack: improved exception error on invalid manifest contents 2020-11-28 18:29:13 +00:00
c7961bfe90 Toss ServerOperator; PermissibleBase now tracks its own op status
as well as being simpler, this also allows some nice features, such as granting memory-only op state that goes away when the player quits the server.
2020-11-28 18:22:59 +00:00
4439781124 Merge branch 'stable'
# Conflicts:
#	resources/vanilla
#	src/event/player/PlayerCreationEvent.php
2020-11-28 16:16:15 +00:00
ef034f2d68 PermissionAttachment: better document the apparently nonsensical code responsible for making sure the entire permission system doesn't burn down 2020-11-28 16:05:16 +00:00
8cf589eedd Strip some junk out of IPlayer
these methods have better pathways through Server directly.
Also, setBanned() does not allow customising the reason for banning or the duration, nor does isBanned() account for IP bans because the code is so old ... better to force dependence on a central code path to avoid these inconsistencies.
I want to do the same thing for OP, but that's a separate problem due to its effects on the permission system.
2020-11-28 15:36:46 +00:00
70b0d83258 Removed Server->broadcast()
this method has an explicit dependency on permission subscriptions, which I plan to eradicate.
The method's functionality can be replaced using Server->broadcastMessage() with a custom recipients array.
2020-11-28 13:01:10 +00:00
ecbc4e9433 Permission->getChildren() no longer returns by-ref 2020-11-27 20:31:59 +00:00
aa67c4894f Permission: added removeChild()
this probably isn't useful at all, but it's best to provide alternatives for all the stuff that getChildren() could have been used for ...
2020-11-27 20:31:24 +00:00
3849756993 Do not mutate the result of Permission->getChildren() 2020-11-27 20:28:36 +00:00
f0e43a6b22 DefaultPermissions: remove ridiculous recursion
this line is totally useless since the recursion does exactly the same thing as if it wasn't there.
2020-11-27 19:59:49 +00:00
1de486733a Permission: remove dead code
Bukkit CCC at its finest... what the fuck this was doing anyway I have no idea
an addChild() method would have made far more sense, especially considering that addParent() doesn't actually mutate the child.
2020-11-27 19:56:39 +00:00
ab18332572 PermissionManager: fixed nonsensical PHPDoc type 2020-11-27 19:54:05 +00:00
c454441646 [ci skip] updated changelog 2020-11-27 18:54:09 +00:00
9969c928a8 Player: Improved hardcore death handling
it's now possible to cancel the banning by cancelling PlayerKickEvent.
In addition, the disconnect message will now properly explain why the player is banned instead of just saying 'You have been banned',
and also banned-players.txt will show 'Died in hardcore mode' as the reason instead of being completely blank (seriously, we couldn't tell the difference between real bans and hardcore bans????)
2020-11-27 18:37:42 +00:00
5e44d5f75e Do not load playerdata from disk just to op/deop/whitelist/dewhitelist
this is an impressively dumb idea.
the playerdata is not used here in any capacity so it doesn't make sense to load it, especially considering that it takes a significant amount of time.
2020-11-27 18:12:45 +00:00
5142281cfa [ci skip] Server: remove misleading comment 2020-11-27 17:57:52 +00:00
48595630fc [ci skip] update crash issue template 2020-11-27 17:38:14 +00:00
0a7d81a2b0 FastChunkSerializer: retain emptyBlock on subchunks
I think we should probably get rid of this considering the potential for inconsistencies within a chunk, but not retaining this is a bug nonetheless, even though it doesn't have any effect in PM itself since we always use BlockLegacyIds << 4 as the empty block ID.

so, this is only really aiding (ab)use cases which weren't intended anyway ...
2020-11-27 13:41:35 +00:00
4e94025b3b SubChunk: rename defaultBlock -> emptyBlockId
this better describes the purpose, which is to identify air.
though, it might make more sense to make air just always have zero as air's runtime ID, since this parameter is apparently making plugin devs think that this is suitable to fill a chunk with a specific block ...
2020-11-27 13:33:25 +00:00
4d42f0c3db Timings: added timers for player data I/O 2020-11-27 00:02:34 +00:00
37ace19857 Updated netresearch/jsonmapper to 3.1.1 2020-11-26 23:39:57 +00:00
0be60fe1eb NetworkSession: Force use of async compression during the login sequence when latency doesn't matter
closes #3907
this reduces the impact of compression on the login sequence by about 90%; however, since compression only accounted for about 30% of said overhead at most, it's not really a massive difference.
2020-11-26 23:39:19 +00:00
4ea5401d72 World->getHighestBlockAt() now throws an exception instead of returning -1 in ungenerated terrain 2020-11-26 19:44:22 +00:00
fd99445c5b World->getSafeSpawn() now throws if the target is in ungenerated terrain, instead of silently returning the default
this WILL cause crashes in some cases on slower machines (#2724), but it's
better than randomly spawning at the top of the map.
2020-11-26 19:36:37 +00:00
4102205ba6 Enhance type information in PlayerCreationEvent 2020-11-24 16:28:36 +00:00
4520e425c1 Sync BedrockData submodule with merge
I forgot to commit this in the merge ...
2020-11-21 21:17:23 +00:00
af1fe7c293 Merge branch 'stable' 2020-11-21 21:13:48 +00:00
bc208e11f4 phpstan 0.12.57 2020-11-21 18:07:14 +00:00
9e85ee4a7a Fixed missing field on Persona skin encode 2020-11-21 18:01:56 +00:00
027ec129b6 Merge remote-tracking branch 'refs/remotes/origin/master' 2020-11-21 17:55:54 +00:00