Sync config between server and client
minimusubi opened this issue ยท 3 comments
Describe the feature
Issue
When a client and a server both have the mod installed, if the client's config does not match the server's, the client can see unexpected results.
Actual Behavior
For example, if the server has tools.speedMultiplicand
set to 1.0
, but the client has the default value of 0.0
, then the client will show tree blocks breaking at the wrong speed. Once the block is broken, it will reappear, until the server thinks that the time is up, at which point the tree will break.
Issue Demonstration
The server'stools.speedMultiplicand
is set to 1.0
, while the client has the default value of 0.0
.
I can confirm that I see the expected behavior when the configurations match.
Expected Behavior
When a client with the mod installed connects to a server with the mod installed, the server sends the client the configuration to use for the duration of that session. The client configuration file should not be modified. This way, a client can connect to multiple servers without having to modify the client config file, and still see the expected results.
Report Details
Minecraft 1.19
Forge 1.19-41.0.38
FallingTree 1.19-3.6.1
I think this is doable and will look into this.
However it won't fully solve the sync issue. Currently there's 2 config that needs to be set the same way between the client & the server:
- breakSpeedMultiplier
- enchantments registration
The break speed will work fine, but the enchantments won't as it requires a restart of the client to (un)register them.
But I personally think that syncing the break speed should be enough. If enchants are enabled it's a much more constraining change (forces client to have the mod) so I assume people have it in mod packs in that case (with the config shared along with it).
What about trees.detectionMode
? In the case that a non-zero speedMultiplicand
set, and detectionMode differs across server/client, could this cause incorrect "time to break" calculations on the client?
I made a first shot at it just to try the networking by itself. I don't have that much time to test it a lot for now though.
It should sync the speed multiplicand from the server to the client (which from my testing seems to do so).
What I didn't try and is interesting to know:
- What happens if connecting from to a server (hence modifying the conf) and then going to single player? Is the overridden conf kept or is it reloaded upon joining the world?
- What happens to the conf file when leaving the multiplayer world? Is it saved or not?
- Can a vanilla client still connect to the server?
- Can a modded FT client join a Vanilla server?
I'll eventually look into those, but if you're willing to you can try it with the build artifact available here (forge 1.19).