fix(network): reset the connection type to vanilla when receiving the configuration start packet
The reason for this change is that if you connect to a modded server on a proxy, and then go back to a vanilla/spigot server, the Forge client still thinks you're on a modded server.
I'm not sure if this solution is perfect, however I have tested it with a mixin and it works so I thought best to submit it and then go from there
Ya that's my main concern unfortunately, we still have to use the first intention packet to inform the other side of the connection what all to expect in the configuration phase.
Just switching to vanilla and hoping for the best wouldn't be a viable solution.
Honestly I was hoping proxies would actually use the new vanilla packet and just reset the connections.
Oh, I have an idea, what if we use the server brand packet to determine which protocol a reset gets set into? This would just mean that proxies would have to send the server brand of the NEW server to the client using the normal CustomPayloadPacket right before sending the config reset. If they dont send it, then we'll use whatever was last sent, which on a forge server should be Forge. It would still mess things up if they DIDN'T send it correctly when switching from vanilla -> forge tho :/
That or we could us the whole cookie system that mojang introduced. Point is there are options, but blindly setting it to vanilla is not one of them as it would cause issues switching between forge and forge servers.
Ya that's my main concern unfortunately, we still have to use the first intention packet to inform the other side of the connection what all to expect in the configuration phase.
Just switching to vanilla and hoping for the best wouldn't be a viable solution.
Honestly I was hoping proxies would actually use the new vanilla packet and just reset the connections.
Oh, I have an idea, what if we use the server brand packet to determine which protocol a reset gets set into? This would just mean that proxies would have to send the server brand of the NEW server to the client using the normal CustomPayloadPacket right before sending the config reset. If they dont send it, then we'll use whatever was last sent, which on a forge server should be Forge. It would still mess things up if they DIDN'T send it correctly when switching from vanilla -> forge tho :/
That or we could us the whole cookie system that mojang introduced. Point is there are options, but blindly setting it to vanilla is not one of them as it would cause issues switching between forge and forge servers.
So if we were to take the brand packet approach we'd look for "vanilla" and then set the connection type to vanilla then? I'm just thinking about things like PaperSpigot, Spigot, or even Hybrids and how we'd know to identify them as Vanilla or modded?
So if we were to take the brand packet approach we'd look for "vanilla" and then set the connection type to vanilla then? I'm just thinking about things like PaperSpigot, Spigot, or even Hybrids and how we'd know to identify them as Vanilla or modded?
Correct, you would just send the brand packet of the NEW server to the client before restarting the handshake. This would need to be implemented on the proxy end obviously. But as long as they properly specify which brand it is, we can use that to determine if we need to do the handshake.