79 Commits

Author SHA1 Message Date
Dylan K. Taylor
0be60fe1eb NetworkSession: Force use of async compression during the login sequence when latency doesn't matter
closes #3907
this reduces the impact of compression on the login sequence by about 90%; however, since compression only accounted for about 30% of said overhead at most, it's not really a massive difference.
2020-11-26 23:39:19 +00:00
Dylan K. Taylor
af1fe7c293 Merge branch 'stable' 2020-11-21 21:13:48 +00:00
Dylan K. Taylor
62b9d97060 Break circular dependency in Player->disconnect() usages
none of these usages require onPlayerDestroyed() to be fired since they are all being called during disconnects anyway.
2020-11-16 23:05:56 +00:00
Dylan K. Taylor
09b22c1e79 NetworkSession: drop @var doc comment referring to nonexisting variable 2020-11-16 22:51:03 +00:00
Dylan K. Taylor
c3c647d51e NetworkSession: remove useless disconnect() call
this can't execute here because of the disconnectGuard, so this call always does nothing.
2020-11-16 22:13:48 +00:00
Dylan K. Taylor
1d27225553 Relocate cache-related classes to mcpe\cache namespace 2020-11-16 19:39:30 +00:00
Dylan K. Taylor
ca6a892834 [ci skip] NetworkSession: added some extra TODOs 2020-11-16 19:10:27 +00:00
Dylan K. Taylor
75f2f12b99 NetworkSession: rename some badly-named hooks 2020-11-10 15:01:48 +00:00
Dylan K. Taylor
6a266bcbd1 Separated XUID stuff from PlayerInfo into its own XboxLivePlayerInfo 2020-11-10 14:25:08 +00:00
Dylan K. Taylor
f43d20b47a Move attribute net sync to NetworkSession 2020-11-08 14:15:11 +00:00
Dylan K. Taylor
64afb6f2e2 Move responsibility of firing chunk requests from World to NetworkSession
this is, after all, all about sending chunks ...
2020-11-08 14:14:43 +00:00
Dylan K. Taylor
ffff0a6244 NetworkSession: remove obsolete TODO 2020-11-08 14:03:30 +00:00
Dylan K. Taylor
3f254bd49c Separated effects' MCPE ID registration from VanillaEffects 2020-10-24 18:52:20 +01:00
Dylan K. Taylor
2e3940e8f5 NetworkSession: remove circular dependency between queueCompressed() and flushSendBuffer()
this cycle makes the code fragile and prone to infinite looping bugs when modified, as well as making the code harder to follow.
2020-10-11 12:22:59 +01:00
Dylan K. Taylor
b0b08d45d5 Entity: clean up sendData() handling, remove send-to-self hack 2020-10-08 21:35:36 +01:00
Dylan K. Taylor
94c58c00b5 NetworkSession: Restore PM3 unexpected XUID handling behaviour (removes XUID instead of kicking the player)
close #3861, close #3089
2020-10-08 14:36:07 +01:00
Dylan K. Taylor
15eac8a65a NetworkSession: renamed some instructions to imperative instead of onWhatever()
these aren't listening to events, they are telling the client that an event has taken place.
2020-10-06 18:06:48 +01:00
Jack Honour
ff2a3baa8e
Implemented Jukebox & Records (#3742)
Co-authored-by: Dylan K. Taylor <odigiman@gmail.com>
2020-08-07 21:07:58 +01:00
Dylan K. Taylor
2fcee432c1 NetworkSession: store Packet[] for buffering instead of PacketBatch
this reduces memory allocations for buffering (in theory).
2020-07-22 15:18:01 +01:00
Dylan K. Taylor
b22cc4875e Player: Accept NBT data in constructor, instead of asking for it from the server directly
this allows custom implementations to provide custom data to the constructor (or none at all).
2020-07-09 13:09:46 +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
670ad9eb9d Position: rename getWorldNonNull() to getWorld(), remove original getWorld() 2020-06-29 21:19:46 +01:00
Dylan K. Taylor
0d13a3fbdb NetworkSession: do not respond to death before player spawn, fixes #3513
there's a few changes that can be made to avoid this problem, the
primary one being to separate this API from NetworkSession and abstract
it away... but this is a reasonable, although not great, solution.
2020-06-28 17:35:12 +01:00
Dylan K. Taylor
7e6adc41f0 Merge 1.16 support into PM4 (with changes) 2020-06-26 22:21:09 +01:00
Dylan K. Taylor
52fd1a8c1d CommandSender: export getLanguage()
this currently serves as a proxy to the server main language, but it can be used by third party implementations to choose a non-Server language.
2020-06-22 20:05:23 +01:00
Dylan K. Taylor
edc3156bea Rename NetworkCipher -> EncryptionContext 2020-06-18 11:37:53 +01:00
Dylan K. Taylor
893f7cb6ef fix crash whn player joins in spectator mode 2020-06-17 12:39:54 +01:00
Dylan K. Taylor
9c46a1f141 Rename Packet->getBinaryStream() -> Packet->getSerializer() 2020-06-17 11:33:59 +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
9ce531fef4 (master) imports cleanup 2020-06-14 19:29:33 +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
70ca12bb90 Merge commit 'fcc9e62c6'
# Conflicts:
#	resources/vanilla
#	src/network/mcpe/protocol/types/command/CommandEnum.php
#	src/pocketmine/Player.php
2020-06-13 11:49:52 +01:00
Dylan K. Taylor
6df43338df Merge commit 'c3a795e87'
# Conflicts:
#	resources/vanilla
#	src/pocketmine/Player.php
#	src/pocketmine/entity/Entity.php
2020-05-31 14:56:37 +01:00
Dylan K. Taylor
570a709059 Merge commit '3ec2994d7f05f30e2519430379ae0f3106be5074'
# Conflicts:
#	resources/vanilla
#	src/pocketmine/Player.php
2020-05-20 19:52:03 +01:00
Dylan K. Taylor
3bb53658da Do not allow remote clients to spawn themselves before we're ready
this would have allowed clients to send SetLocalPlayerAsInitializedPacket at any time during the spawn sequence, which would have caused undefined behaviour around spawning logic.
2020-05-20 11:09:27 +01:00
Dylan K. Taylor
3f1f135a59 remove a couple more Position->getWorld() usages 2020-05-19 21:38:51 +01:00
Dylan K. Taylor
3dafee6aa6 NetworkSession: explicitly unregister effect manager hooks on dispose,
close #3455
2020-05-14 10:59:10 +01:00
Dylan K. Taylor
bb11cbd89c World: relocate packet stuff for time and difficulty behind NetworkSession API 2020-04-29 18:31:54 +01:00
Dylan K. Taylor
c8c0a1533c NetworkSession: seal up actor removal behind API 2020-04-29 17:00:47 +01:00
Dylan K. Taylor
4ce6525065 NetworkSession: incomplete abstraction of SetActorDataPacket handling
this needs to have the metadata properties separated too, but that's a job that's going to get VERY messy.
2020-04-29 16:50:52 +01:00
Dylan K. Taylor
d1b28ce17a NetworkSession: allow sending an arbitrary set of attributes for an entity 2020-04-29 16:45:09 +01:00
Dylan K. Taylor
f6f714c158 NetworkSession: do not mark shared attributes as synchronized, they don't necessarily belong to us
if we decided to start sending entity attribute changes to viewers too, this would have caused some unexpected behaviour.
2020-04-29 16:38:10 +01:00
Dylan K. Taylor
ad70a9e3dc NetworkSession: allow provision of a custom list of players to syncPlayerList() 2020-04-29 16:27:34 +01:00
Dylan K. Taylor
d8968e9e40 box up TakeItemActorPacket sending behind NetworkSession API
we need to start thinking about moving this into interfaces.
2020-04-29 16:24:04 +01:00
Dylan K. Taylor
549940d8a7 remove NullPacketHandler
this is a waste of LOC
2020-04-29 13:14:23 +01:00
Dylan K. Taylor
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
Dylan K. Taylor
3be9548b1e net: compressors are now fully dynamic (or at least the potential to be)
the compressor used by RakLibInterface when opening a session is still
hardcoded, but that's because we have no way to select the correct
compressor at that point in the login sequence, since we aren't
propagating the protocol information up from RakLib right now.
2020-04-28 16:21:18 +01:00
Dylan K. Taylor
d9e4783b24 start making network compressors dynamic
this will facilitate future multi version support where compression types are different between versions
2020-04-28 14:47:01 +01:00
Dylan K. Taylor
a97cafd4f6 moving serializers into protocol namespace 2020-04-27 13:54:39 +01:00
Dylan K. Taylor
15c744b0d7 protocol: specialize exception used for bad packets 2020-04-27 12:55:00 +01:00