midspace / Space-Engineers-Admin-script-mod

Modding script for Space Engineers with dozens of Admin commands for creating game scenarios or supporting servers.
43 stars 13 forks source link

Exception when creating Permissions file. #135

Open midspace opened 8 years ago

midspace commented 8 years ago

This is exception shows when starting up and creating the permissions file. Not reading. I can't reproduce this, not without perhaps more details from the rest of the log, like Localization.

Wolverine:
2015-12-06 15:32:30.244 - Thread:   1 ->  Exception occured: System.InvalidOperationException: There was an error generating the XML document. ---> System.NullReferenceException: Object reference not set to an instance of an object.
   at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationWriterPermissions.XSArrayInfo.get_Item(Object a, Int32 i)
   at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationWriterPermissions.Write6_Permissions(String n, String ns, Object o, Boolean needType)
   at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationWriterPermissions.Write7_Permissions(Object o)
   --- End of inner exception stack trace ---
   at System.Xml.Serialization.XmlSerializer.Serialize(XmlWriter xmlWriter, Object o, XmlSerializerNamespaces namespaces, String encodingStyle, String id)
   at System.Xml.Serialization.XmlSerializer.Serialize(TextWriter textWriter, Object o, XmlSerializerNamespaces namespaces)
   at Sandbox.ModAPI.MyAPIUtilities.Sandbox.ModAPI.IMyUtilities.SerializeToXML[T](T objToSerialize)
   at midspace.adminscripts.ServerConfig.SavePermissionFile(String customSaveName)
   at midspace.adminscripts.ServerConfig.LoadOrCreatePermissionFile()
   at midspace.adminscripts.ServerConfig..ctor(List`1 commands)
   at midspace.adminscripts.ChatCommandLogic.InitServer()
   at midspace.adminscripts.ChatCommandLogic.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.FixedLoop.<>c__DisplayClass2.<Run>b__1()
   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.RunInternal(String[] args)
   at SpaceEngineers.MyProgram.Main(String[] args)
2015-12-06 15:32:30.244 - Thread:   1 ->  InnerException:
2015-12-06 15:32:30.244 - Thread:   1 ->  Exception occured: System.NullReferenceException: Object reference not set to an instance of an object.
   at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationWriterPermissions.XSArrayInfo.get_Item(Object a, Int32 i)
   at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationWriterPermissions.Write6_Permissions(String n, String ns, Object o, Boolean needType)
   at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationWriterPermissions.Write7_Permissions(Object o)
2015-12-06 15:32:30.247 - Thread:   1 ->  Hiding window
2015-12-06 15:32:30.248 - Thread:   1 ->  Network readers disposed
2015-12-06 15:32:31.031 - Thread:   1 ->  Hiding window done
2015-12-06 15:32:31.031 - Thread:   1 ->  Showing message
Spcemarine commented 8 years ago

With the new information I guess Permissions was null and that leaves the question why the hell the client would init a server...

midspace commented 8 years ago

The client shouldn't be getting past the MyAPIGateway.Multiplayer.IsServer unless it was still set from a previous session.

The full log would have made it clear what the session was, and a previous session.