Facepunch / sbox-issues

181 stars 12 forks source link

TypeLibrary issues after leaving then re-joining a dedicated server. #7496

Open SpiltBeanz opened 5 days ago

SpiltBeanz commented 5 days ago

Describe the bug

Joining another lobby while currently in one (e.g. p2p to dedicated) causes these errors and a bunch of NRE spam. I was only able to reproduce in game and not in the editor.

To Reproduce

Method 1:

  1. Launch Fortwars
  2. Start a server/lobby (p2p)
  3. Press escape and click "Servers" button in pause menu.
  4. Directly join the dedicated server.
  5. Observe clone errors.

Method 2:

  1. Join Fortwars dedicated server.
  2. Press Escape and return to games main menu.
  3. Join the dedicated from the main menu lobby/server browser.
  4. Observe clone errors.

This bug is also reproducible in TTT game.

Expected behavior

There are no errors when launching the lobby/server initially so there should also be no errors when leaving and rejoining the same server.

Media/Files

Image

Image

Image

Additional context

No response

lolleko commented 5 days ago

Caused by TypeLibrary.GetType returning null.

Could be related to https://github.com/Facepunch/sbox-issues/issues/7424 or maybe we are not correctly removing/adding assemblies when leaving/joining a dedicated server.