Page 1 of 1

[15.37] mod handlers not identical between you and server

Posted: Sun Nov 12, 2017 2:02 am
by mediamagnet
Hello, I've been getting an odd failure to connect issue issue from my dedicated server. Whenever I try to connect it complains about a mismatch between myself and the dedicated server. it has happened to some of the other people who have connected to the server also. Normally a reboot of the dedicated server will fix however I'm wondering if something more long term can be done to resolve. I am direct connecting to the server and have not tried from the server list though I'm not sure if that would make a difference.

Thank you in advance.

only thing in my mod folder is the modlist.json

latest autosave:

http://fallenfocus.net/tas/_autosave1.zip

Current log from my laptop:

http://fallenfocus.net/zerobin/?7b225f3 ... 6Rn/IH4EQ=

Previous log from my server

http://fallenfocus.net/zerobin/?85d791f ... y6ByZbi70=

Image

Re: [15.37] mod handlers not identical between you and server

Posted: Sun Nov 12, 2017 2:41 am
by deef0000dragon1
It appears that the error only starts after the following script is run
/c
script.on_event(defines.events.on_tick, function(event)


rotime = 5
alphatime = 20

round = rotime*60
tick = event.tick%round
red = 0
green = 0
blue = 0
alpha = 0


if (tick < (round / 3)) then
green = tick
red = (round/3)-tick
blue = 0
end

if (tick >= (round /3) and tick < (round/3*2) ) then
green = (round/3*2)-tick
red = 0
blue = tick-(round/3)
end

if (tick >= (round/3*2)) then
green = 0
red = tick - (round/3*2)
blue = round - tick
end

red = red/(round/3)
green= green/(round/3)
blue = blue/(round/3)
alpha = math.cos(math.pi*2/alphatime*tick/60)/2+.5

game.players["deef0000dragon1"].color={r=red, g=green, b=blue, a=alpha}

end)

Re: [15.37] mod handlers not identical between you and server

Posted: Sun Nov 12, 2017 3:00 am
by Nexela
That is correct behavior running event handlers -- script.on_event() -- are not stored in the save file. If you enter that into the console then any connecting players will get a version without the event resulting in a mismatch.

To fix it the script would have to be part of a scenario or mod and it will run correctly when other players load.

Re: [15.37] mod handlers not identical between you and server

Posted: Sun Nov 12, 2017 3:58 am
by mediamagnet
Got it. So basically just don't have multicolored names.

Re: [15.37] mod handlers not identical between you and server

Posted: Sun Nov 12, 2017 9:12 am
by eradicator
mediamagnet wrote:Got it. So basically just don't have multicolored names.
Basically don't do any event handlers at all on the ingame console. Add them to the map/scenario/savegame as stated above.
Nice idea btw. You need to fix the color change from red to brown tho, it's a bit abrupt :P. Also .color is not just your names color, it's the player color, and if you happen to be the leader of your force it's also the force color and applies to all applicable entities in the force (turrents etc).

Re: [15.37] mod handlers not identical between you and server

Posted: Sun Nov 12, 2017 9:12 am
by Klonan
mediamagnet wrote:Got it. So basically just don't have multicolored names.
You can have multi-colored names, just include it in your script

When you add it as a console command, it does not play nicely in MP