ScalarVector1 / DragonLens

Modern, customizable, and community-driven debugging and cheat mod for TModLoader
24 stars 14 forks source link

Fix game exit issues #47

Closed Jadams505 closed 1 year ago

Jadams505 commented 1 year ago

Issue: In multiplayer the server would crash when exiting tModLoader. Solution: Added null checks in RecievePacket and changed to Main.netMode != NetmodeID.SinglePlayer in ToolHandler.OnModLoader

Issue: tModLoader would fail to exit properly if the threads used to preloadAssets did not finish. The itemThread was particularly problematic taking upwards of 90 seconds to complete and forcing a process termination before tModLoader could be started again. Solution: Made them background threads to prevent orphan threads