Commit Graph

64 Commits

Author SHA1 Message Date
Dylan K. Taylor
1c92d66ca4 LoginPacketHandler: stop bailing on unexpected JSON properties
the intent of this was noble (to make sure nothing was missed), but in practice throwing
errors on this stuff is just a pain in the ass. We don't actually need to care if the
properties are not used, since it doesn't affect the decoding (like it would for
a missing packet field), so the only reasons to complain are for BedrockProtocol to
have a complete picture of the protocol, and to make sure we're not discarding useful
information.

Log a warning in these cases instead, which should be noticed by developers without
being an unnecessary problem for users.

closes #6816
2025-09-26 23:04:23 +01:00
Dylan T.
31f4b496a1 Implement new OpenID authentication system (#6798)
Co-authored-by: Dries C <15795262+dries-c@users.noreply.github.com>
2025-09-20 22:40:38 +01:00
Dylan K. Taylor
54e8ad2a9c Update BedrockProtocol 2025-09-10 16:21:29 +01:00
Dries C
9c71f4fc1c Assemble 1.21.90 (#6736) 2025-06-18 01:15:00 +01:00
Dylan K. Taylor
5325ecee37 Deal with a whole lot of PHPStan suppressed key casting errors
closes #6534
2024-11-25 14:30:58 +00:00
Dylan K. Taylor
6872661fd0 Harden JsonMapper on login JSON handling 2024-02-23 14:10:02 +00:00
Dylan K. Taylor
b2df405cc0 NetworkSession: Send less information to clients on error disconnects
in particular, the information from VerifyLoginTask shouldn't be sent to clients, as it could contain sensitive information.
This change only affects disconnection screens. The server log shows the same amount of information as before (though formatted differently in some cases).
2023-11-29 16:31:59 +00:00
Tobias Grether
ee6d551729 Include TitleID in PlayerInfo extraData (#6054) 2023-09-21 14:48:50 +01:00
Dylan K. Taylor
7f1550ef04 Revert "Stop using insecure UUIDs from non-XBL players"
This reverts commit 9baf59702b.

I forgot this is also needed for the player list, and for skin updates
to work ... this will need to be revisited
2023-05-27 18:10:55 +01:00
Dylan K. Taylor
9baf59702b Stop using insecure UUIDs from non-XBL players
closes #4076

I opted for the minimal approach of replacing only UUIDs for non-XBL players, since most servers are using XBL anyway (as they should).
2023-05-27 18:00:54 +01:00
Dylan K. Taylor
926f68d8c5 Move SkinAdapter under TypeConverter, remove SkinAdapterSingleton
this is legacy cruft from PM3, which didn't have TypeConverter or SingletonTrait.
2023-05-06 17:53:24 +01:00
Dylan K. Taylor
c500ccd891 Merge branch 'minor-next' into major-next 2023-03-14 18:43:43 +00:00
Dylan K. Taylor
3de7a8c27f Updated for 1.19.70 2023-03-14 18:08:10 +00:00
Dylan K. Taylor
407b78de3b Merge branch 'next-minor' into next-major 2023-02-28 19:25:05 +00:00
Dylan K. Taylor
e7209679fb ... 2023-02-24 22:23:00 +00:00
Dylan K. Taylor
ae50b952f1 Accept 1.19.63 (same protocol, different protocol version) 2023-02-24 22:15:58 +00:00
Dylan K. Taylor
42df1a5c70 Fixed merge error 2023-02-17 20:19:32 +00:00
Dylan K. Taylor
0e0f5e85eb Merge branch 'next-minor' into next-major 2023-02-17 20:00:51 +00:00
Dylan K. Taylor
71aad310c6 stfu 2023-02-17 16:39:46 +00:00
Dylan K. Taylor
1e3b025916 1.19.62 2023-02-17 16:36:32 +00:00
Dylan K. Taylor
2d56aa50b9 A bunch of mostly inseparable changes to PlayerPreLoginEvent
including support for separated disconnect reasons and disconnect screen messages (closes #4512)

While the refactoring of kick reason -> kick flag wasn't exactly in my agenda, I realized that these changes would become pretty confusing and inconsistent with other events if they weren't refactored.
Hopefully I don't have to break this API again for a while...
2023-02-13 11:32:32 +00:00
Dylan K. Taylor
c2918709a3 Merge branch 'next-minor' into next-major 2023-01-06 01:59:04 +00:00
Dylan K. Taylor
59be901efe Fixed unauthenticated sessions taking up player slots 2022-12-28 20:42:33 +00:00
Dylan K. Taylor
7ac6bd79a9 Localized remaining disconnection screens (except one or two that should never actually happen) 2022-12-27 20:05:59 +00:00
Dylan K. Taylor
f173b91ca1 Introduce support for Translatable disconnection messages
this allows localizing disconnection screens (at least, once #4512 has been addressed) and the disconnect reasons shown on the console.

We already had disconnect messages implicitly localized in a few places, so this is just formalizing it.
This does break BC with any code that previously passed translation keys as the disconnect screen message, because they'll no longer be translated (only Translatables will be translatated now).
2022-12-27 18:36:07 +00:00
Dylan K. Taylor
c1ba735c9e Move common protocol disconnection logic to NetworkSession 2022-12-27 18:05:50 +00:00
Dylan K. Taylor
dce8bd6d21 CS: Standardize new with braces 2022-08-15 17:16:23 +01:00
Dylan K. Taylor
38d6284671 Use PHP-CS-Fixer to enforce file header presence 2022-06-04 17:34:49 +01:00
Dylan K. Taylor
6eac2ea7a5 Modernize private property declarations in src/network 2022-05-17 21:22:33 +01:00
Dylan K. Taylor
be1996752a Replace disallowed operators in src/network/ 2022-01-20 19:11:32 +00:00
Dylan K. Taylor
a81680c5c6 missed a few more hardcoded translation keys 2021-08-15 20:12:55 +01:00
Dylan K. Taylor
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
Dylan T
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
Dylan K. Taylor
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
Dylan K. Taylor
94e16f416d Added KnownTranslationKeys (generated) and start using it 2021-06-29 22:46:04 +01:00
Dylan K. Taylor
b7a6c9dc17 Renamed BadPacketException -> PacketHandlingException
this better describes the intent, instead of just vaguely describing a packet as 'bad'.
2021-03-30 01:15:28 +01:00
Dylan K. Taylor
72de45f0e9 Drop pocketmine/uuid for ramsey/uuid 2021-03-16 23:03:00 +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
11eb1f1c5e imports cleanup 2020-06-18 20:01:19 +01:00
Dylan K. Taylor
e6a3f7baa2 Merge branch 'stable'
# Conflicts:
#	resources/vanilla
#	src/pocketmine/Player.php
2020-06-17 22:23:17 +01:00
Dylan K. Taylor
715fca8986 LoginPacketHandler: use playerInfo directly again, fix another 2 PHPStan level 8 errors 2020-06-17 21:30:34 +01:00
Dylan K. Taylor
eefb6ae8e7 LoginPacketHandler: use reference to new PlayerInfo directly, fixes a PHPStan level 8 error 2020-06-17 21:29:16 +01:00
Dylan K. Taylor
503782d67c moved skin-parsing code from LoginPacketHandler to its own dedicated helper class 2020-06-17 21:24:12 +01:00
Dylan K. Taylor
8cabab20e3 Merge commit '09771849aefb70bc29202b160f65723cf926c974'
# Conflicts:
#	resources/vanilla
#	src/pocketmine/network/mcpe/VerifyLoginTask.php
2020-06-17 21:10:59 +01:00
Dylan K. Taylor
3294075aad LoginPacketHandler: use double quotes consistently
the mixture of single quotes and double quotes makes PHPStan type inference quietly not work, and reports an error here in checkExplicitMixed mode.
2020-06-15 20:31:09 +01:00
Dylan K. Taylor
129a7c1b3e LoginPacketHandler: avoid trashing variables in foreach 2020-05-15 11:19:14 +01:00
Dylan K. Taylor
31e4fc6fcb fixing incompatible protocol handling, do not explode immediately on bad clientdata, login encode/decode is now symmetrical 2020-05-15 10:55:29 +01:00
Dylan K. Taylor
36c5d9117d LoginPacketHandler: properly handle failure to base64_decode stuff from JWT
previously this might just return false and blow up in your face.
I considered fixing this on stable too, but it's less useful there because so much stuff on stable just explodes at the first wrong thing anyway.
2020-05-14 09:46:44 +01:00
Dylan K. Taylor
b7cf4f01f9 remove utils\UUID, switch to pocketmine/uuid package 2020-05-11 10:46:48 +01:00
Dylan K. Taylor
549940d8a7 remove NullPacketHandler
this is a waste of LOC
2020-04-29 13:14:23 +01:00