Commit Graph

580 Commits

Author SHA1 Message Date
c05779314d Allow offline player data to be provided from a custom source 2021-02-07 20:29:37 +00:00
7745310870 Use native property types for login JSON models
this significantly reduces the amount of PHPDoc boilerplate, because the remaining doc comments can mostly be reduced to 1 line.
2021-02-07 17:54:38 +00:00
ae75d73f48 Extract MainLoggerThread unit from MainLogger
MainLogger is no longer a Thread, as per the recent changes to pocketmine/log-pthreads.
2021-02-04 16:28:49 +00:00
4b9639f6c9 Merge branch 'stable' 2021-02-04 15:55:39 +00:00
bbae02264d Merge branch 'stable' 2021-01-27 20:04:13 +00:00
c70c0b55df Separate held item index change listener logic from PlayerInventory 2021-01-12 16:44:25 +00:00
82c8fa696a Relocate teleport ACK checks to InGamePacketHandler 2021-01-07 20:43:31 +00:00
bcc3e87730 Timings: rename core timers to remove 'timer' from the names
this makes them shorter and more consistent.
2020-12-23 17:52:25 +00:00
9228f006d4 Merge remote-tracking branch 'origin/stable'
# Conflicts:
#	composer.json
#	composer.lock
#	resources/vanilla
#	src/CrashDump.php
#	src/PocketMine.php
#	src/pocketmine/Server.php
#	src/pocketmine/item/Bucket.php
#	src/pocketmine/item/Item.php
#	src/pocketmine/level/format/Chunk.php
#	src/pocketmine/level/format/io/leveldb/LevelDB.php
#	src/pocketmine/level/format/io/region/McRegion.php
#	src/pocketmine/network/mcpe/protocol/BatchPacket.php
#	src/pocketmine/tile/Furnace.php
#	src/pocketmine/utils/UUID.php
#	src/utils/ServerKiller.php
2020-12-20 20:54:13 +00:00
24ac5f8be0 Fixed craftingDataCacheRebuildTimer never being stopped 2020-12-13 21:41:22 +00:00
c0438f1ddb Move player creation out of NetworkSession 2020-12-13 21:20:37 +00:00
eaf6e19a6f RakLib sync n.2 2020-12-12 19:54:17 +00:00
f81d061ea9 Updated to newest RakLib 2020-12-12 19:06:45 +00:00
197b1a8566 Merge branch 'stable'
# Conflicts:
#	resources/vanilla
#	src/network/mcpe/protocol/types/inventory/stackresponse/ItemStackResponseSlotInfo.php
#	src/network/mcpe/raklib/FilterTextPacket.php
#	src/pocketmine/VersionInfo.php
#	src/pocketmine/network/mcpe/protocol/PacketPool.php
#	src/pocketmine/network/mcpe/protocol/ResourcePacksInfoPacket.php
2020-12-08 21:34:06 +00:00
a5315991d5 Merge branch 'stable'
# Conflicts:
#	resources/vanilla
#	src/network/mcpe/protocol/serializer/PacketSerializer.php
#	src/world/biome/Biome.php
#	tests/phpstan/configs/l8-baseline.neon
2020-12-05 01:30:39 +00:00
c808095978 Chunks no longer contain their own coordinates 2020-12-03 21:59:30 +00:00
1f5998d24c FastChunkSerializer no longer encodes chunk coordinates
in cases like PopulationTask it makes more sense to store the coordinates separately where they can be stored more efficiently (once instead of 9 times)
In addition, PopulationTask shouldn't need to serialize an empty chunk just to copy coordinates.

I've made changes like this in other areas already in preparation for the day when chunks no longer contain their coordinates, so this brings us one step closer to that goal.
2020-12-03 20:52:33 +00:00
687ad28fa6 Added a PacketBroadcaster interface
this gives a bit more control over how packets are broadcasted, which might be useful if the batch format changes (e.g. adding a length prefix) for multi version.
This really ought to be unique to a protocol context instead of a network interface, but for now this is the best we can do.
2020-12-02 16:34:14 +00:00
541cfee615 RakLibServer: do not try to export exceptions across threads (they might contain Threaded objects whose references get invalidated) 2020-12-01 22:31:55 +00:00
8fb74258f4 Implemented a better method for detecting permission recalculation
this allows anyone to listen to permissions being recalculated, which is useful for stuff like broadcast channel subscriptions.
2020-12-01 18:23:42 +00:00
6d8833ccd3 Removal of permission defaults (in favour of permission cascading) (#3937) 2020-12-01 17:13:54 +00:00
1eabc3fe75 NetworkStackLatencyPacket: added named constructors 2020-11-30 21:29:51 +00:00
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
af1fe7c293 Merge branch 'stable' 2020-11-21 21:13:48 +00:00
bc208e11f4 phpstan 0.12.57 2020-11-21 18:07:14 +00:00
f2bdbb0c35 TypeConverter: fix using singleton to get its own context
I guess this must have been refactored from some other class?...
2020-11-20 21:31:06 +00:00
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
09b22c1e79 NetworkSession: drop @var doc comment referring to nonexisting variable 2020-11-16 22:51:03 +00:00
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
37299ab804 ChunkCache: explicitly check for requesting of unloaded chunk
NetworkSession will never do this, but other things might.
2020-11-16 19:45:46 +00:00
1d27225553 Relocate cache-related classes to mcpe\cache namespace 2020-11-16 19:39:30 +00:00
869c9dabf1 SetCommandsEnabledPacket: added ::create() 2020-11-16 19:11:10 +00:00
ca6a892834 [ci skip] NetworkSession: added some extra TODOs 2020-11-16 19:10:27 +00:00
0d9561c93f Removed crafting data cache from CraftingManager 2020-11-12 21:30:59 +00:00
c4d35d52e8 Do not store a pre-compressed cache for crafting data
this reduces bandwidth efficiency because it can't be compressed with everything else this way. If we want to cache stuff sent during the login sequence, it's better to stuff a bunch of stuff into a batch (e.g. crafting, creative, actor ids, biome defs) and pre-compress that as one big package instead.
2020-11-11 18:20:03 +00:00
75f2f12b99 NetworkSession: rename some badly-named hooks 2020-11-10 15:01:48 +00:00
e23379c34b EncryptionContext: provide the packet ID in the exception message 2020-11-10 14:45:19 +00:00
6a266bcbd1 Separated XUID stuff from PlayerInfo into its own XboxLivePlayerInfo 2020-11-10 14:25:08 +00:00
e573226025 ItemStack: fixed phpstan failure 2020-11-09 19:10:02 +00:00
2bcb398db9 ItemStack: added jsonSerialize 2020-11-09 19:05:00 +00:00
f43d20b47a Move attribute net sync to NetworkSession 2020-11-08 14:15:11 +00:00
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
ffff0a6244 NetworkSession: remove obsolete TODO 2020-11-08 14:03:30 +00:00
72ace3951e InGamePacketHandler: fixed crafting table breaking when clicked while sneaking 2020-11-03 22:56:20 +00:00
1f2bc8cb69 World: remove rogue import 2020-11-01 17:05:57 +00:00
4549522289 Rename Chunk::getSubChunkChecked() -> getSubChunk() 2020-10-31 23:12:03 +00:00
01001dca74 Use Chunk::getSubChunkChecked() in places where we know that an invalid coordinate cannot be requested 2020-10-31 22:48:41 +00:00
4c0c2ebd24 CS cleanup 2020-10-26 15:56:30 +00:00
3f254bd49c Separated effects' MCPE ID registration from VanillaEffects 2020-10-24 18:52:20 +01:00
03837c1b71 ZlibCompressor: use libdeflate if available
I may make libdeflate mandatory later on, but right now we haven't been able to ship it on all platforms yet.
2020-10-13 17:30:27 +01:00