StarCoreSE / SCModRepository

Starcore's Mod Repo
https://www.starcore.tv/
GNU General Public License v3.0
2 stars 17 forks source link

ensure all of our mods that subscribe to events also unsubscribe if needed #1350

Open StarCoreIssueBot opened 3 months ago

StarCoreIssueBot commented 3 months ago

damage events network event subscribing to block add honestly a mass search for += -= would probably do it

Submitted by:

InvalidArgument3 commented 2 months ago
4-07-25 12:30:40.532 - Thread:   1 ->  ERROR: Loading screen failed
2024-07-25 12:30:40.532 - Thread:   1 ->  Exception occurred: System.IO.IOException: The process cannot access the file 'C:\Users\Liam\AppData\Roaming\SpaceEngineers\Storage\3237212491.sbm_SwapperScripts\log.txt' because it is being used by another process.
   at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
   at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
   at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share)
   at VRage.FileSystem.MyFileSystem.OpenWrite(String path, FileMode mode)
   at Sandbox.ModAPI.MyAPIUtilities.VRage.Game.ModAPI.IMyUtilities.WriteFileInLocalStorage(String file, Type callingType)
   at Munashe.BlockSwapper.BlockSwapper_Session.LoadData()
   at Sandbox.Game.World.MySession.LoadComponent(MySessionComponentBase component)
   at Sandbox.Game.World.MySession.LoadDataComponents()
   at Sandbox.Game.World.MySession.PrepareBaseSession(MyObjectBuilder_Checkpoint checkpoint, MyObjectBuilder_Sector sector)
   at Sandbox.Game.World.MySession.LoadMultiplayer(MyObjectBuilder_World world, MyMultiplayerBase multiplayerSession)
   at System.DelegateExtensions.InvokeIfNotNull(Action handler)
   at Sandbox.Game.Gui.MyGuiScreenLoading.RunLoad()

i/o error from blockswapper, doubt it's related but indicative of something not being unsubscribbed

InvalidArgument3 commented 2 months ago

one error happened when a server auto restarted while connecting that might be a trigger

InvalidArgument3 commented 1 month ago

another one when unable to load on a server

2024-08-21 17:41:27.789 - Thread:   1 ->  Exception in Handler: System.ArgumentException: An item with the same key has already been added.
   at System.ThrowHelper.ThrowArgumentException(ExceptionResource resource)
   at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add)
   at CoreSystems.Session.AssembleArmorDefinitions(ArmorDefinition[] armorDefs)
   at CoreSystems.Session.PickDef(ContainerDefinition baseDefArray)
   at CoreSystems.Session.Handler(Object o)
2024-08-21 17:41:28.050 - Thread:   1 ->  Error: Error during loading session:System.IO.IOException: The process cannot access the file 'C:\Users\User\AppData\Roaming\SpaceEngineers\Storage\3237212491.sbm_SwapperScripts\log.txt' because it is being used by another process.
   at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
   at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
   at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share)
   at VRage.FileSystem.MyFileSystem.OpenWrite(String path, FileMode mode)
   at Sandbox.ModAPI.MyAPIUtilities.VRage.Game.ModAPI.IMyUtilities.WriteFileInLocalStorage(String file, Type callingType)
   at Munashe.BlockSwapper.BlockSwapper_Session.LoadData()
   at Sandbox.Game.World.MySession.LoadComponent_Patch2(MySession this, MySessionComponentBase component)
   at Sandbox.Game.World.MySession.LoadDataComponents()
   at Sandbox.Game.World.MySession.PrepareBaseSession(MyObjectBuilder_Checkpoint checkpoint, MyObjectBuilder_Sector sector)
   at Sandbox.Game.World.MySession.Load_Patch1(String sessionPath, MyObjectBuilder_Checkpoint checkpoint, UInt64 checkpointSizeInBytes, Boolean saveLastStates, Boolean allowXml)
2024-08-21 17:41:28.050 - Thread:   1 ->  ERROR: Loading screen failed
2024-08-21 17:41:28.050 - Thread:   1 ->  Exception occurred: System.IO.IOException: The process cannot access the file 'C:\Users\User\AppData\Roaming\SpaceEngineers\Storage\3237212491.sbm_SwapperScripts\log.txt' because it is being used by another process.
   at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
   at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
   at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share)
   at VRage.FileSystem.MyFileSystem.OpenWrite(String path, FileMode mode)
   at Sandbox.ModAPI.MyAPIUtilities.VRage.Game.ModAPI.IMyUtilities.WriteFileInLocalStorage(String file, Type callingType)
   at Munashe.BlockSwapper.BlockSwapper_Session.LoadData()
   at Sandbox.Game.World.MySession.LoadComponent_Patch2(MySession this, MySessionComponentBase component)
   at Sandbox.Game.World.MySession.LoadDataComponents()
   at Sandbox.Game.World.MySession.PrepareBaseSession(MyObjectBuilder_Checkpoint checkpoint, MyObjectBuilder_Sector sector)
   at Sandbox.Game.World.MySession.Load_Patch1(String sessionPath, MyObjectBuilder_Checkpoint checkpoint, UInt64 checkpointSizeInBytes, Boolean saveLastStates, Boolean allowXml)
   at Sandbox.Game.World.MySessionLoader.<>c__DisplayClass18_0.<LoadSingleplayerSessionInternal>b__7()
   at System.DelegateExtensions.InvokeIfNotNull(Action handler)
   at Sandbox.Game.Gui.MyGuiScreenLoading.RunLoad()
InvalidArgument3 commented 1 week ago

a "fun" way to reproduce this (causing an error in loading) is to load the world, paste a planet, save it. delete the .vx2 entry from the save file. when loading back into it kicks you back out in the first 10% causing certain mods to get stuck, requiring a client reload to load back into any other world