Skip to content

"Assertion failed! Expression: false, File: Packet.cpp, Line: 425" #16

Description

@MelvinMod

I'm getting a C++ error Assertion failed! Expression: false, File: Packet.cpp, Line: 425

Image

The problem is that LegacyCrossPlay connects to Java servers with minecraft-protocol as version "1.8.9" which doesn't have profile key signing. But I'm using ViaProxy too, so, if the target server is 1.19+ and enforces secure profiles, the server will reject the connection.

javaclienthandler.js has authConfig with version: "1.8.9". mc.createClient(authConfig) is how you connect.

For servers enforcing secure profiles (1.19+), the client should:

Use a version with support for profile keys (1.19+)
ProfileKeys set (certificates fetched)
Send signature in login_start packet

In setProtocol.js , when client.profileKeys is set and the version doesn't support chat sessions (1.19-1.19.2), the signature is sent in login_start
1.19.3+ (useChatSessions): sends profile keys after encryption (chat_session_update)
Currently the auth.js only fetches the Minecraft Java token, not certificates. The getMinecraftJavaToken call is missing fetchCertificates: true.

In microsoftAuth.js (built-in to minecraft-protocol) it calls getMinecraftJavaToken({ fetchProfile: true, fetchCertificates:!options.disableChatSigning }) followed by Object.assign(client, certificates) which sets client.profileKeys.

However, in LegacyCrossPlay's javaclienthandler.js, the auth is done manually through auth.js which only grabs the token, not certificates. mc.createClient is called with auth: "microsoft" and a session object, but no profile.Keys. If you are using "microsoft" it will use microsoftAuth.js which calls getMinecraftJavaToken({ fetchProfile: true, fetchCertificates: !options.disableChatSigning). So it should get certificate automatically.

But in LegacyCrossPlay the auth is done differently, pre-auths via auth.js and then passes the session to mc.createClient auth: "microsoft"

EDIT: The error in Packet.cpp line 425 is an assert on "Bad packet id". The LCE client receives a packet with an unknown ID. The problem is that javaclienthandler.js sends packets with Java ID (for example, 0x03, 0x04), but the LCE client expects LCE ID.

EDIT 2: Legacy Console Edition (Xbox/PS4) uses Little Endian for numbers and UTF-16LE for strings, while your PacketWriter writes in Big Endian (like Java). Because of this, the string length is read incorrectly (for example, 5 becomes 1280), and the game crashes.

Idea

can you make a plugin for ViaProxy to support any versions of Java server or just create the same way as ViaProxy did

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions