bb6ea8cbdc
Do not call PlayerLoginEvent during the Player constructor
...
this closes a lot of loopholes in the login sequence that plugins were using to cause crashes.
2021-10-04 22:36:50 +01:00
356a49d225
NetworkSession: account for possibility of syncGameMode() being called before the player is ready to receive it
...
close #4323
2021-10-04 22:13:42 +01:00
8de30e8162
FastChunkSerializer no longer serializes light by default
...
the core doesn't use this anywhere.
serializeWithoutLight() has been renamed to serializeTerrain() to more accurately describe what it does.
2021-10-01 22:57:22 +01:00
5b818827db
Chunk: stop exposing SplFixedArray<SubChunk> to the API
...
this fixes a large number of PHPStan errors, and also brings us a step closer to negative-build-height readiness.
2021-10-01 22:17:28 +01:00
b3e8314b9f
PTHREADS_INHERIT_CONSTANTS is no longer needed for MainLogger to log exceptions
...
cleaned paths are now referenced from Filesystem instead of namespace constants.
2021-09-26 21:41:24 +01:00
8e2d06a880
ChunkSerializer: support writing 0 bpb palettes on the wire
...
these are now supported as of 1.17.30.
2021-09-25 01:17:32 +01:00
9490b78640
Move packet handler default implementations to BedrockProtocol
...
in many cases this will now require zero changes to PM at all to be compatible with a new protocol version.
2021-09-15 22:27:49 +01:00
3b7580688c
Stop auto-translating string descriptions/usages for commands
...
Require usage of Translatable for translations.
2021-09-11 16:46:40 +01:00
7701e1ff98
InGamePacketHandler: fix regression in movement handling since 82c8fa696a
...
fixes #4291
fixes #4398
2021-09-10 16:52:46 +01:00
4111d92b98
Stop hardcoding chunk dimensions everywhere ( #4443 )
2021-09-10 16:13:25 +01:00
4a787769bf
Merge branch 'stable'
2021-09-09 16:06:16 +01:00
11d2e1ef08
Require ext-chunkutils ^0.3.0
2021-09-07 22:53:50 +01:00
b4e23a57d2
CraftingDataCache: Replace hardcoded recipe block names with constants from BedrockProtocol
2021-08-29 16:26:18 +01:00
a012e7ccc0
VersionInfo: make static methods more constant-like
...
if we could have class constants declared at runtime, these would be constant.
2021-08-16 16:37:36 +01:00
5da90b9530
Stop auto-translating strings when not asked
...
fixes #4371
2021-08-15 20:44:27 +01:00
a81680c5c6
missed a few more hardcoded translation keys
2021-08-15 20:12:55 +01:00
039c59856d
Remove % translation prefixes dotted around all over the place
2021-08-15 20:03:38 +01:00
58bc9332cd
Workaround for offhand sync ( #4359 )
...
fixes #4231
2021-08-12 23:27:53 +01:00
27e0ecf7ee
Implemented Blast Furnace and Smoker ( #4362 )
2021-08-12 23:27:05 +01:00
2293bd948d
Added KnownTranslationFactory and use it in as many places as possible
...
this makes translation usage much more statically analysable.
The only places this isn't used are:
- places that prefix translations with colours (those are still a problem)
- places where server/client translations don't match (e.g. gameMode.changed accepts different parameters in vanilla than in PM)
2021-08-10 14:50:40 +01:00
01b48a21d9
Simplify NetworkSession ticking
...
we need to tick sessions every tick anyway, because other stuff is happening (e.g. sync attributes/entity metadata, batch buffer flush).
2021-08-02 14:32:00 +01:00
1bbf739385
the function stringToLegacy gives already null useless to put a default null ( #4338 )
2021-07-31 16:54:31 +01:00
2b5667a56b
Move PHP minimum to 8.0
2021-07-26 20:29:39 +01:00
09eac0e129
Merge remote-tracking branch 'origin/stable'
2021-07-26 20:14:33 +01:00
58498c2b0b
Merge remote-tracking branch 'origin/stable'
2021-07-23 16:40:19 +01:00
f89e10e684
Silence openssl_free_key() deprecation warnings on 8.0
...
we don't give a shit and these calls are currently needed for 7.4.
2021-07-23 16:30:22 +01:00
0eb4231b51
Use OpenSSL for ECDH during client login, drop mdanter/ecc ( #4328 )
...
This brings a significant performance improvement to login sequence handling, reducing CPU cost of `PrepareEncryptionTask` by over 90% and `ProcessLoginTask` by over 60%. It also allows us to shed a dependency.
2021-07-22 23:04:00 +01:00
41d9bf8a2e
PthreadsChannelWriter: remove unused import
2021-07-22 19:08:21 +01:00
832a156fc7
RakLib: split PthreadsChannelWriter into two implementations
...
this gains a very small performance improvement by avoiding unnecessary !== null checks on every packet written in either direction. It's insignificant for sure, but I just found this code in an old stash, so what the heck.
2021-07-22 18:52:58 +01:00
c5abae9eaa
Fixed merge error in bbf3f4c476
...
the corresponding code on PM3 was originally removed here: 485f573955 (diff-cf181dff0292664e4aa13c8a1731dc62131489fa404f4ac1357493d320264cceL2263)
2021-07-17 22:59:45 +01:00
17d0767db5
ChunkSerializer: implement support for persistent network chunk format
2021-07-17 18:45:04 +01:00
e5327a0f3e
ChunkSerializer: Extract serializeSubChunk() from main serialize() routine
...
this will be used in the future for cache-based chunk sends.
2021-07-17 18:29:14 +01:00
a2e2196a90
Start using pocketmine/bedrock-protocol library
2021-07-14 20:32:15 +01:00
9f11be25cb
LevelSoundEventPacket: fixed bad null assignment in ::create()
2021-07-14 15:21:33 +01:00
c474aa42e5
ClientDataToSkinDataHelper: Remove SingletonTrait
...
SingletonTrait is pointless here for multiple reasons:
1) the class is final
2) this is protocol-specific translation of types, no loss of data or alternative mutation of it needs to occur
Using SingletonTrait is an obstacle to separating the protocol library from the core code, so it has to go.
2021-07-14 14:50:59 +01:00
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
28ede7273f
Fixed CS
2021-07-13 18:16:25 +01:00
f77da60dd3
Merge branch 'pm3-bedrock-1.17.10' into pm4-bedrock-1.17.10
2021-07-13 18:02:29 +01:00
b07000f613
Merge branch 'pm3-bedrock-1.17.10' into pm4-bedrock-1.17.10
2021-07-09 20:02:30 +01:00
9d1b2c839d
this managed to get lost in the merge
2021-07-09 19:39:15 +01:00
94e16f416d
Added KnownTranslationKeys (generated) and start using it
2021-06-29 22:46:04 +01:00
32d7b1e6af
Start using webmozart/pathutil for joining paths ( #4287 )
2021-06-29 19:40:43 +01:00
b8ebf8936e
InventoryManager: fix container open callbacks not working
...
this was reported to me on socials by multiple different people, but nobody reported an issue so I almost forgot. >.<
2021-06-26 21:21:23 +01:00
0910054c41
NetworkSession: Fixed InventoryManager nullability disaster
...
fixes #4277
fixes #4275
fixes #3139
2021-06-26 17:44:42 +01:00
981b0285d1
Isolate config casting nastiness in one place
...
this doesn't solve the underlying problem, but it does reduce the amount of noise made by PHPStan about it, as well as avoiding code litter.
2021-06-19 19:14:02 +01:00
61c59be299
Replace hardcoded block metadata shifts and masks with constants
...
we might want to make these bigger than 4 bits in the future.
2021-06-16 12:48:09 +01:00
c22f793521
RakLibInterface: Log a message when a non-0xfe packet is received
2021-06-15 19:20:31 +01:00
3d0b21f30c
Denoise NetworkSession with typed properties
2021-06-13 22:27:23 +01:00
e5dd5a5745
NetworkSession: Fixed missing nullable declarations
...
phpstan doesn't report these because .. reasons .. @ondrejmirtes this is causing bugs to go unfound :(
I'm aware of the irony that I just silenced the bugs that were exposed by this commit .. that's an architectural problem for another day
2021-06-13 22:24:12 +01:00
04a6e89d6f
Change encryption to use CTR instead of GCM
...
despite MCPE claiming to use GCM, it omits the auth tag, which defeats the whole point of using GCM.
CTR can be used instead, with the final 4 bytes of the IV being 0002.
2021-06-13 21:57:23 +01:00