Page 1 of 1

[1.1.35] Desync on Modded Scenario

Posted: Sun Jun 20, 2021 3:46 pm
by peacemaker83
Every player get desync after few minutes from start. Its the 2nd time i've run the map with the weaponbalancer mod so i think maybe the problem is in the scenario code. The desync occurs without doing anything special.

https://www.mediafire.com/file/kkwaa4le ... 7.zip/file

here is some code i added lately

function write_player_list()
local players = { }
for _, player in pairs(game.connected_players) do
table.insert(players, player.name)
end
local string = table.concat(players, "\n")
if string == nil or string == "" then string = "None" end
game.write_file("players.txt",string)
end

local Event = require 'utils.event'
Event.add(defines.events.on_player_joined_game, write_player_list)
Event.add(defines.events.on_player_left_game, write_player_list)

Re: [1.1.35] Desync on Modded Scenario

Posted: Tue Nov 16, 2021 10:10 pm
by Gerkiz
Hello,

The author of this scenario has coded it a bit wrongly.

The author is storing LuaPlayer as a key inside a global table...

Code: Select all

key = {
    ["{LuaPlayer, name = 'Gerkiz', index = 1}"] = true,
    [{
      magic = "802384732948701238470123",
      playertarget = 2,
      type = 21
    }] = true
}
I'll push a fix to our repo.

/Gerkiz

Re: [1.1.35] Desync on Modded Scenario

Posted: Tue Nov 16, 2021 10:15 pm
by Gerkiz