Conversation
Signed-off-by: Oldřich Jedlička <oldium.pro@gmail.com>
Signed-off-by: Oldřich Jedlička <oldium.pro@gmail.com>
| String originalAddress; | ||
| String remaining; | ||
| if (isModernForwarding && addressFinished == -1) { | ||
| if (isModernForwarding || addressFinished == -1) { |
There was a problem hiding this comment.
I'm confused - why make this change?
There was a problem hiding this comment.
This if tries to prevent using -1 in a call to substring, but with && this is limited to only isModernForwarding, which is definitely wrong.
Changing this to || means to additionally force a different address format when Velocity with “modern” IP forwarding is used. It fixes error during connection (I will check again and write which exactly).
I verified that Velocity with “modern” IP forwarding is able to connect after this change. I have not checked what is really wrong with the packet format, but I can investigate it more.
I do not have Floodgate API running on the server, because the server is used also by Java clients at the same time and I do not need it. Anyway, I have more knowledge now, so I can investigate this more in depth. I have sources of Velocity, FastLogin and Floodgate, so I can check how it should really cooperate and if my fix is the right one.
|
I had a quick look at the issue and Velocity “modern” IP forwarding is not forwarding anything in the Server Address field of the |
|
It is my understanding that modern forwarding in Velocity works correctly, and there's been no regression that breaks it. So this is likely something specific to your setup? |
|
Before I continue - just for my understanding. This is my scenario: Bedrock Client → Geyser → Velocity[1] + Floodgate + FastLogin → PaperMC[1] + FastLogin + AdvancedLogin I have two Velocity proxies, one for Bedrock and one for Java clients, they distribute clients to the particular PaperMC instance by the server name in the HANDSHAKE request. Is it required that the Floodgate plugin runs also on the shared PaperMC server instances? |
|
We have floodgate on the server behind the proxy. Without we had troubles (some time ago) that bedrockplayers couldn't use pressureplates on p2 plots. Don't know why this happened but with floodgate everything is fine. Atm we use velocity with modern forwarding without problems. I don't really get why you have 2 poxys... Did you know that that you can use velocitys forced hosts with Geyser? You need to enable "host-forwarding" or something like that in the Geyser config and the velocity can decide from the domain you're connecting to which server the player should be send to. |
|
You don't need Geyser nor Floodgate in backend servers. You only need floodgate in backend for the API (afaik, maybe my infos are too old). |
I am using host forwarding on Geyser, also a PROXY protocol between Geyser to Velocity[1], so that I have the client's source address. This is also a difference from Velocity[2], which accepts Java clients directly without a PROXY protocol.
This is what I read too. I need to check what is forwarded between Geyser → Velocity and what between Velocity → PaperMC. The PaperMC server running in Velocity mode behaves differently to Server Address field, so I will check whether this is the actual issue. I will keep you informed when I map the information forwarding strategies for the plugins which I use (Geyser standalone, |
|
I did not have time to have a look at this, so please be patient. I plan to do the investigation. 😊 |
|
I'm closing this draft PR because from what I know modern forwarding is working correctly. |
Fixed few issues in Floodgate plugin when running on Velocity proxy:
modernIP forwarding was enabled on Velocity proxy.PreLoginEvent- not the Floodgate one, but the one from the client's request.The
PreLoginEventwas fixed in the similar way as it is in the BungeeCord plugin support – it changes the user name property in the fired event instance itself. The UUID player part is already handled in theGameProfileRequestEventhandler, so this already works fine.