Commit Graph

41 Commits

Author SHA1 Message Date
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
2bbb24fab7 Merge branch 'stable' 2021-06-08 20:00:08 +01:00
4bcc7e09cb PacketSerializer: fix unnecessary FQN 2021-05-29 14:24:48 +01:00
8171b18002 Separate ItemTypeDictionary implementation from initialization
we're not going to want implementation details like how it's setup getting in the way when we separate protocol from the core.
2021-05-29 14:24:05 +01:00
66622defae PacketSerializer: fix merge error 2021-04-11 16:49:57 +01:00
74d103a56f Merge remote-tracking branch 'origin/stable' 2021-04-11 16:36:39 +01:00
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
19f536d68a ... 2021-04-07 21:54:21 +01:00
1e6d97a157 Merge branch 'stable' 2021-04-07 21:25:39 +01:00
cd71fec53d fucking phpstorm 2020.3 and its broken autocomplete 2021-03-31 21:41:50 +01:00
5e8078f3dd PacketSerializer: Improved performance of item serialize/deserialize 2021-03-31 21:39:55 +01:00
72de45f0e9 Drop pocketmine/uuid for ramsey/uuid 2021-03-16 23:03:00 +00:00
3fe0adbd7f Merge branch 'stable' 2021-03-14 20:14:08 +00:00
8dd61df7ac Fixed server crash on truncated varint in packet header 2021-02-16 20:38:15 +00:00
af1fe7c293 Merge branch 'stable' 2020-11-21 21:13:48 +00:00
01b44ab0bc protocol: moved skin data types to their own namespace 2020-10-08 21:20:57 +01:00
1500668d4e imports cleanup 2020-07-25 19:21:22 +01:00
5910905e95 PacketBatch::getPackets() may throw PacketDecodeException 2020-07-22 15:38:24 +01:00
8402465fd2 PacketBatch is now immutable 2020-07-22 15:37:06 +01:00
798efc370c PacketBatch: get rid of putPacket() 2020-07-22 15:24:08 +01:00
30591d047c PacketBatch: added a getPackets() method which encapsulates some logic 2020-07-01 13:38:06 +01:00
7e6adc41f0 Merge 1.16 support into PM4 (with changes) 2020-06-26 22:21:09 +01:00
05bd92a94b Merge commit '60b26a7ea8939a85db9af0a99dd5a4b13e1a562d'
# Conflicts:
#	resources/vanilla
#	src/network/mcpe/protocol/serializer/PacketSerializer.php
2020-06-26 19:16:53 +01:00
d5db163208 protocol: added proper object wrappers for gamerules 2020-06-20 11:24:39 +01:00
11eb1f1c5e imports cleanup 2020-06-18 20:01:19 +01:00
55e6b2dfbc Merge commit '1c13ba565660e0985c08f2c6b59e26f8216f87e4'
# Conflicts:
#	resources/vanilla
#	src/network/mcpe/protocol/serializer/PacketSerializer.php
2020-06-17 21:14:04 +01:00
d58ea80dca Merge commit '130c55d9f1c3b350c2767f7656366e08a63cf1ad'
# Conflicts:
#	resources/vanilla
#	src/network/mcpe/protocol/serializer/PacketSerializer.php
#	src/network/mcpe/protocol/types/entity/EntityLink.php
#	tests/phpstan/configs/l8-baseline.neon
2020-06-17 21:03:45 +01:00
3cdf808da1 NetworkNbtSerializer: do not assume that this format is related to the disk little-endian format 2020-06-17 13:55:29 +01:00
9c46a1f141 Rename Packet->getBinaryStream() -> Packet->getSerializer() 2020-06-17 11:33:59 +01:00
6c096c44aa Rename NetworkBinaryStream -> PacketSerializer 2020-06-17 11:31:13 +01:00
c6557f0222 protocol: added a FixedItemIds class (this is fully auto-generated, unlike the one provided by the API)
this may be different from the IDs exposed on the API and shouldn't be used for anything outside the protocol.

TODO: we need to review the dynamicness of item numeric IDs and find out if it's possible for them to change based on StartGamePacket content. If they can, we might need to change this.
2020-06-17 11:06:26 +01:00
90b53149d7 Merge commit '5056754ce'
# Conflicts:
#	resources/vanilla
#	src/pocketmine/Player.php
2020-06-03 12:54:00 +01:00
73495f303e Merge commit '84f99ed41'
# Conflicts:
#	resources/vanilla
2020-05-20 20:10:30 +01:00
8f6ccb17fd Merge commit 'fd63f1919'
# Conflicts:
#	resources/vanilla
#	src/network/mcpe/protocol/serializer/NetworkBinaryStream.php
#	src/pocketmine/network/mcpe/protocol/StartGamePacket.php
2020-05-20 20:09:54 +01:00
486ce140d8 PacketBatch no longer extends NetworkBinaryStream
this removes a whole bunch of crap from its API that shouldn't have been exposed. In the future we should look at splitting this into reader/writer halves, but for now this is a step in the right direction.
2020-05-18 17:35:30 +01:00
b7cf4f01f9 remove utils\UUID, switch to pocketmine/uuid package 2020-05-11 10:46:48 +01:00
fcd6a69000 cleaning up NBT handling on packet decode/encode
now we always decode, because it's not safe to assume that we can just grab the rest of the bytes in the packet.
2020-05-04 13:23:29 +01:00
f35b7bf80b NetworkBinaryStream: remove stale @throws from getAttributeList() 2020-04-29 16:32:56 +01:00
b6214744d5 NetworkSession: inject PacketPool instead of hardcoding it
this will make it slightly easier for multi version implementations, but handlers are still quite a big problem.
2020-04-29 12:48:28 +01:00
09e994a026 NetworkBinaryStream: swap BadPacketException for PacketDecodeException 2020-04-29 11:39:44 +01:00
a97cafd4f6 moving serializers into protocol namespace 2020-04-27 13:54:39 +01:00