Open metabrixkt opened 11 months ago
Hello, sorry for the late reply.
I haven't looked too deeply into the issue yet, but I believe directly calling S2CMessages.registerAll()
inside C2SMessages#attemptHandshake()
would cause some compatibility problems with MinecraftForge.
It's been a while since I touched the networking code, so I could be wrong.
Anyways, thanks for the pointers! I have sent you a message on Discord for the demo setup.
Issue Description:
The mod's server integration feature doesn't work properly on multi-server setups with proxies, where the mod is installed on the backend (like Fabric server or, in my case, as a custom Paper plugin).
What happens:
When you change server, the client sends C2SHandshakeStart and the server responds with S2CHandshakeResponse, however this is the second server, and therefore the second handshake response. The second handshake response is ignored, because after the first one, the client mod unregisters handshake response message at S2CHandshakeResponse.java:53.
What you expected to happen:
When the mod attempts a handshake, it re-registers all s2c messages.
Steps to reproduce:
Reproducing it is pretty difficult, because it requires you to have at least two backends and one proxy. Basically have two servers with the mod installed and after you switch server (e.g.
/server another_server
on Velocity), server integration stops workingPossible Fix:
Add
S2CMessages.registerAll()
in the beginning ofC2SMessages#attemptHandshake()
Affected Versions:
v4.0.4+1.20.1
1.20.1
0.21.1
7.4.0+0.90.0-1.20.1
You can contact me on Discord
@metabrix
for a demo setup or a ShulkerBoxTooltip Paper plugin