TehGimp/KerbalMultiPlayer — pull request #525 by godarklight (2013-12-24 13:31:48+00:00)
Title: Fix issue #495.

This took me *hours*. There are a few things going on here:

1. This bug happens before updateStep. It took me a while to figure that out.
2. The game is started from the drawGUI method. This also took me a while to figure out.
3. Setting forceQuit to true will set gameRunning to false.
4. This happens: https://github.com/TehGimp/KerbalMultiPlayer/blob/master/KMPManager.cs#L3956

Other bugs discovered:
The connection thread aborts itself which is *bad* because the sockets never get cleaned up. I made the thread exit cleanly (I think) but changing the while loop and using an "exit" variable.

The easiest way to fix this was to block connections (well game starts) until the connection thread *cleanly* exits.

EDIT: I had a merge conflict and brang forceQuit back into the GUI method where it was (I assume you did this because it didn't work? - Connection blocking should fix it)