Commit Graph

116 Commits

Author SHA1 Message Date
0e4966dfdf Split ProcessLoginTask into two tasks: 1) verify, 2) server handshake 2019-06-27 18:09:43 +01:00
193a41566d NetworkSession: Show the correct name on the player list 2019-06-27 17:04:36 +01:00
7f56f27505 some cleanup to held item handling 2019-06-26 19:40:40 +01:00
3f9493bcd0 Remove another NetworkSession <-> NetworkInterface cyclic dependency 2019-06-26 18:22:32 +01:00
7eaca6bbaa Separate packet-sender functionality from NetworkInterface, break cyclic dependency between NetworkInterface and NetworkSession 2019-06-26 18:19:29 +01:00
de10e401bf Fixed wrong chunks being sent to players post-teleport or post-world-change 2019-06-25 13:41:03 +01:00
d15284e638 work on moving inventory network functionality to network layer 2019-06-25 13:28:01 +01:00
2559f5ec2b Moved Player-related classes to pocketmine\player namespace 2019-06-18 18:51:36 +01:00
709963f90a shut up PhpStorm 2019-06-18 16:07:43 +01:00
b18bd4f33c rename SessionHandler -> PacketHandler 2019-06-18 16:02:46 +01:00
94299534b3 NetworkSession: fix some blind spots on logging 2019-06-18 15:01:44 +01:00
9df2ca3655 fixup some formatting issues 2019-06-18 14:12:37 +01:00
7b049b6db1 NetworkSession: use a better check for timeout 2019-06-17 17:30:42 +01:00
92e81e3298 Player: move some respawn net sync logic to NetworkSession 2019-06-17 16:27:04 +01:00
b344427a30 Added a hack to allow dropping garbage serverbound packets sent by a buggy client 2019-06-17 14:20:29 +01:00
93b83b4189 Player: Window system now only allows 1 window at a time 2019-06-15 18:19:09 +01:00
8afea36919 Clean up some internal commands protocol handling 2019-06-12 19:35:14 +01:00
1c69226187 NetworkSession: add an extra debug 2019-06-11 09:55:32 +01:00
8e6f21afad clean up gamemode net sync 2019-06-10 19:58:14 +01:00
f0d56f25b6 Moved creative inventory sync to NetworkSession 2019-06-10 19:54:24 +01:00
dd45753fa9 NetworkSession: add some more debug 2019-06-10 19:47:02 +01:00
3ac0c98199 De-spaghettify spawn notification handling 2019-06-10 19:31:54 +01:00
32c832c87e Merge branch 'stable'
# Conflicts:
#	resources/vanilla
#	src/pocketmine/Server.php
#	src/pocketmine/item/Item.php
#	src/pocketmine/network/mcpe/PlayerNetworkSessionAdapter.php
#	src/pocketmine/network/mcpe/RakLibInterface.php
#	src/pocketmine/network/query/QueryHandler.php
#	src/pocketmine/utils/Utils.php
2019-06-06 15:04:05 +01:00
61afc7b62c NetworkSession: report the zlib error that happened 2019-06-06 14:16:04 +01:00
9f0a184a5d Packet: Remove mayHaveUnreadBytes()
this was an old hack to prevent debug spam being emitted when we halted decoding of logins over breaking protocol changes. Since then, we've gone back to trying to decode the packet regardless, so this property is useless.
2019-06-05 15:37:35 +01:00
287c8c2dd4 Added static create() functions for many packets
There are a few motivations here:
1) Less boilerplate code (this can be written inline)
2) It's possible to provide multiple constructors for different packet variations to reduce the chance of errors.
3) It makes things catch fire on updates in ways that static analysers can understand.
2019-06-05 15:00:08 +01:00
cda565ba8c Merge branch 'stable'
# Conflicts:
#	resources/vanilla
#	src/pocketmine/inventory/ArmorInventory.php
2019-06-04 18:19:47 +01:00
6f29fe063f move PlayerListPacket sending responsibility to NetworkSession 2019-06-04 18:02:36 +01:00
33d1203bfd Player: move sendAllInventories() to network layer 2019-05-26 15:58:03 +01:00
85718e2750 Clean up a bunch of garbage in Furnace 2019-05-26 15:43:46 +01:00
3ea8da2dd3 Use EnumTrait->equals() instead of direct comparison
It's not guaranteed that objects provided are the same as those in the enum registry, so they can't be directly compared.

Implementing comparison with === would require some kind of __equals() implementation or an extension to hook into such functionality.
2019-05-24 17:21:44 +01:00
bca0833035 Clean up handling of armour sync 2019-05-19 16:56:10 +01:00
67affcea32 move more packet logic to net session
it seems like net session is turning into a giant dumping ground for sending API ... this needs to be cleaned up somehow.
2019-05-19 15:48:01 +01:00
c3c2dd3988 Rename SimpleSessionHandler -> InGameSessionHandler
the "simple" name comes from the early days of this refactor before I started splitting everything up into their own units. This handler is now in good enough condition to have a proper name.
2019-05-18 19:13:41 +01:00
c1a483a36d move entity spawning logic back to Player 2019-05-07 18:35:04 +01:00
d7a7ab5102 Move Entity despawn logic back to Player
this is not network-session specific, and different implementations will need to do this.
2019-05-07 18:01:23 +01:00
3cd6e12e71 Renaming "Level" -> "World" (#2907)
This has been a pain point for a long time due to the misleading nature of the name "level". It's also confusing when trying to do things like getting the XP level of the player or such, and also does not translate well to other languages.

This transition was already executed on the UI some time ago (language strings) and now it's time for the same change to occur on the API.

This will burn a lot of plugins, but they'll acclimatize. Despite the scary size of this PR, there isn't actually so many changes to make. Most of this came from renaming `Position->getLevel()` to `Position->getWorld()`, or cosmetic changes like changing variable names or doc comments.
2019-05-07 14:47:28 +01:00
427e334426 rename PacketStream to PacketBatch 2019-05-06 19:58:02 +01:00
c2771eba88 use the appropriate API for decoding packet batches 2019-05-06 17:46:17 +01:00
82974e0271 NullSessionHandler: possibly premature optimization 2019-05-06 17:28:56 +01:00
685481b172 NetworkSession: improve GC performance without crashing everything
this is necessary because some handlers have circular references to the session, which causes GC lag collecting them. This change allows them to be collected immediately without nuking internal state.
2019-05-06 16:43:05 +01:00
5250a432d1 NetworkSession: add a dedicated PrefixedLogger, clean up some boilerplate code 2019-05-06 16:32:34 +01:00
793f93afdb NetworkSession: sync with latest code generation changes 2019-04-25 14:49:20 +01:00
fa70127241 1.11.0 protocol changes 2019-04-24 19:54:16 +01:00
0dac982f16 Merge branch 'stable' 2019-04-21 16:56:53 +01:00
939dfd9269 First look at separating chunk sending from Level 2019-04-17 19:33:37 +01:00
0e3e984db9 Player: Disconnects no longer nuke player internals, (mostly) fixes #1239
there are some problems that haven't been accounted for yet, but this fixes all the direct crashes.
2019-04-03 17:44:34 +01:00
e5756dbf0b Move a whole bunch of packet crap to NetworkSession 2019-04-02 18:31:16 +01:00
9ec62643d5 Player construction now happens when we're ready to create the player entity
this fixes a wide range of bugs with the initial spawn sequence, and allows to simplify a whole lot of player setup logic.
2019-03-23 10:13:14 +00:00
433dab078b DataPacket events now use network sessions instead of players 2019-03-23 09:52:03 +00:00