bedrock-tool / bedrocktool

a mostly working minecraft bedrock tool for downloading server worlds, skins and others
GNU General Public License v3.0
183 stars 23 forks source link

Can't connect to geyser servers #178

Closed Agaloth closed 2 months ago

Agaloth commented 4 months ago

Describe the bug time="2024-06-04T17:09:51+02:00" level=info msg="Bedrocktool Version 1.37.0-3" time="2024-06-04T17:09:55+02:00" level=info msg="Connecting to play.terraemc.net:19132"

And it pretty much gets stuck there (I tried waiting 30 minutes and nothing happened as well)

To Reproduce Steps to reproduce the behavior:

  1. Run a spigot/paper server with Geyser (for bedrock crossplay)
  2. Join the server via bedrocktool
  3. See error

Expected behavior It should connect and download the pack

Desktop (please complete the following information):

Additional context Geyser might have their own way of connecting players? This is what I've seen on their discord after checking it up: Geyser has a cookie handshake, if you're not responding to that, that could be one reason. You need to look at the docs in the wiki, and see what exactly is being sent and received

Agaloth commented 4 months ago

This seems to be what they're talking about: https://wiki.vg/Raknet_Protocol#Open_Connection_Reply_1

--DGeyser.RakSendCookie=false Disables sending and validation of a cookie challenge in Open Connection Reply 1 packet. This should not be set to false unless Geyser is running behind a reverse proxy that is also sending a challenge to prevent IP spoofing.

So unless you disable that flag geyser will always send a cookie challenge

Agaloth commented 4 months ago

@olebeck What do you think about this, if you have any ways to message privately let me know as well, thanks!

olebeck commented 3 months ago

go-raknet doesnt implement cookies, however i can add this fairly to the library easily

olebeck commented 3 months ago

actually seems like it does do the cookie handshake correctly

olebeck commented 2 months ago

seems to work fine now, maybe related to a bug i fixed for a different server where it cant handle the advertised MTU. that server happens to use geyser too so likely the same issue