14864 Commits

Author SHA1 Message Date
ipad54
337e462c8f
Added new banner patterns (#6298) 2024-03-25 10:52:21 +00:00
ipad54
b680a1693c
Added sound when picking sweet berries (#6287) 2024-03-19 10:18:30 +00:00
Dylan T
0e5395c59b
PocketMine-MP.phar self-extraction to decompressed cache (#6217)
Because ext-phar sucks, tmp gets spammed by cache files for every thread when loading files from the phar on the fly.

Instead, we convert the `.phar` into a decompressed `.tar` in the tmp directory and require files from inside it. Surprisingly, this works because `ext-phar` supports `tar` and `zip` natively. No stream wrapper is required, as the `PocketMine.php` bootstrap loads files relative to its location, so the cache is automatically used for everything.

To be honest I would rather get rid of phars entirely, but they are still the easiest way to have PhpStorm load PocketMine-MP API information for now, and the alternatives are more complicated and inconvenient.

### Caveats
Everywhere that previously used `new Phar(Phar::running(false))` in the core code needs to be updated to use `PharData` for this to work correctly. Plugins don't need to do anything.

### Why not just use `Phar::decompressFiles()`?
This requires setting `phar.readonly` to `0`, which is a security issue. Technically, we could have used a subprocess to do this, but it just didn't seem right.

### WTF? `phar://` can be used on `tar` files???
Yup. I was just as surprised to find out that `require` works in such contexts.

### Relevant issues
- Closes #6214 

## Changes
### API changes
None.

### Behavioural changes
Server startup will be slightly slower, as the phar has to decompress and convert itself into a `.tar`. However, testing showed that this generally takes less than 200 ms, so it should be barely noticeable.

## Backwards compatibility
No BC issues.

## Tests
Locally tested and the CI will also verify
2024-03-18 16:48:17 +00:00
Dylan K. Taylor
f527a4c8fe
Added --no-log-file command line option
while this would be more user-friendly as a config option, configs are a pain because they aren't initialized until after the server log has already been set up.
In any case, I foresee that people will likely want to bake this into Dockerfiles directly anyway.
2024-03-15 17:53:50 +00:00
Dylan T
7148c7a222
Log rotate (#4032)
`server.log` is not rotated by default and grows unmanageably large, to the point where it's so huge that it's not possible to read it with any standard text editor anymore.

This PR implements automatic log rotation. 
- When the `server.log` reaches 32MB in size, it's moved to the `log_archive/` folder of the server's data folder.
- The archive's file name will look something like this: `server.2024-03-15T15.26.24.0.log`
- The file's name contains the date and time when the file was archived. This may be useful if you're trying to find logs from a particular time frame.

This has several benefits:
- Much more easily find logs from a particular time frame without scrolling through GBs of logs
- Free up space without stopping the server - Archived log files in `log_archive/` can be safely deleted and/or modified while the server is running

If you want to automatically compress or clean up the log files, I suggest an external cron job or disk watcher.

Closes #4029.
2024-03-15 16:44:37 +00:00
Dylan K. Taylor
e31fd122d9
BlockStateReader: micro optimize unread properties check
this has a pretty much insignificant performance impact, but reduces the cost of this check to basically 0.
2024-03-14 17:54:26 +00:00
Dylan K. Taylor
a835069564
Merge remote-tracking branch 'origin/stable' into minor-next 2024-03-14 12:47:04 +00:00
Dylan K. Taylor
b77193b987
ZlibCompressor: Increase max decompression size to accommodate larger skins
again, very annoying that we have to account for this (it makes it easier for attackers to waste CPU time and memory), but we don't really have much of a choice.
2024-03-14 12:34:30 +00:00
Dylan K. Taylor
11ca208d93
RakLib: Allow larger number of split packet parts
some persona skins are insanely bloated and get split into hundreds of parts.
it's quite annoying that we have to accommodate this, but we can't keep allowing players to experience login timeouts without an obvious indication what's wrong.
2024-03-14 12:32:26 +00:00
Dylan K. Taylor
7ff0ae19d6
BlockStateUpgrader: a simple yet hard-to-explain optimization
Prior to this commit, upgrade schemas would be applied to blockstates with the same version, as there wasn't any way to know if they should be applied or not given Mojang's tendency to forget to bump the version.
However, it occurred to me that we only need to do this if there are multiple schemas present for the same version ID, which is rarely the case.
This allows skipping costly logic for blockstates on the newest version (the common case), reducing the time taken to process the blockstate for upgrading by over 30%.
Overall, this translates into less than 10% real performance improvement for chunk loading, but it's still a worthwhile improvement.
2024-03-13 18:19:51 +00:00
Dylan K. Taylor
1de66cb0de
RegistryTrait: added fast path optimization
this reduces VanillaBlocks access time from 360 ns to 230 ns on my machine - an improvement of about 35%.
2024-03-13 17:11:06 +00:00
Dylan K. Taylor
9f3533d870
Improved logging for block decode errors
this is still noisy, but less so than before.
this also adds logging to places where it was previously missing.
2024-03-13 16:42:23 +00:00
Dylan K. Taylor
2d24fac067
5.13.1 is next 2024-03-13 14:59:21 +00:00
Dylan K. Taylor
f193a990b0
Release 5.13.0 2024-03-13 14:59:21 +00:00
Dylan K. Taylor
c11c0679e3
Fix CS 2024-03-13 14:55:54 +00:00
Dylan K. Taylor
ba48f258f3
Support for 1.20.70 2024-03-13 14:53:27 +00:00
Dylan K. Taylor
e105c9bd76
5.12.2 is next 2024-03-13 13:48:59 +00:00
Dylan K. Taylor
23f4632409
Release 5.12.1 2024-03-13 13:48:56 +00:00
Dylan K. Taylor
a6202d0442
BlockStateUpgrader: calculate output version ID in a less stupid way
this improves the performance by a conservative 10%.
2024-03-12 11:48:48 +00:00
Dylan K. Taylor
8ec304e66e
BlockStateUpgradeSchema: avoid unnecessary property access and calculation
this was costing a surprisingly large 5-10% of the processing time for blockstate data.
2024-03-12 11:45:08 +00:00
Dylan K. Taylor
ac8dbf8640
BlockStateUpgrader: extract state remap to its own function 2024-03-06 12:56:49 +00:00
Dylan K. Taylor
dbc7105e5b
Merge branch 'resource-pack-ack-receipts' into minor-next 2024-03-04 15:46:31 +00:00
Dylan K. Taylor
3b97d067a3
Merge remote-tracking branch 'origin/stable' into minor-next 2024-03-04 15:40:10 +00:00
Dylan K. Taylor
5cb69e00d0
NetworkSession: remove hardcoded limit
this is already covered by the dynamic Game Packets rate limit, which is much more effective at dealing with this anyway.
2024-03-04 14:36:40 +00:00
Dylan K. Taylor
781e3643dd
Clean up 2024-03-04 14:25:47 +00:00
Dylan K. Taylor
72f3c0b4b9
NetworkSession: fixed timings not being stopped when handling uncompressed packets 2024-03-01 17:36:40 +00:00
Dylan K. Taylor
b9a1ef1357
Throttle resource pack sending using ack receipts
this isn't the best solution, as it limits the download speed somewhat, but it's relatively simple and works quite well.
closes #3127
2024-03-01 17:07:19 +00:00
Dylan K. Taylor
4abc36275c
Remove newline 2024-03-01 17:02:44 +00:00
Dylan K. Taylor
4b5ac53276
Fixes 2024-03-01 17:01:32 +00:00
Jason Wynn
90409b50d1
Allow offering different resource packs to different players (#6249)
closes #6248
2024-03-01 14:53:59 +00:00
Dylan K. Taylor
bc2abf4b15
First shot at packet ack receipt support
this will be useful for preventing resource pack sending from overloading the network.
it's not the best solution for that (since it means the RTT will limit the pack download speed), but it's easier than implementing congestion control and will work fine in most cases.
2024-03-01 14:41:53 +00:00
Dylan K. Taylor
b2c97cf2f1
5.12.1 is next 2024-02-28 18:14:41 +00:00
Dylan K. Taylor
a35c3406a8
Release 5.12.0 2024-02-28 18:14:37 +00:00
Dylan K. Taylor
98042f844f
Merge remote-tracking branch 'origin/stable' into minor-next 2024-02-28 17:36:21 +00:00
Dylan K. Taylor
a0cca53f52
Fixed mismatched predictions due to NBT key order differences
this is a pain :(
It appears the client always sorts the keys in alphabetical order due to use of std::map. However I'm not sure of the exact ordering behaviour, so it needs to be investigated.
2024-02-27 16:07:43 +00:00
Dylan K. Taylor
efd113bdc8
Integrate pmmp/BedrockProtocol@65b3d0b341 2024-02-26 17:09:09 +00:00
Dylan K. Taylor
34a5f91aa9
5.11.3 is next 2024-02-26 14:45:48 +00:00
Dylan K. Taylor
aee3656415
Release 5.11.2 2024-02-26 14:45:47 +00:00
Dylan K. Taylor
47f0119660
InGamePacketHandler: added an extra check 2024-02-26 14:35:21 +00:00
Dylan K. Taylor
b744e09352
5.11.2 is next 2024-02-23 14:19:02 +00:00
Dylan K. Taylor
7b89dda420
Release 5.11.1 2024-02-23 14:19:01 +00:00
Dylan K. Taylor
db665fefdb
Harden JsonMapper defaults in general 2024-02-23 14:10:24 +00:00
Dylan K. Taylor
6872661fd0
Harden JsonMapper on login JSON handling 2024-02-23 14:10:02 +00:00
IvanCraft623
920341668f
Implemented working Name tag (#5209) 2024-02-19 18:46:48 +00:00
Dylan K. Taylor
4fab518384
PluginManager: do not accept generator functions as event handlers
closes #4912

I didn't merge the original PR because this needs to be checked for explicitly registered handlers as well as auto-detected ones from listeners.
2024-02-19 16:53:53 +00:00
Dylan K. Taylor
2616d8c5ad
New biome IDs, courtesy of build/generate-biome-ids 2024-02-19 16:10:46 +00:00
Javier León
db894e3a4a
Fixed Utils::cloneObjectArray() template signature (#6255) 2024-02-16 16:52:10 +00:00
Dylan K. Taylor
d211392b67
Merge remote-tracking branch 'origin/stable' into minor-next 2024-02-12 11:46:48 +00:00
Dylan K. Taylor
eaab1a8784
ChunkSerializer: fixed count calculation for non-overworld chunks
plugins that implement dimensions can't change the number of subchunks used by Chunk, they can only choose to use a subset of them.
2024-02-07 18:58:41 +00:00
Dylan K. Taylor
169d3e0de8
5.11.1 is next 2024-02-07 13:01:30 +00:00