I'm trying to configure a server with some mods and it won't let me connect.
I created a save file using a scenario (but I forgot to turn on Bobs Inserters during this step)
I uploaded the save file to the server
I tried to connect: got error mods mismatch, bobs inserters on server)
I enabled that mod
I tried to connect: Mod startup settings mismatch.
I clicked yes to sync settings and restarted the game.
I tried to connect: Mod startup settings mismatch.
I do not recall changing any of the mod settings locally and the server should be running with everything on default settings.
I don't know if the Bobs Inserters bit is relevant.
Attached is the save file. The mod pack I'm using is here: https://www.dropbox.com/s/s2x3kaql5v7dt ... 0.zip?dl=0
[Rseding91] [0.16.20] Cannot connect to server: Mod settings mismatch
[Rseding91] [0.16.20] Cannot connect to server: Mod settings mismatch
- Attachments
-
- factoriorpg61-modded.zip
- (2.19 MiB) Downloaded 176 times
Re: [0.16.20] Cannot connect to server: Mod settings mismatch
Thanks for the report. I found the problem but don't currently have a fix I like.
The problem is JSON doesn't support saving numbers in hex format so saving 0.299999999999999 as a string ends up saving 0.3 and then when loaded back into binary format it's 0.3000000000021 and you get different numbers.
Right now there are 2 options proposed:
The problem is JSON doesn't support saving numbers in hex format so saving 0.299999999999999 as a string ends up saving 0.3 and then when loaded back into binary format it's 0.3000000000021 and you get different numbers.
Right now there are 2 options proposed:
- Change the mod-settings.json file to mod-settings.dat and it will write the settings in binary format
- Update to JSON 5 which theoretically supports hex formats for numbers which means we could save floats correctly
If you want to get ahold of me I'm almost always on Discord.
Re: [Rseding91] [0.16.20] Cannot connect to server: Mod settings mismatch
That is weird, because we had similar problems when saving numbers in lua state, and as far as I remember, we solved it without using hexes for numbers.
Re: [Rseding91] [0.16.20] Cannot connect to server: Mod settings mismatch
In the end, we did solve it by serializing numbers in lua state in hex formatkovarex wrote:That is weird, because we had similar problems when saving numbers in lua state, and as far as I remember, we solved it without using hexes for numbers.
Re: [Rseding91] [0.16.20] Cannot connect to server: Mod settings mismatch
If you use code like this, there shouldn't be any rounding errors:
See also man float.h, search for DBL_DIG.
Code: Select all
#include <float.h>
fprintf(file, "%.*lg", DBL_DIG, v);
Re: [Rseding91] [0.16.20] Cannot connect to server: Mod settings mismatch
Ok, I found the underlying problem and it should be fixed for the next version of 0.16.
At least testing with the files you provided works correctly now.
At least testing with the files you provided works correctly now.
If you want to get ahold of me I'm almost always on Discord.