Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot connect to singleplayer or multiplayer as of v2.3.1 - "Unexpected custom data from client" #98

Closed
unilock opened this issue Apr 8, 2024 · 14 comments

Comments

@unilock
Copy link

unilock commented Apr 8, 2024

As of version 2.3.1 of Porting Lib, I'm unable to connect to a dedicated server - the client is almost instantly disconnected with the error "Unexpected custom data from client".

latest.log from client: https://gist.github.com/unilock/794de8311574ee811db993e8d08123e7
latest.log from server: https://gist.github.com/unilock/6ed314c2739792ccaf850755ad098ede

Note that I'm using Quilt (Loader 0.24.0, QFAPI 7.5.0 / QSL 6.1.2), with the server behind a Velocity proxy.

The issue exists on Porting Lib v2.3.2 as well. Downgrading Porting Lib to v2.3.0 resolves the issue.

@TropheusJ
Copy link
Member

Porting Lib syncs configs on login. Velocity seems unable to handle that.

@TropheusJ
Copy link
Member

A vanilla server will disconnect any client that sends a custom login query, which is what's happening here. FAPI adds support for them.

@unilock
Copy link
Author

unilock commented Apr 8, 2024

Great, another issue with Velocity not allowing custom packets during the LOGIN stage. There have been multiple discussions with the Velocity team about this, but they refuse to account for anything other than vanilla behavior.

When Quilt had the same issue (QuiltMC/quilted-fabric-api#46), a server-side mod was created that sent ClientboundLoginPacket / GameJoinS2CPacket earlier in the handshake to make Velocity think that the client was already in the PLAY stage, thus allowing custom packets to go through.

Since Velocity unfortunately does not care, could something similar be done here?

@TropheusJ
Copy link
Member

It might be possible to move sync to PLAY. Changing when vanilla packets are sent sounds extremely dangerous.

@TropheusJ
Copy link
Member

Seems to not actually be a velocity problem

@TropheusJ
Copy link
Member

It seems to be a problem with config sync, but it's normally hidden because nothing happens if no mods use it. Hephaestus uses it.

@unilock
Copy link
Author

unilock commented Apr 11, 2024

Changing when vanilla packets are sent sounds extremely dangerous.

If I remember correctly, the order of packets wasn't changed; rather, GameJoinS2CPacket was sent twice: once earlier in the handshake to trick Velocity into allowing custom packets, and again when it would have normally been sent by vanilla logic.

But that's probably neither here nor there. Glad to hear this isn't a Velocity issue at least :)

@unilock
Copy link
Author

unilock commented Apr 11, 2024

I've just noticed that this also happens when trying to join a singleplayer world.

debug.log: https://gist.github.com/unilock/4270472621816cf921b0f67a162be697

The timestamp in which I started a singleplayer world would be [08:50:00], I believe. (line 23972)

@unilock unilock changed the title Cannot connect to dedicated server as of v2.3.1 - "Unexpected custom data from client" Cannot connect to singleplayer or multiplayer as of v2.3.1 - "Unexpected custom data from client" Apr 11, 2024
LenjoyOfficial added a commit to LenjoyOfficial/Porting-Lib that referenced this issue Apr 13, 2024
@solonovamax
Copy link

I believe that I'm experiencing the issue with fabric 0.15.9, mc version 1.20.1, using create 0.5.1-f-build.1417+mc1.20.1, which bundles porting lib 2.3.2.
I can provide logs if needed.

@AlienXtream
Copy link

same here. dont seem to be able to downgrade either. took me 3 days to narrow down the problem to porting lib. i see there is a pull request that allegedly fixes this. hope we get that patch soon

@solonovamax
Copy link

same here. dont seem to be able to downgrade either. took me 3 days to narrow down the problem to porting lib. i see there is a pull request that allegedly fixes this. hope we get that patch soon

you can build porting lib from source with the correct patch (7ba0f31) applied, and include the resulting binary in your mods folder.

@AlienXtream
Copy link

i have no clue how to do that alas

LenjoyOfficial added a commit to LenjoyOfficial/Porting-Lib that referenced this issue Apr 16, 2024
@Azure-Agst
Copy link

Azure-Agst commented Apr 16, 2024

Lucky for us, Porting Lib has a Github Actions workflow that builds a JAR after every push/PR against the repo. You can find the corresponding artifact for #101 here.

Download the Artifacts.zip and extract it. Your updated JAR should be in there. Adding this version to my mods folder fixed the issue and allowed me to load Create 1.20.1 v0.5.1.f Patch 1 without the "Unexpected custom data" error.

This should work until the patch is merged upstream and released via an update.

@TropheusJ
Copy link
Member

fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants