13637 Commits

Author SHA1 Message Date
Dylan K. Taylor
61b7faae08
Simplify BaseInventoryTest 2021-08-04 21:01:01 +01:00
Dylan K. Taylor
00984c1b9f
BaseInventory: Move contents of InventoryHelpersTrait back inline
I moved these to a trait in anticipation of having multiple full Inventory implementations. That's no longer necessary because of the abstraction of SimpleInventory.
2021-08-04 20:57:20 +01:00
Dylan K. Taylor
bb79797b68
WhitelistCommand: fixed permission checking
closes #4349
2021-08-04 20:34:54 +01:00
Dylan K. Taylor
71c6f69fd3
Command: standardise permission checking
if subcommands had different permissions, the permissionMessage would not be used.
2021-08-04 20:29:07 +01:00
Dylan K. Taylor
efb677d5d5
Merge branch 'stable' 2021-08-03 20:22:17 +01:00
Dylan K. Taylor
748e9705ba
Updated build/php submodule to pmmp/php-build-scripts@49971716b0 2021-08-03 20:20:56 +01:00
Dylan K. Taylor
50b4ec0d20
Override timeout for the subprocess also 2021-08-03 18:50:36 +01:00
Dylan K. Taylor
16965fa742
ConsoleReaderThread: override default socket timeout for accept
otherwise, people can break the console reader by setting the default timeout to zero or some other small value.
2021-08-03 18:48:18 +01:00
Dylan K. Taylor
c567ed4b7a
fix build error 2021-08-03 15:32:21 +01:00
Dylan K. Taylor
565cf84e1b
MemoryManager: use typed properties 2021-08-03 15:13:28 +01:00
Dylan K. Taylor
dcd203370b
Player: make use of typed properties
readability significantly benefits from use of typed properties here.
2021-08-03 15:02:32 +01:00
Dylan K. Taylor
8221475ce2
BlockDataSerializer: fix wrong exception type being thrown 2021-08-02 19:20:19 +01:00
Dylan K. Taylor
bdac98beaf
Block: get rid of getNonPersistentStateBitmask(), add writeStateToItemMeta()
this is more flexible and less confusing.
2021-08-02 19:17:24 +01:00
Dylan K. Taylor
01b48a21d9
Simplify NetworkSession ticking
we need to tick sessions every tick anyway, because other stuff is happening (e.g. sync attributes/entity metadata, batch buffer flush).
2021-08-02 14:32:00 +01:00
Dylan T
eb23d27004 composer: accept ext-leveldb ^0.3.0 2021-07-31 18:11:34 +01:00
Sensei Tarzan
1bbf739385
the function stringToLegacy gives already null useless to put a default null (#4338) 2021-07-31 16:54:31 +01:00
Dylan K. Taylor
22c3736d63
LightUpdate: micro optimisations opcache isn't smart enough for
this removes 6 unnecessary opcodes from computeSpreadLight() and 3 from computeRemoveLight(). Tested with opcache.opt_debug_level=0x20000.
2021-07-30 23:30:28 +01:00
Dylan K. Taylor
3319fad863
Fix build error 2021-07-26 20:33:44 +01:00
Dylan K. Taylor
2b5667a56b
Move PHP minimum to 8.0 2021-07-26 20:29:39 +01:00
Dylan K. Taylor
09eac0e129
Merge remote-tracking branch 'origin/stable' 2021-07-26 20:14:33 +01:00
Dylan K. Taylor
f9863acadc
Restart console reader subprocess if it dies
this can happen for a bunch of different reasons, which are all indistinguishable. This also fixes pmmp/PcntlSignalHandler#3.
2021-07-26 15:38:38 +01:00
Dylan T
c2c9132812 ConsoleReaderThread: say what actually happened when we fail to read commands 2021-07-26 15:17:24 +01:00
Dylan T
c7bb77e24a ConsoleReaderChildProcess: die voluntarily if connection to server process is closed
this happens if the parent process is killed via SIGINT, because its stdin will be closed, interrupting a blocking read. This might also happen if the user pressed CTRL+D, so we don't die unless end of socket stream was also detected.

closes #4335
2021-07-26 15:07:47 +01:00
Dylan K. Taylor
01fe497c49
phpstan: use PHP 8.0 as primary version
I'm using 8.0 for local development now, so having the phpstan configs targeted at 7.4 by default makes things inconvenient.
2021-07-26 14:34:47 +01:00
Dylan T
1afda04620 PrimedTNT: fixed fuse not getting updated client-side, closes #4333 2021-07-25 12:27:25 +01:00
Dylan K. Taylor
8f01caf335
Merge branch 'stable' 2021-07-24 22:42:06 +01:00
Dylan K. Taylor
3bbd088a09
Update build/php submodule to pmmp/php-build-scripts@280dd0524a 2021-07-24 22:40:28 +01:00
Dylan T
1246d1b7ef
Use a subprocess for reading lines from STDIN (#4332)
this FINALLY provides us with a way to deal with Windows without needing to forcibly terminate the entire server on shutdown.
2021-07-24 22:10:50 +01:00
Dylan K. Taylor
772935cd7e
Updated biome ID constants 2021-07-23 22:39:54 +01:00
Dylan K. Taylor
58498c2b0b
Merge remote-tracking branch 'origin/stable' 2021-07-23 16:40:19 +01:00
Dylan K. Taylor
f89e10e684
Silence openssl_free_key() deprecation warnings on 8.0
we don't give a shit and these calls are currently needed for 7.4.
2021-07-23 16:30:22 +01:00
Dylan K. Taylor
85effa5240
Remove junk from php8 baseline 2021-07-23 15:56:06 +01:00
Dylan K. Taylor
81c5b83bd9
actions: test on 8.0 2021-07-23 15:55:01 +01:00
Dylan T
ef31a9fc66
Update bug_report.md 2021-07-23 13:32:18 +01:00
Dylan K. Taylor
dc56a99473
3.22.2 is next 2021-07-23 13:03:27 +01:00
Dylan K. Taylor
9477034a4a
Release 3.22.1 3.22.1 2021-07-23 13:03:27 +01:00
Dylan K. Taylor
5844b59b12
Fixed incorrect encoding of NpcDialoguePacket
this is in fact an ActorUniqueID, but for some reason written as a uint64 instead of a varint.
2021-07-23 12:53:30 +01:00
Dylan T
0eb4231b51
Use OpenSSL for ECDH during client login, drop mdanter/ecc (#4328)
This brings a significant performance improvement to login sequence handling, reducing CPU cost of `PrepareEncryptionTask` by over 90% and `ProcessLoginTask` by over 60%. It also allows us to shed a dependency.
2021-07-22 23:04:00 +01:00
Dylan K. Taylor
3af18917f0
Player: remove note about bans from getUniqueId()
while it's true that you might be able to skip the CPU waste from verifying a player's login just to find out that they are banned, this is generally a minority case anyway, so it doesn't make a lot of difference overall. This additional note is essentially a recommendation premature optimisation, which will likely lead to people making security mistakes.
2021-07-22 22:14:14 +01:00
Dylan K. Taylor
61528393c2
Player: rewrite the confusing documentation of getUniqueId() 2021-07-22 21:14:31 +01:00
Dylan K. Taylor
59b8453228
Player: added extra debug message for XUID mismatches 2021-07-22 21:04:40 +01:00
Dylan K. Taylor
83016a97bd
Added getMushroomBlockType() / setMushroomBlockType() APIs to Red/BrownMushroomBlock 2021-07-22 19:13:26 +01:00
Dylan K. Taylor
41d9bf8a2e
PthreadsChannelWriter: remove unused import 2021-07-22 19:08:21 +01:00
Dylan K. Taylor
832a156fc7
RakLib: split PthreadsChannelWriter into two implementations
this gains a very small performance improvement by avoiding unnecessary !== null checks on every packet written in either direction. It's insignificant for sure, but I just found this code in an old stash, so what the heck.
2021-07-22 18:52:58 +01:00
Dylan K. Taylor
5c609cc1c1
Added getShape() and setShape() APIs to StraightOnlyRail and Rail 2021-07-22 18:37:30 +01:00
Dylan K. Taylor
e97234d420
Refactor Rail handling to allow LSP-complaint shape handling
the reason there hasn't been any API until now is because of how inconvenient it was to expose a LSP-compliant API _and_ use the same base class for handling all the connection logic. This commit fixes that problem by abstracting shape handling away from BaseRail entirely, so that now it deals exclusively with connections. Deciding the shape of rail to use is now the job of the subclasses.
2021-07-22 17:35:10 +01:00
Dylan K. Taylor
2476f40cc6
Rail: store shape instead of connections
shape is what we'll eventually expose on the API.
2021-07-22 16:45:42 +01:00
Dylan K. Taylor
77138c5c06
Living: changed bad parameter name 2021-07-22 15:46:08 +01:00
Dylan K. Taylor
e803ca0e06
Living: Limit vertical knockback to 0.4 by default
this will break non-standard use cases with large forces, but they only have to stick a 'null' at the end of the parameter list.
Since this function should be primarily used for vanilla knockback, it makes more sense to keep the default as vanilla, but allow people to change it if they want to.

closes #4106 (this is close to #4106 anyway, but small enough that it was easier to recreate it than pull and modify it)
closes #2707
2021-07-22 14:27:20 +01:00
Dylan K. Taylor
3466fbe3e3
MemoryManager: remove unused variable declaration
it's overwritten further down anyway.
2021-07-21 19:25:01 +01:00