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

Add Floodgate support #68

Open
NyaomiDEV opened this issue Apr 4, 2024 · 2 comments
Open

Add Floodgate support #68

NyaomiDEV opened this issue Apr 4, 2024 · 2 comments

Comments

@NyaomiDEV
Copy link

As I mentioned in #1 (comment) proxy setups work if they have GeyserMC installed, but at one condition: the Floodgate data cannot be forwarded back to the server if it is sleeping.

I don't exactly know if Floodgate sends extra data with the login packet in a way that breaks Lazymc, but probably this is worth supporting.

[17:39:14 INFO] [geyser]: /192.168.1.220:53171 tried to connect!
[17:39:15 INFO] [geyser]: Player connected with username NyaomiPLAY
[17:39:15 INFO] [geyser]: NyaomiPLAY (logged in as: NyaomiPLAY) has connected to the Java server
[17:39:15 INFO] [floodgate]: Floodgate player who is logged in as NyaomiPLAY <UUID> joined
[17:39:15 INFO]: [connected player] NyaomiPLAY (/192.168.1.220:0) has connected
[17:39:15 INFO]: [server connection] NyaomiPLAY -> server has connected
[17:39:15 INFO]: [server connection] NyaomiPLAY -> server has disconnected
[17:39:15 ERROR]: [connected player] NyaomiPLAY (/192.168.1.220:0): unable to connect to server server
com.velocitypowered.proxy.util.except.QuietRuntimeException: The connection to the remote server was unexpectedly closed.
[17:39:15 INFO]: [connected player] NyaomiPLAY (/192.168.1.220:0) has disconnected: Unable to connect you to server. Please try again later.
[17:39:15 INFO] [floodgate]: Floodgate player logged in as NyaomiPLAY disconnected
[17:39:15 INFO] [geyser]: NyaomiPLAY has disconnected from the Java server because of §r§cUnable to connect you to server. Please try again later.
@NyaomiDEV
Copy link
Author

 DEBUG lazymc > Got malformed handshake from client, disconnecting

Hmmmm

@NyaomiDEV
Copy link
Author

NyaomiDEV commented Apr 4, 2024

It was easy!

https://github.com/timvisee/rust-minecraft-protocol/blob/4a4f2e2a1c04d23db99e178d5144e17889eaa8bf/protocol/src/version/v1_14_4/handshake.rs#L32

pub struct Handshake {
    #[data_type(with = "var_int")]
    pub protocol_version: i32,
    #[data_type(max_length = 65535)] // was max_length = 255
    pub server_addr: String,
    pub server_port: u16,
    #[data_type(with = "var_int")]
    pub next_state: i32,
}

@timvisee please add this change 🥺


Okay, I feel as though it should be noted that it seems Velocity, BungeeCord and Floodgate like to append stuff into server_addr for player forwarding and authentication purposes. While it may seem "a lot" to allow for a 65535 bytes long string, we don't even know if tomorrow there will be another player proxy that appends a ton of extra information to this packet. So, while we're left wondering, this seems safe enough to keep around.

(Also I am currently using a self-compiled version of Lazymc, so while it doesn't break I'm happy)

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

1 participant