TorchAPI / Torch

An extensible modding framework and improved client/DS for Space Engineers. Still a work in progress!
Apache License 2.0
146 stars 76 forks source link

Programmable block causes exception when Torch is run with -nogui parameter #104

Closed jimmble closed 7 years ago

jimmble commented 7 years ago

Torch Version: 1.1.229.265-64-g3d6806b SE Version: 1.183.200

Expected Behavior

Programmable block runs the program.

Observed Behavior

17:20:43.3903 [ERROR] NetworkManager: System.NullReferenceException: Object reference not set to an instance of an object. at Sandbox.Game.Entities.Blocks.MyProgrammableBlock.RunSandboxedProgramAction(Action1 action, String& response) at Sandbox.Game.Entities.Blocks.MyProgrammableBlock.Run(String argument) at lambda_method(Closure , MyProgrammableBlock , Byte[] , DBNull , DBNull , DBNull , DBNull , DBNull ) at VRage.Network.CallSite7.Invoke(BitStream stream, Object obj, Boolean validate) at VRage.Network.MyReplicationLayer.Invoke(CallSite callSite, BitStream stream, Object obj, EndpointId source, MyClientStateBase clientState, Boolean validate) at VRage.Network.MyReplicationServer.OnEvent(BitStream stream, CallSite site, Object obj, IMyNetObject sendAs, EndpointId source) at VRage.Network.MyReplicationLayer.OnEvent(BitStream stream, NetworkId networkId, NetworkId blockedNetId, UInt32 eventId, EndpointId sender) at VRage.Network.MyReplicationLayer.ProcessEvent(BitStream stream, EndpointId sender) at Torch.Managers.NetworkManager.OnEvent(MyPacket packet) in C:\Program Files (x86)\Jenkins\workspace\Torch_Torch_staging-ZNS7FN4RGURQGN7YDLUHQ3UMYIBPHQSIJWKCAY6N7MCURWHGXRKA\Torch\Managers\NetworkManager\NetworkManager.cs:line 206

17:30:25.2954 [FATAL] Initializer: System.NullReferenceException: Object reference not set to an instance of an object. at Sandbox.Game.Entities.Blocks.MyProgrammableBlock.RunSandboxedProgramAction(Action1 action, String& response) at Sandbox.Game.Entities.Blocks.MyProgrammableBlock.Run(String argument) at Sandbox.Game.Entities.Blocks.MyProgrammableBlock.OnRunDefaultApplied(MyProgrammableBlock programmableBlock) at Sandbox.Game.Gui.MyTerminalAction1.<set_Action>b__a(TBlock block, ListReader1 parameters) at Sandbox.Game.Gui.MyTerminalAction1.Apply(MyTerminalBlock block, ListReader1 parameters) at Sandbox.Game.Screens.Helpers.MyToolbarItemTerminalBlock.Activate() at Sandbox.Game.Screens.Helpers.MyToolbar.ActivateItemAtIndex(Int32 index, Boolean checkIfWantsToBeActivated) at SpaceEngineers.Game.Entities.Blocks.MyTimerBlock.UpdateOnceBeforeFrame() at Sandbox.Game.Entities.MyEntities.UpdateOnceBeforeFrame() at Sandbox.Game.Entities.MyEntities.UpdateBeforeSimulation() at Sandbox.Game.World.MySector.UpdateBeforeSimulation() at Sandbox.Game.World.MySession.UpdateComponents() at Sandbox.Game.World.MySession.Update(MyTimeSpan updateTime) at Sandbox.MySandboxGame.Update() at Sandbox.Engine.Platform.Game.UpdateInternal() at Sandbox.Engine.Platform.Game.RunSingleFrame() at Sandbox.Engine.Platform.FixedLoop.<>cDisplayClass1.b0() at Sandbox.Engine.Platform.GenericLoop.Run(VoidAction tickCallback) at Sandbox.Engine.Platform.Game.RunLoop() at Sandbox.MySandboxGame.Run(Boolean customRenderLoop, Action disposeSplashScreen) at VRage.Dedicated.DedicatedServer.RunInternal() at Torch.Server.TorchServer.Start() in C:\Program Files (x86)\Jenkins\workspace\Torch_Torch_staging-ZNS7FN4RGURQGN7YDLUHQ3UMYIBPHQSIJWKCAY6N7MCURWHGXRKA\Torch.Server\TorchServer.cs:line 152 at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) at System.Threading.ThreadHelper.ThreadStart()`

Steps to Reproduce

  1. Make an empty world.
  2. Load it up with Torch using the -nogui parameter.
  3. Put down a reactor and a programmable block.
  4. Compile (the default, empty) program.
  5. Run the program.

Other Information

SpaceEngineers-Dedicated.log.txt

Torch-2017-09-06.log.txt

Jimmacle commented 7 years ago

Possibly related to #102

Equinox- commented 7 years ago

@blaho Grab the patch from Jenkins and let me know if it fixed your issue.

jimmble commented 7 years ago

I can confirm that the bug was fixed.

Tested on Torch version 1.1.229.265-70-gcfda1f8 SE version 1.183.300

Thank you.