12810 Commits

Author SHA1 Message Date
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
Dylan K. Taylor
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
Dylan K. Taylor
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
Dylan K. Taylor
011d1713c0 [ci skip] changelog updates 2020-11-28 18:33:08 +00:00
Dylan K. Taylor
b40720749b ZippedResourcePack: improved exception error on invalid manifest contents 2020-11-28 18:29:13 +00:00
Dylan K. Taylor
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
Dylan K. Taylor
4439781124 Merge branch 'stable'
# Conflicts:
#	resources/vanilla
#	src/event/player/PlayerCreationEvent.php
2020-11-28 16:16:15 +00:00
Dylan K. Taylor
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
Dylan K. Taylor
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
Dylan K. Taylor
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
Dylan K. Taylor
ecbc4e9433 Permission->getChildren() no longer returns by-ref 2020-11-27 20:31:59 +00:00
Dylan K. Taylor
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
Dylan K. Taylor
3849756993 Do not mutate the result of Permission->getChildren() 2020-11-27 20:28:36 +00:00
Dylan K. Taylor
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
Dylan K. Taylor
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
Dylan K. Taylor
ab18332572 PermissionManager: fixed nonsensical PHPDoc type 2020-11-27 19:54:05 +00:00
Dylan K. Taylor
c454441646 [ci skip] updated changelog 2020-11-27 18:54:09 +00:00
Dylan K. Taylor
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
Dylan K. Taylor
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
Dylan K. Taylor
5142281cfa [ci skip] Server: remove misleading comment 2020-11-27 17:57:52 +00:00
Dylan T
48595630fc
[ci skip] update crash issue template 2020-11-27 17:38:14 +00:00
Dylan K. Taylor
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
Dylan K. Taylor
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
Dylan K. Taylor
4d42f0c3db Timings: added timers for player data I/O 2020-11-27 00:02:34 +00:00
Dylan K. Taylor
37ace19857 Updated netresearch/jsonmapper to 3.1.1 2020-11-26 23:39:57 +00:00
Dylan K. Taylor
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
Dylan K. Taylor
4ea5401d72 World->getHighestBlockAt() now throws an exception instead of returning -1 in ungenerated terrain 2020-11-26 19:44:22 +00:00
Dylan K. Taylor
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
Dylan K. Taylor
4102205ba6 Enhance type information in PlayerCreationEvent 2020-11-24 16:28:36 +00:00
Dylan K. Taylor
4520e425c1 Sync BedrockData submodule with merge
I forgot to commit this in the merge ...
2020-11-21 21:17:23 +00:00
Dylan K. Taylor
af1fe7c293 Merge branch 'stable' 2020-11-21 21:13:48 +00:00
Dylan K. Taylor
bc208e11f4 phpstan 0.12.57 2020-11-21 18:07:14 +00:00
Dylan K. Taylor
9e85ee4a7a Fixed missing field on Persona skin encode 2020-11-21 18:01:56 +00:00
Dylan K. Taylor
027ec129b6 Merge remote-tracking branch 'refs/remotes/origin/master' 2020-11-21 17:55:54 +00:00
Dylan K. Taylor
7b865dc5a9 Updated composer dependencies 2020-11-21 17:55:32 +00:00
Dylan K. Taylor
f2187477b1 Merge commit '8273f789ee785cda3269e3a9841e99241503dc4f'
# Conflicts:
#	resources/vanilla
#	src/utils/SingletonTrait.php
2020-11-21 17:49:07 +00:00
Dylan K. Taylor
d2b593edf8 Updated composer dependencies 2020-11-21 17:47:54 +00:00
Dylan K. Taylor
e8e6b9304c phpstan 0.12.57 2020-11-21 17:46:32 +00:00
Dylan K. Taylor
23849b7f63 3.16.1 is next 2020-11-21 01:25:06 +00:00
Dylan K. Taylor
d2f68836c6 Release 3.16.0 3.16.0 2020-11-21 01:25:06 +00:00
Dylan K. Taylor
d19db5d2e4 fix phpstan warnings 2020-11-21 01:16:04 +00:00
Dylan K. Taylor
98cdc80d37 Protocol changes for 1.16.100 2020-11-21 01:07:25 +00:00
Dylan K. Taylor
f2bdbb0c35 TypeConverter: fix using singleton to get its own context
I guess this must have been refactored from some other class?...
2020-11-20 21:31:06 +00:00
Dylan K. Taylor
8273f789ee Backport SingletonTrait to PM3 2020-11-20 21:00:47 +00:00
Dylan K. Taylor
870d237260 BlockFactory::get() second parameter is now mandatory 2020-11-18 00:50:01 +00:00
Dylan K. Taylor
29eccba5f0 Updated composer dependencies 2020-11-17 23:25:15 +00:00
Dylan K. Taylor
28335e3c45 Player: fixed self-defeating condition in item consuming
this was giving players infinite food and potions.
2020-11-17 20:33:20 +00:00
ipad54
6a1f551aab
[ci skip] update TileFactory TODOs (#3912) 2020-11-17 11:04:26 +00:00