adde0109 / Ambassador

This is a Velocity plugin that makes it possible to host a modern forge server behind a Velocity proxy!
GNU Lesser General Public License v2.1
85 stars 18 forks source link

[1.5.2 BETA] Unable to switch servers #54

Open PavlychevV opened 4 months ago

PavlychevV commented 4 months ago
[11:30:58 INFO]: [server connection] Player -> Server1 has connected
[11:31:10 INFO]: [server connection] Player -> Server2 has connected
[11:31:11 ERROR] [ambassador]: Unable to switch due to the registries of Server2 being different from the registries of Server1
[11:31:11 INFO]: [server connection] Player -> Server2 has disconnected
[11:31:11 ERROR]: [connected player] Player (ip): unable to connect to server Server2
com.velocitypowered.proxy.util.except.QuietRuntimeException: The connection to the remote server was unexpectedly closed.

Unable to switch servers on ambassador v1.5.2 beta. Everything works fine on ambassador v1.4.4. Using Minecraft 1.19.2, Forge 43.3.0, Velocity 3.3.9-390, both servers have the same mods.

adde0109 commented 4 months ago

You can solve this in 3 different ways:

The reason it stops you from switching is because it is unstable to switch without resetting the client because the registries do no match. Like blocks could be missing or bugged and stuff like that. If you don't have a client reset mod installed it will try to switch without resetting instead of kicking you like 1.4 does.

PavlychevV commented 4 months ago

I tried the first two ones:

  1. if I disable only the registry checks, it still doesn't allow me to join, same error; if I disable the mod checks too, I will get really cursed blocks instead of modded ones (Sophisticated backpacks on the picture) image
  2. With client reset mod and v1.5.2 beta, nothing happens, but with v1.4.4 it doesn't work at all (kicks from the server, error on the picture) CleanShot 2024-05-12 at 22 32 02@2x

As for the third one, I didn't find a way to disable it in the config file, the only solution that works for me is installing the latest stable build (v1.4.4). But the whole reason of me submitting this issue is to try to make it work without kick reset, so I hope you can help me solve it or fix something in the code, as it is still an unstable beta.

adde0109 commented 4 months ago

I think the client reset mod didn't load in correctly. You could enable debug-mode in the config file on 1.5.2 and see if the client reset mod gets used or not.

PavlychevV commented 4 months ago

This is with the mod installed and velocity running ambassador v1.5.2:

Bypass both checks = false

CleanShot 2024-05-13 at 23 23 18@2x

PaskhalkoAuth is Server1 Paskhalko is Server2

Ambassador.toml

# Do not change this
config-version = "2.0"

# How much time the player has to reconnect before canceling the server switch. (In seconds)
# Only for players with ServerRedirect mod installed. Set to -1 to disable ServerRedirect mod support.
serverRedirectTimeout = 30

# Silence PCF absence warnings.
silence-warnings = false

# Allow server switches without reset even though the new server's registries don't match the old server’s registry.
# Large modpacks often needs this set to true. Warning: This is a safety measure and setting this to true
# can lead to unstable behaviour.
bypass-registry-checks = false

# Allow player to switch without reset when the server's mods don't match. Even more unstable than bypassRegistryCheck.
# Warning: This is a safety measure for when bypassRegistryCheck is true. Setting this to also true can cause crashes.
bypass-mod-checks = false

#Only for debug/troubleshooting
debug-mode = true

Client log when switching

[23:23:41] [Render thread/INFO] [minecraft/ChatComponent]: [System] [CHAT] Expecting 24 packets from server Paskhalko
[23:23:43] [Render thread/INFO] [minecraft/ChatComponent]: [System] [CHAT] Handshake took: 1188 ms
[23:23:43] [Render thread/INFO] [minecraft/ChatComponent]: [System] [CHAT] Avg packet time49 ms
[23:23:43] [Render thread/INFO] [minecraft/ChatComponent]: [System] [CHAT] Unable to connect you to Paskhalko. Please try again later.

Velocity log when switching

[23:23:41 INFO]: [server connection] CommandBlockYTX -> Paskhalko has connected
[23:23:43 ERROR] [ambassador]: Unable to switch due to the registries of Paskhalko being different from the registries of PaskhalkoAuth
[23:23:43 INFO]: [server connection] CommandBlockYTX -> Paskhalko has disconnected
[23:23:43 ERROR]: [connected player] CommandBlockYTX (/ip): unable to connect to server Paskhalko
com.velocitypowered.proxy.util.except.QuietRuntimeException: The connection to the remote server was unexpectedly closed.

Main server log when switching

[23:23:43] [Server thread/INFO] [minecraft/ServerLoginPacketListenerImpl]: com.mojang.authlib.GameProfile@4dd051e4[info of CommandBlockYTX] (/ip) lost connection: Disconnected

Bypass both checks = true

Ambassador.toml

# Do not change this
config-version = "2.0"

# How much time the player has to reconnect before canceling the server switch. (In seconds)
# Only for players with ServerRedirect mod installed. Set to -1 to disable ServerRedirect mod support.
serverRedirectTimeout = 30

# Silence PCF absence warnings.
silence-warnings = false

# Allow server switches without reset even though the new server's registries don't match the old server’s registry.
# Large modpacks often needs this set to true. Warning: This is a safety measure and setting this to true
# can lead to unstable behaviour.
bypass-registry-checks = true

# Allow player to switch without reset when the server's mods don't match. Even more unstable than bypassRegistryCheck.
# Warning: This is a safety measure for when bypassRegistryCheck is true. Setting this to also true can cause crashes.
bypass-mod-checks = true

#Only for debug/troubleshooting
debug-mode = true

The server does switch, but all the modded stuff breaks and becomes cursed. With this configuration, such message appears: CleanShot 2024-05-13 at 23 34 05@2x

adde0109 commented 4 months ago

As I suspected the client reset mod is not getting loaded correctly. Which version did you download?

PavlychevV commented 4 months ago

I downloaded the latest for 1.19.2 from CurseForge.

adde0109 commented 4 months ago

Could you provide full client logs?

PavlychevV commented 4 months ago

Here

Line 1086 — initial connection to server Line 2038 — server switch starting

adde0109 commented 4 months ago

Chat output when you first join the proxy? It should have some information when debug-mode is enabled.

PavlychevV commented 4 months ago

This is the chat log I think. I've sent it before via a chat screenshot though.

CleanShot 2024-05-14 at 07 16 24@2x

TheFlash787 commented 3 months ago

I'm having this same issue, but with two (or more) servers that are identical in terms of installed mods. The recent changelog implies that server switching can be done without the client reset mod, when both servers have the same (or similar mods). This doesn't seem to be the case.

TheFlash787 commented 3 months ago

Further developments, I need to specifically disable the mod checks and registry checks in order for this to work. However with both servers having identical mods, it would seem as though this isn't intentional, as those mod and registry checks should generally pass.

No errors are thrown when they're enabled though, just that the registries are different.

PavlychevV commented 3 months ago

I literally symlinked my mods folders and even that didn't work

Kriptiq commented 1 month ago

I get the same errors, trying the same things with a Vault Hunter 1.18.2 forge server transferring from a paperMC lobby on our Velocity proxy. Also used the newest version of client reset mod from curseforge for 1.18.2. Only thing we can get to work at the moment is just using the stable 1.4.4 ambassador build and PCF then get the disconnect message and join network again and we will load into the forge server.

Edit: Further testing 1.4.4 with PCF and Forge Client Reset Packet, works after more attempts successfully connected 4 of 6 times. Seems to just disconnect on occassion.)

Edit2: Increasing read timeout on velocity and forge server fixed this occassional disconnect. (Still get as OP above if trying 1.5.2, cannot connect. Please try again later.) Will continue to mess with it.