Facepunch / sbox-issues

175 stars 12 forks source link

Crash while restarting gamemode with EntityInspector open #2802

Closed trundlr closed 1 year ago

trundlr commented 1 year ago

Describe the bug

Rarely do I crash nowadays, unless I have the inspector open on an entity and restart my gamemode. I am not sure if changing the entity I'm looking at is the cause of the crash, or something else (it's not entirely consistent in reproducing atm), but I do have a log file from the crash that always pops up.

...
2023/01/20 16:29:47.8248    engine/ResourceSystem   Reloaded 2 resident symlinked resources in 2ms  
2023/01/20 16:29:48.5264    engine/Engine   CNavGenParams - Nav mesh requests project default generation parameters but actual parameters
  used during construction differ from defaults. Please re-export the map.  
2023/01/20 16:29:48.5264    Server  Fortwars: Creating default gamemode - CTF   
2023/01/20 16:29:48.5627    Server  "Trundler" has joined the game  
2023/01/20 16:29:48.6443    engine/SteamAudio   Reverb: Unable to load baked data file (maps/fw_easter.sareverb).   
2023/01/20 16:29:50.1209    tools   Couldn't create Editor.Inspectors.EntityInspector   System.MissingMethodException: Constructor on type 'Editor.Inspectors.EntityInspector' not found.
   at System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture)
   at System.Activator.CreateInstance(Type type, Object[] args)
   at Sandbox.Internal.TypeLibrary.Create[T](Type type, Object[] args)
   at Editor.CanEditAttribute.CreateWidget(Type t, IEnumerable`1 attributes, Type[] generics, Object obj)
2023/01/20 16:29:50.1209    tools   Couldn't create Editor.Inspectors.EntityInspector   System.MissingMethodException: Constructor on type 'Editor.Inspectors.EntityInspector' not found.
   at System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture)
   at System.Activator.CreateInstance(Type type, Object[] args)
   at Sandbox.Internal.TypeLibrary.Create[T](Type type, Object[] args)
   at Editor.CanEditAttribute.CreateWidget(Type t, IEnumerable`1 attributes, Type[] generics, Object obj)
2023/01/20 16:30:17.1877    engine/Console  Loading map "apetavern.fw_easter"   
2023/01/20 16:30:17.2267    engine/Client   CL:  Disconnecting from server: NETWORK_DISCONNECT_LOOPDEACTIVATE   
2023/01/20 16:30:17.8468    engine/Server   SV:  Server shutting down: NETWORK_DISCONNECT_LOOPDEACTIVATE (55)   
2023/01/20 16:30:17.8468    engine/Server   SV:  Disconnect client 'Trundler' from server(1): NETWORK_DISCONNECT_SHUTDOWN   
2023/01/20 16:30:17.8468    engine/WorldRenderer    Failed to unmount world vpk file fw_easter.vpk, file could not be found.    
2023/01/20 16:30:17.8646    Generic Attempted to use an expired SynchronizationContext in task method Fortwars.CaptureTheFlag.WaitForPlayers
This is probably because a task was left running after ending a game session    
2023/01/20 16:30:18.4726    engine/NetSteamConn Steam Net connection #2482330169 pipe closed by peer, reason 2055: NETWORK_DISCONNECT_LOOPDEACTIVATE    
2023/01/20 16:30:18.5299    engine/Server   SV:  maxplayers set to 1    
2023/01/20 16:30:19.6954    Server  Adding network files from [Addon:apetavern.fortwars]    
2023/01/20 16:30:19.6954    Server  Adding Code Path: C:\Users\Aiden\Documents\S&box Projects\sbox-fortwars\code    
2023/01/20 16:30:19.6954    Server  Adding Content Path: C:\Users\Aiden\Documents\S&box Projects\sbox-fortwars
EOF

To Reproduce

  1. Open a gamemode and start writing a class that inherits from Entity.
  2. Start your gamemode and click on the entity so it appears in your inspector in the editor
  3. Change some details about the Entity - in my case, I added [Category( "Fortwars" )] to my Entity
  4. Restart your gamemode.

Unfortunately, this is not a reliable method to reproduce the crash.

Expected behavior

No crash during restart.

Media/Files

No response

Additional context

No response

trundlr commented 1 year ago

This appears to have been fixed in the Entity Prefab update, whether intentional or not. Thanks! Feel free to re-open if I'm wrong.

trundlr commented 1 year ago

Re-opening as this bug has started appearing again, and others are reporting it has affected them too!