319 Commits

Author SHA1 Message Date
Dylan K. Taylor
00cc2ee092 one more RakLib update for the day ... 2020-03-30 00:22:45 +01:00
Dylan K. Taylor
927872ce08 Updated to latest bleeding-edge RakLib 2020-03-29 23:53:00 +01:00
Dylan K. Taylor
abd1ed7352 RakLibServer: make onRun() protected 2020-03-29 18:45:48 +01:00
Dylan K. Taylor
d89cdfc18e Relieve RakLibServer of more responsibilities
at this point it's really not much more than just a thread-safe way to transmit parameters from main to thread. Maybe we can ditch it in favour of a generic closure-based thread implementation.
2020-03-29 18:42:15 +01:00
Dylan K. Taylor
4e54e54421 Updated RakLib dependency 2020-03-29 18:18:39 +01:00
Dylan K. Taylor
f779881b6a Updated to latest RakLib bleeding edge
this version brings quite a few inter-thread communication improvements.
2020-03-29 16:52:36 +01:00
Dylan K. Taylor
eb7c31d3ff RakLibInterface: remove useless shutdown check from tick()
the thread should never be shutdown during an update cycle, because we stop the interface from being ticked when it gets shutdown.
2020-03-29 16:26:22 +01:00
Dylan K. Taylor
0691a40204 UpdateBlockPropertiesPacket: expose nbt field 2020-03-24 11:06:58 +00:00
Dylan K. Taylor
da7ff9b1fe Airgap Attribute, fix decoding of non-registered attributes for protocol debugging 2020-03-24 00:43:44 +00:00
Dylan K. Taylor
83a3adecff LoginPacket: use netresearch/jsonmapper for login data decoding
this makes retrieval static analysis friendly without extra steps.
2020-03-23 22:00:13 +00:00
Dylan K. Taylor
3e5d3a646b Make use of BadPacketException::wrap() 2020-03-23 21:28:38 +00:00
Dylan K. Taylor
2d46ae4476 Added BadPacketException::wrap() 2020-03-23 21:27:08 +00:00
Dylan K. Taylor
d930abce2d ChunkSerializer: improve palette writing performance with one weird trick
this optimization relies on the fact that palette entries are always unsigned, and positive zigzag varints are just the same as their non-zigzag counterparts, except shifted left by 1 bit. This eliminates some function call overhead, making the encoding slightly less agonizingly slow.
2020-03-17 21:16:43 +00:00
Dylan K. Taylor
093a7c239e CraftingDataPacket: fix variable name collision 2020-03-14 14:24:50 +00:00
Dylan K. Taylor
c9e8598510 InGamePacketHandler: do not handle inbound ActorEvents that are not for self 2020-03-13 15:19:32 +00:00
Dylan K. Taylor
899d05c6ec DataPacket: strip some whitespace 2020-03-10 13:06:16 +00:00
Dylan K. Taylor
ca909ebc1d Merge branch 'next-minor' 2020-03-10 13:05:37 +00:00
Dylan K. Taylor
b4b1877ce5 Merge branch 'next-minor' 2020-03-09 14:38:15 +00:00
Dylan K. Taylor
6e39e34c1e Merge branch 'stable' 2020-03-03 12:35:11 +00: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
8a770d837e Merge branch 'stable' 2020-02-24 20:32:43 +00:00
Dylan K. Taylor
ce0af8b040 DataPacket now encapsulates NetworkBinaryStream instead of extending it
ultimately the goal is to remove the NetworkBinaryStream crap entirely, but this change has most of the same benefits and is less disruptive.
2020-02-24 18:59:54 +00:00
Dylan K. Taylor
36685001bd ContainerOpenPacket: fixed entityInv() not initializing x/y/z fields
these are written even when not used, so they have to be initialized.
2020-02-23 20:59:53 +00:00
Dylan K. Taylor
95eddbdd74 InventoryManager: move add/remove logic to separate functions 2020-02-12 17:36:29 +00:00
Dylan K. Taylor
55e3b9ed91 InventoryManager: avoid feedback loop when closing inventory 2020-02-12 16:35:57 +00:00
Dylan K. Taylor
4014f9a4f2 InventoryManager: be aware of client-side state when syncing slots
this eliminates feedback loops during client-initiated slot changes, and also makes it possible to have a SlotChangeAction anonymous from its initiator.
2020-02-11 21:12:18 +00:00
Dylan K. Taylor
7ad44d8403 ChunkRequestTask: do not copy light information when sending chunks 2020-02-09 17:49:15 +00:00
Dylan K. Taylor
ce42ca958e InGamePacketHandler: do not execute use-item action if already using item, fixes #3246
the useHeldItem() sets the using-item flag back to true immediately after consumeHeldItem() sets it to false, which caused this bug.
stable has the same problem, but the effects don't show due to a well timed MobEquipmentPacket (a happy accident).
2020-02-09 12:13:15 +00:00
Dylan K. Taylor
bfdfa4184b Merge branch 'stable' 2020-02-08 09:33:56 +00:00
Dylan K. Taylor
04a3e71047 ChunkSerializer: avoid using loop vars outside loop scope 2020-02-07 22:10:23 +00:00
Dylan K. Taylor
ee36ac9875 ProcessLoginTask: use strict base64_decode() 2020-02-07 22:09:46 +00:00
Dylan K. Taylor
d2aca6023b add native return types to closures (for phpstan) 2020-02-07 22:05:15 +00:00
Dylan K. Taylor
aac7da6c96 eliminate remaining empty() usages 2020-02-07 21:51:50 +00:00
Dylan K. Taylor
fb1126797a Merge branch 'stable' 2020-02-07 18:13:55 +00:00
Dylan K. Taylor
ff63f6d055 fill in more iterable types (master) 2020-02-01 20:19:57 +00:00
Dylan K. Taylor
cb16f5c142 Merge commit '260ac47588c76a2e6814cfba46773a990fb8c5da'
# Conflicts:
#	resources/vanilla
#	src/Server.php
#	src/lang/Language.php
#	src/network/mcpe/protocol/AddItemActorPacket.php
#	src/network/mcpe/protocol/AddPlayerPacket.php
#	src/network/mcpe/protocol/SetActorDataPacket.php
#	src/network/mcpe/serializer/NetworkBinaryStream.php
#	src/permission/Permission.php
#	src/pocketmine/block/Leaves.php
#	src/pocketmine/entity/DataPropertyManager.php
#	src/pocketmine/entity/Entity.php
#	src/pocketmine/item/Banner.php
#	src/pocketmine/item/Item.php
#	src/pocketmine/level/format/io/LevelProvider.php
#	src/pocketmine/level/format/io/LevelProviderManager.php
#	src/pocketmine/network/mcpe/protocol/AddActorPacket.php
#	src/pocketmine/network/mcpe/protocol/LoginPacket.php
#	src/pocketmine/tile/Banner.php
#	src/scheduler/BulkCurlTask.php
#	src/updater/AutoUpdater.php
#	src/utils/Config.php
#	src/utils/Utils.php
#	src/world/generator/Flat.php
#	src/world/generator/Generator.php
2020-01-31 21:07:34 +00:00
Dylan K. Taylor
20d39846b7 Merge commit 'fc0619ee6e4fa08aba2719e58a9289edd11f0b6e'
# Conflicts:
#	resources/vanilla
#	src/network/mcpe/protocol/AddItemActorPacket.php
#	src/network/mcpe/protocol/AddPlayerPacket.php
#	src/network/mcpe/protocol/SetActorDataPacket.php
#	src/network/mcpe/serializer/NetworkBinaryStream.php
#	src/pocketmine/network/mcpe/protocol/AddActorPacket.php
#	src/pocketmine/network/mcpe/protocol/LoginPacket.php
2020-01-31 19:42:07 +00:00
Dylan K. Taylor
5be45dd793 Merge commit '259f0425a9657befcc8ef5f474ecc24ec78042fa' 2020-01-31 18:43:47 +00:00
Dylan K. Taylor
5c4487c980 added some callable prototypes for phpstan 2020-01-29 19:56:16 +00:00
Dylan K. Taylor
68bea6d4aa ChunkRequestTask: fix @var for error hook fetch 2020-01-29 19:36:52 +00:00
Dylan K. Taylor
ded0f5c80e network: added some missing native closure return types 2020-01-28 11:10:01 +00:00
Dylan K. Taylor
e66197036d InGamePacketHandler: drop transactions with 0 actions without trying to execute them
often we throw out actions that have no value, which can lead to an empty transaction and re-syncing the inventory. This happens every time we interact with the creative inventory in 1.13+, which causes items to appear to vanish when taking them from the creative menu.
The correct fix for this is to resend only the slots affected by SlotChangeActions, but this fix will suffice for now without rewriting everything.
2020-01-25 18:10:37 +00:00
Dylan K. Taylor
0b423c5b96 Merge branch 'stable' 2020-01-22 15:16:10 +00:00
Dylan K. Taylor
055b13a6cf strip extra blank lines (php-cs-fixer) 2020-01-22 15:14:10 +00:00
Dylan K. Taylor
7f06002027 Merge commit 'bff5bf25aea5cf56bbbfaeaa89f5e1f0ac920c90' 2020-01-22 15:00:13 +00:00
Dylan K. Taylor
67bcc1c0fb phpdoc armageddon for master, pass 1 2020-01-22 11:55:03 +00:00
Dylan K. Taylor
ccdf003c8d ResourcePacksPacketHandler: fixed chemistry being applied to top of stack instead of bottom
it seems like the stack order is reversed, so all 'regular' in-memory stack behaviour goes out of the window.
2020-01-22 08:26:44 +00:00
Dylan K. Taylor
3ee6887792 populate remaining missing return types, using native returns where possible
this is done separately to stable so that stable changes can be integrated easily using an empty merge.
2020-01-19 10:26:35 +00:00
Dylan K. Taylor
df2551ed4d NetworkSession: add missing return type for syncAttributes() 2020-01-18 20:00:05 +00:00