33 Commits

Author SHA1 Message Date
Dylan K. Taylor
53d7ed2b5c
these tests are now done by pocketmine/bedrock-protocol 2021-07-14 20:39:32 +01:00
Dylan K. Taylor
1ad38d499c
Deglobalize ItemTypeDictionary usage, at least for the protocol
while this is a bit hacky outside of the protocol namespace, it makes it much easier to use the protocol library for alternative purposes, such as for a client or MITM proxy.
It also removes all but one remaining core dependency of the protocol library, making it very close to being able to be separated from the server core entirely.
2021-07-14 14:26:32 +01:00
Dylan K. Taylor
0312b62c8a
DataPacket no longer keeps its own serializer
since a while ago, we're anyway just discarding the internal buffer anyway when the packet is repeatedly encoded, so this doesn't serve any advantage anymore.
We do need a system to be able to reuse encoded packet buffers, but right now we're not reusing them anyway.
2021-04-09 15:37:58 +01:00
Dylan K. Taylor
8d5cc9adc3
Merge branch 'stable' 2021-02-07 20:57:19 +00:00
Dylan K. Taylor
c5bdd7dd64
Added a unit test to ensure valid format of MINECRAFT_VERSION_NETWORK 2021-02-04 22:36:40 +00:00
Dylan K. Taylor
73a8c90bee Merge remote-tracking branch 'origin/stable'
# Conflicts:
#	resources/vanilla
#	src/world/Explosion.php
#	tests/phpunit/item/ItemTest.php
#	tests/phpunit/world/format/io/region/RegionLoaderTest.php
#	tests/plugins/TesterPlugin/src/pmmp/TesterPlugin/tests/AsyncTaskMainLoggerTest.php
#	tests/plugins/TesterPlugin/src/pmmp/TesterPlugin/tests/AsyncTaskMemoryLeakTest.php
2020-11-01 14:21:47 +00:00
Dylan K. Taylor
500fd2d842 tests: strip useless phpdoc 2020-10-26 15:59:17 +00:00
Dylan K. Taylor
0aee39027e Merge branch 'stable' into master
# Conflicts:
#	composer.lock
#	resources/vanilla
#	src/entity/Living.php
#	src/pocketmine/Player.php
#	src/pocketmine/VersionInfo.php
#	src/pocketmine/block/Potato.php
#	src/pocketmine/block/Sugarcane.php
#	src/pocketmine/entity/Entity.php
#	src/pocketmine/item/Item.php
#	src/pocketmine/level/format/Chunk.php
#	src/pocketmine/level/format/io/leveldb/LevelDB.php
#	src/world/generator/GeneratorRegisterTask.php
#	tests/phpstan/configs/check-explicit-mixed-baseline.neon
#	tests/phpstan/configs/l7-baseline.neon
#	tests/phpstan/configs/l8-baseline.neon
#	tests/plugins/TesterPlugin/src/pmmp/TesterPlugin/tests/AsyncTaskMainLoggerTest.php
#	tests/plugins/TesterPlugin/src/pmmp/TesterPlugin/tests/AsyncTaskMemoryLeakTest.php
#	tests/plugins/TesterPlugin/src/pmmp/TesterPlugin/tests/AsyncTaskPublishProgressRaceTest.php
2020-09-04 01:43:52 +01:00
Dylan K. Taylor
81c1613e5d StupidJsonDecodeTest: added a callable prototype
for some reason this causes a new error to be reported which previously didn't show. I have no idea why.
2020-08-31 13:45:46 +01:00
Dylan K. Taylor
798efc370c PacketBatch: get rid of putPacket() 2020-07-22 15:24:08 +01:00
Dylan K. Taylor
30591d047c PacketBatch: added a getPackets() method which encapsulates some logic 2020-07-01 13:38:06 +01:00
Dylan K. Taylor
c618932d25 Eliminate usages of BinaryStream->setBuffer() and BinaryStream->reset() 2020-06-17 13:49:43 +01:00
Dylan K. Taylor
9c46a1f141 Rename Packet->getBinaryStream() -> Packet->getSerializer() 2020-06-17 11:33:59 +01:00
Dylan K. Taylor
6c096c44aa Rename NetworkBinaryStream -> PacketSerializer 2020-06-17 11:31:13 +01:00
Dylan K. Taylor
0b6d6306cf LoginPacket: fixed error handling edge case with malformed chain data JSON 2020-05-06 21:46:35 +01:00
Dylan K. Taylor
a97cafd4f6 moving serializers into protocol namespace 2020-04-27 13:54:39 +01:00
Dylan K. Taylor
1b26cf1df9 break the hard cycle between mcpe\handler and mcpe\protocol
preparing to move mcpe\protocol to a separate library
2020-04-23 15:38:11 +01:00
Dylan K. Taylor
5c2ae0257c DataPacket: inject buffer via parameter instead of class field (packet & stream separation, step 2)
this is not complete yet, but the final change (having the binarystream actually come from outside) is a little more disruptive, and some extra changes need to be made. This will grant some sanity in the meantime without breaking too much stuff.
2020-02-25 16:19:11 +00:00
Dylan K. Taylor
bd00ee5038 Merge branch 'stable' 2020-02-24 22:11:13 +00:00
Dylan K. Taylor
04581e2700 DataPacket: account for splitscreen header when decoding 2020-02-24 21:20:25 +00:00
Dylan K. Taylor
fb1126797a Merge branch 'stable' 2020-02-07 18:13:55 +00:00
Dylan K. Taylor
532dc0fb6f tests/phpunit: populate iterable types for phpstan 2020-02-06 13:11:56 +00:00
Dylan K. Taylor
e12618c705 tests/phpunit: added missing native typehints 2020-02-06 12:13:42 +00:00
Dylan K. Taylor
464b2116a6 Merge remote-tracking branch 'origin/stable' 2019-10-01 14:41:54 +01:00
Dylan K. Taylor
8a6381c3fa StupidJsonDecodeTest: add some extra test vectors 2019-10-01 13:25:20 +01:00
Dylan K. Taylor
735efeaa13 Merge branch 'stable' 2019-09-26 11:30:36 +01:00
Dylan K. Taylor
d0d61597c7 StupidJsonDecodeTest: use getClosure() instead of traditional mess
this is faster and requires less code.
2019-09-26 11:28:40 +01:00
Dylan K. Taylor
15694279c7 Merge branch 'stable' 2019-09-18 13:30:58 +01:00
Dylan T
d724374d1a
StupidJsonDecodeTest: add failing test case for #3113 2019-09-16 15:53:00 +01:00
Dylan K. Taylor
e82a40b2ba forgot to stage this for b18bd4f33ce606ad594b56dd4785b650d21cd695 2019-06-18 17:37:38 +01:00
Dylan K. Taylor
57219abc9d fix test failure 2019-05-18 20:20:33 +01:00
Dylan K. Taylor
9ad30e239a Merge branch 'release/3.2' 2018-08-19 10:37:20 +01:00
Dylan K. Taylor
bfa415e108 Add unit tests for json decoding hack 2018-08-19 10:30:52 +01:00