Was watching this video where a player got a desync with your mod after opening a pump menu I think. I had a look at your code and you still seem to store state in locals, and not in the API provided global
. I understand some of them don't save state and rather prototype information, which is fine of course :) But things like g_InputEvents
look fishy, because it might be modified with one player, and then when other player B joins g_InputEvents
will be different that player A's .
Honestly, I would put g_LocalizedSignalNames
in global
as well. This is what big mods like RecipeBook and FactoryPlanner do it, probably for a good reason, even though it increases save file size. Not sure if it's desync safe or not to do it like you do, but most likely it's not. For example on_string_translated
will still be called for all players, even if only one player is out of sync and the others are not. Could be that the engine is immediatelly saying desync
because it saw one client do an request_translation
call, but another client not.
I would highly recommend using global
if you're not 100% sure that information stored in that table will always be exactly the same between players, regardless of when they join the game, etc. Only thing I know is safe is storing prototype information.
Of course, I might be wrong, you look like you know what you're doing. But I saw a desync, and some code that triggers my spidy senses. And personally I would prefer to be notified of possible issues so I can fix it, because players don't always make bug reports XD