Dylan K. Taylor
2712befa82
SkinData: fixed capeImage type violation (doesn't accept null)
2020-06-15 23:51:48 +01:00
Dylan K. Taylor
a4e250a3e6
TextFormat: improved exception messages for PCRE failures
2020-06-15 23:43:01 +01:00
Dylan K. Taylor
23b97d8e2d
TextFormat: wrap all preg_replace() usages in a type-safe exception-throwing version
...
fixes 3 phpstan level 8 errors
2020-06-15 23:31:46 +01:00
Dylan K. Taylor
1fb5043eb1
build/server-phar: fixed a phpstan level 8 error
2020-06-15 23:16:40 +01:00
Dylan K. Taylor
b0b1b29de4
Chunk: specify list<int> for heightMap
2020-06-15 23:07:35 +01:00
Dylan K. Taylor
1c3b641e37
ChunkUtils: be more specific in extension stub too
2020-06-15 23:07:05 +01:00
Dylan K. Taylor
f3063e797f
ChunkUtils: provide a more explicit parameter type
2020-06-15 23:05:52 +01:00
Dylan K. Taylor
8dcc88712c
ChunkUtils: fixed phpstan level 7 type inference error
2020-06-15 23:04:12 +01:00
Dylan K. Taylor
04191ec44a
Rail: specify type for local static variable
...
fixes a phpstan level 7 error
phpstan doesn't make any assumptions about local static variable types because analysing them would require too much work, apparently.
2020-06-15 22:47:20 +01:00
Dylan K. Taylor
a381fc8848
sync composer dependencies
2020-06-15 22:24:44 +01:00
Dylan K. Taylor
62ea7c93a9
added a dedicated InvalidSkinException
2020-06-15 21:48:24 +01:00
Dylan K. Taylor
cf06b5b8cf
Player: explicitly check for false return of dataPacket()
...
fixes a phpstan error on l7
this won't ever actually be a problem, but this isn't obvious from the type system.
2020-06-15 21:24:19 +01:00
Dylan K. Taylor
a8ec51daac
Player: do not assign maybe-false result of json_encode() to ModalFormRequestPacket
...
fixes a phpstan error on l7
2020-06-15 21:22:33 +01:00
Dylan K. Taylor
3294075aad
LoginPacketHandler: use double quotes consistently
...
the mixture of single quotes and double quotes makes PHPStan type inference quietly not work, and reports an error here in checkExplicitMixed mode.
2020-06-15 20:31:09 +01:00
Dylan K. Taylor
7d73630fb7
Merge branch 'stable'
...
# Conflicts:
# resources/vanilla
# src/world/format/io/region/RegionGarbageMap.php
# src/world/format/io/region/RegionLoader.php
# tests/phpstan/configs/l7-baseline.neon
# tests/phpunit/world/format/io/region/RegionLocationTableEntryTest.php
2020-06-15 20:10:15 +01:00
Dylan K. Taylor
6a7b77fee2
first look at making region writes reuse old space
2020-06-15 18:36:54 +01:00
dependabot-preview[bot]
da42c8d020
Bump phpunit/phpunit from 9.2.2 to 9.2.3 ( #3588 )
2020-06-15 16:30:50 +00:00
Dylan K. Taylor
b902f9ded0
RegionLoader: fixed 2 phpstan level 7 errors (eof reading region header)
2020-06-15 15:09:37 +01:00
Dylan K. Taylor
9bb8a8f761
RegionLoader: added utility function getProportionUnusedSpace()
2020-06-15 13:49:03 +01:00
Dylan K. Taylor
63b14a083c
RegionLoader: added utility function generateSectorMap()
...
this proved very useful while debugging some internal issues.
2020-06-15 13:48:17 +01:00
Dylan K. Taylor
627a7c951a
RegionLoader: added missing const import
2020-06-15 13:46:03 +01:00
Dylan K. Taylor
bb2685ca65
RegionLocationTableEntry: cap firstSector at 16777216
...
this is the biggest sector start that the location table can represent, due to the binary format. Larger values than this will overflow and cause corruption.
This provides an effective limit of 64 GB on region files.
2020-06-15 13:23:08 +01:00
Dylan K. Taylor
d38709a7ae
RegionLoader: remove unused variable
2020-06-15 12:26:20 +01:00
Dylan K. Taylor
b559a65346
RegionLoader: account for possible corrupted header pointing to itself
2020-06-15 12:13:42 +01:00
Dylan K. Taylor
b92a2ded8a
RegionLoader: check for zero sector count when loading location table
...
implementations shouldn't be writing location entries that have an offset but zero sectors, but just in case they do, we need to be aware of it.
2020-06-15 12:08:55 +01:00
Dylan K. Taylor
22f25dfbdb
RegionLocationTableEntry: require sector count to be at least 1
2020-06-15 12:05:48 +01:00
Dylan K. Taylor
6bf840c72e
RegionLoader: use actual null instead of zeroed entry for non-allocated chunks
...
this forces the code to be properly aware of non-allocated chunks, because it'll crash with NPE if it isn't.
2020-06-15 12:02:03 +01:00
Dylan K. Taylor
745be19a56
RegionLoader: fixed regions ballooning when writing chunks to the end of file
...
we already have a region growth problem due to the lack of garbage collection, but this bug was making it worse. If the region already contained 1024 allocated chunks, 4MB of file space would get wasted before the next chunk would be appended to the file.
2020-06-14 23:40:33 +01:00
Dylan K. Taylor
e05bee5ffb
RegionLoader: do a full check for chunk overlaps during initial load
2020-06-14 22:39:01 +01:00
Dylan K. Taylor
a39fbe600d
Merge branch 'stable'
...
# Conflicts:
# phpstan.neon.dist
# resources/vanilla
2020-06-14 20:03:02 +01:00
Dylan K. Taylor
087ba0cc1d
phpstan: update config to use new 0.12.26+ options
2020-06-14 19:57:36 +01:00
Dylan K. Taylor
f55a7f8b53
Merge commit 'd8d994351'
...
# Conflicts:
# composer.lock
# resources/vanilla
# tests/phpstan/configs/l7-baseline.neon
2020-06-14 19:47:21 +01:00
Dylan K. Taylor
13031967f4
Merge commit '0029efa37'
...
# Conflicts:
# resources/vanilla
# src/pocketmine/Server.php
2020-06-14 19:36:50 +01:00
Dylan K. Taylor
9ce531fef4
(master) imports cleanup
2020-06-14 19:29:33 +01:00
Dylan K. Taylor
7d5607e72c
Merge commit 'df13e967f'
2020-06-14 19:28:20 +01:00
Dylan K. Taylor
d0c8d64b40
Merge commit '097c260db'
...
# Conflicts:
# resources/vanilla
# src/item/enchantment/Enchantment.php
# src/plugin/PluginDescription.php
# src/pocketmine/entity/Effect.php
# src/pocketmine/item/ItemFactory.php
# src/pocketmine/plugin/PluginManager.php
2020-06-14 19:28:05 +01:00
Dylan K. Taylor
d8d994351b
phpstan 0.12.29
2020-06-14 16:25:55 +01:00
Dylan K. Taylor
0029efa370
Server: add getPlayerDataPath(), reduce logic duplication
2020-06-14 12:40:24 +01:00
Eren A. Akyol
5f79071e4c
Registry Trait: fixed magic methods not working properly when system locale is tr_TR ( #3580 )
...
Fixed incorrect case of incorrect letters on operating systems using languages other than English. Like (Stair => STAİR)
2020-06-14 11:48:15 +01:00
Dylan K. Taylor
df13e967fd
imports cleanup
2020-06-14 10:27:15 +01:00
Dylan K. Taylor
097c260dbb
Eradicate all usages of strtoupper()
...
strtoupper() is an evil function whose behaviour depends on the system locale. mb_strtoupper() has more consistent behaviour.
2020-06-13 19:47:00 +01:00
Dylan K. Taylor
5f0f5236f8
RegistryTrait: fix crash when child classes don't define getAll()
2020-06-13 18:34:23 +01:00
Dylan K. Taylor
465285b3c2
do not rely on GameMode::getMagicNumber() to match protocol IDs
2020-06-13 12:26:17 +01:00
Dylan K. Taylor
5c16261374
Merge branch 'stable'
2020-06-13 11:59:05 +01:00
Dylan K. Taylor
f0669b7770
Merge commit '710c16260'
...
# Conflicts:
# resources/vanilla
# src/network/query/QueryInfo.php
2020-06-13 11:59:00 +01:00
Dylan K. Taylor
5a8633f6c0
Merge commit '409c8c170'
...
# Conflicts:
# resources/vanilla
2020-06-13 11:57:58 +01:00
Dylan K. Taylor
3bf47e33f0
Merge commit '376926c70'
...
# Conflicts:
# resources/vanilla
# src/command/defaults/TimingsCommand.php
2020-06-13 11:57:31 +01:00
Dylan K. Taylor
fab46f159b
Merge commit 'c3fabe833'
2020-06-13 11:56:26 +01:00
Dylan K. Taylor
430806cab3
Merge commit '3e09ff535'
...
# Conflicts:
# resources/vanilla
# src/block/tile/EnchantTable.php
2020-06-13 11:56:11 +01:00
Dylan K. Taylor
0d186fe42c
Merge commit '725506510'
...
# Conflicts:
# resources/vanilla
# src/pocketmine/level/format/io/leveldb/LevelDB.php
2020-06-13 11:55:10 +01:00