MisterPeModder / ShulkerBoxTooltip

What's in my shulker box?
MIT License
101 stars 32 forks source link

Proxies are not fully supported #139

Open metabrixkt opened 11 months ago

metabrixkt commented 11 months ago

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 working

Possible Fix:

Add S2CMessages.registerAll() in the beginning of C2SMessages#attemptHandshake()

Affected Versions:


You can contact me on Discord @metabrix for a demo setup or a ShulkerBoxTooltip Paper plugin

MisterPeModder commented 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.