jpcsupplies / Economy_mod

Basic Economy System for Space Engineers
13 stars 12 forks source link

[bug] timer1eventsonelapsed exception #170

Closed jpcsupplies closed 7 years ago

jpcsupplies commented 7 years ago

Need more details - have pasted what user has reported below - [GSF] Neimoh 1 hour ago
I've been having this same crash for a few weeks now....

[GSF] Neimoh 1 hour ago

Exception occured: System.InvalidOperationException: Collection was modified; enumeration operation may not execute.
at System.ThrowHelper.ThrowInvalidOperationException(ExceptionResource resource)
at System.Collections.Generic.List`1.Enumerator.MoveNextRare()
at Sandbox.ModAPI.MyTerminalControlFactoryHelper.GetProperty(String id, Type blockType)
at Sandbox.ModAPI.Interfaces.TerminalPropertyExtensions.GetValue[T](IMyTerminalBlock block, String propertyId)
at Economy.scripts.Management.LcdManager.ProcessLcdBlock(IMyTextPanel textPanel)
at Economy.scripts.Management.LcdManager.UpdateLcds()
at Economy.scripts.EconomyScript.<Timer1EventsOnElapsed>b__47_0()
at Sandbox.MySandboxGame.ProcessInvoke()
at Sandbox.MySandboxGame.Update()
at Sandbox.Engine.Platform.Game.UpdateInternal()
at Sandbox.Engine.Platform.Game.RunSingleFrame()
at Sandbox.Engine.Platform.FixedLoop.<>c__DisplayClass1.<Run>b__0()
at Sandbox.Engine.Platform.GenericLoop.Run(VoidAction tickCallback)
at Sandbox.Engine.Platform.Game.RunLoop()
at Sandbox.MySandboxGame.Run(Boolean customRenderLoop, Action disposeSplashScreen)
at SpaceEngineers.MyProgram.Main(String[] args)
jpcsupplies commented 7 years ago

Looks similar to the other crash we found ? #166

midspace commented 7 years ago

Same error, different location. Probabably here: https://github.com/jpcsupplies/Economy_mod/blob/master/Economy/Data/Scripts/Economy.scripts/Management/LcdManager.cs#L151

jpcsupplies commented 7 years ago

Should we disable that part and just use a fixed time say every 4 secs or so? Most people probably dont realise they can tweak the update speed anyway.

midspace commented 7 years ago

It needs an appropriate try catch. The catch should probably return;

We should also add a minimum server specified configuration for the time. That way admins have a flexible method of slowing the update cycle of lcds.

midspace commented 7 years ago

Neimoh testing and has confirmed it is working.