Breaking Changes
-
#130: Renamed "shared_key" field to "shared_secret" in
LoginEncryptionPacket
, following the official terminology.- This is a breaking change,
LoginEncryptionPacket
's__init__
method now uses "shared_secret" keyword only argument, not "shared_key".
- This is a breaking change,
-
#130: The
LoginStart
packet now contains a (required) UUID field (which can be explicitly set toNone
).- For some reason, this field was not added when the login packets were introduced initially, and while the UUID field can indeed be omitted in some cases (it is an optional filed), in vast majority of cases, it will be present, and we should absolutely support it.
- As this is a new required field, the
__init__
function ofLoginStart
now also expects thisuuid
keyword argument to be present, making this a breaking change.
-
#159: Fix packet compression handling in the interaction methods.
This fixes a bug that didn't allow for specifying an exact compression threshold that the server specified in
LoginSetCompression
packet, and instead only allowing to toggle between compression on/off, which doesn't really work as server doesn't expect compression for packets below that threshold.sync_write_packet
,async_write_pakcet
,sync_read_packet
andasync_read_packet
functions now takecompression_threshold
instead ofcompressed
bool flag
-
#161:
LoginEncryptionRequest
now usescryptography.hazmat.primitives.asymmetric.rsa.RSAPublicKey
to hold the public key, instead of just purebytes
. Encoding and decoding of this key happens automatically during serialize/deserialize. This is a breaking change for anyone relying on thepublic_key
field from this packet beingbytes
, and for anyone initializing this packet directly with__init__
, which now expectsRSAPublicKey
instance instead.
Features
- #129: Added a system for handling Minecraft authentication
- Yggdrasil system for unmigrated i.e. non-Microsoft accounts (supportng Minecraft accounts, and the really old Mojang accounts)
- Microsoft OAuth2 system (Xbox live) for migrated i.e. Microsoft accounts
- #160: Re-export the packet classes (or any other objects) from the gamestate modules (
mcproto.packets.handshaking
/mcproto.packets.login
/...) directly. Allowing simpler imports (from mcproto.packets.login import LoginStart
instead offrom mcproto.packets.login.login import LoginStart
) - #161: Add support for encryption. Connection classes now have
enable_encryption
method, and some encryption related functions were added into a newmcproto.encryption
module. - #168: Add multiplayer related functionalities for requesting and checking joins for original (bought) minecraft accounts. This allows us to join online servers.
- #171: Add
Account.check
function, to verify that the access token in use is valid, and the data the Account instance has matches the data minecraft API has.
Bugfixes
- #130:
LoginEncryptionResponse
now includes theserver_id
field. This field was previously hard-coded to 20 spaces (blank value), which is what all minecraft clients on minecraft 1.7.x or higher do, however with older versions, this field is set to 20 random characters, which we should respect.- This is not a breaking change, as
server_id
will default toNone
inLoginEncryptionResponse
's__init__
, meaning any existing code utilizing this packet will still work. It is purely an additional option.
- This is not a breaking change, as
- #167: Fix packet reading/writing when compression is enabled (use zlib as expected, instead of gzip which we were using before)
- #170: Preserve the call parameters and overloads in the typing signature of
mcproto.packets.packet_map.generate_packet_map
function. (This wasn't the case before, sincefunctools.lru_cache
doesn't preserve this data). Note that this loses on the typing information about the cache itself, as now it will appear to be a regular uncached function to the type-checker. We deemed this approach better to the alternative of no typing info for call arguments or overloads, but preserving cache info.
Documentation Improvements
-
#129: Mention lack of synchronous alternatives for certain functions (see issue #128)
-
#139: Add a warning in version guarantees page, explaining pre-release guarantees (breaking changes in minor versions allowed)
-
#141: Move installation instructions from README to Installation docs page
-
#144: Add attributetable internal sphinx extension for showing all attributes and methods for specified classes.
- This adds
attributetable
sphinx directive, which can be used before autodoc directive. This will create the attribute table, which will get dynamically moved right below the class definition from autodoc (using javascript). - This extension was implemented by discord.py, this is just re-using that code, with some modifications to fit our code style and to fit the documentation design (furo theme).
- This adds
-
Updated contributing guidelines (restructure and rewrite some categories, to make it more readable)
Internal Changes
-
#133: Enable enforcement of some optional pyright rules
-
#153: Replace flake8 linter with ruff (mostly equivalent, but much faster and configurable from pyproject.toml)
-
#154: Enforce various new ruff linter rules:
- PGH: pygrep-hooks (replaces pre-commit version)
- PL: pylint (bunch of typing related linter rules)
- UP: pyupgrade (forces use of the newest possible standards, depending on target version)
- RET: flake8-return (various linter rules related to function returns)
- Q: flake8-quotes (always use double quotes)
- ASYNC: flake8-async (report blocking operations in async functions)
- INT: flake-gettext (gettext related linting rules)
- PTH: flake8-use-pathlib (always prefer pathlib alternatives to the os ones)
- RUF: ruff custom rules (various additional rules created by the ruff linter team)