Black Commit
I think I repaired a timeout that waits for LoadOAC to be much less race-conditiony. I also think as a result I need to get rid of the awesome while(i.MoveNext() && now<end) timer. As sexy as it was, it doesn't do anything and it's hard to write ;)
Brilliant. The connection is really solid right now. If it connects the first time, I can cancel the game at any point, including while connecting or while executing the plan, and  the opencog backend will be able to cope and open up a new port for listening immediately. There is one problem we need to solve, and that is that if the embodiment has JUST been started when the game world starts (too early) then the connection will be successful and the OAC WILL initialize, but it will be immediately error and get marked as unavailable. For some reason the system NEVER catches this (the unit tests don't fail). This tells me that in embodiment, a function is being called which enters an infinite loop.
I found out a lot of information about our asynchronous socket, which, in using a blocking call (unnecessary) causes the hang. Right now I don't have the time to fix it, so I'm going to implement some workarounds.
In between me deciding how to Exit the application with an error code (which I wrote for this) and the things I was doing previously (the asynchronous socket) I must have broekn something... because now all connection attempts automatically fail XD
Game connects fine again. Looks like the entire library just wasn't rebuilding (so new code couldn't be tried out). Now I'm debugging an error where I cannot compare things outside of the main thread. I just realized it might be in an Instance accessor that everything's going so wrong. So I dragged a GameManager onto the scene and I'm trying to debug everything to work with _instance instead.
BAM. Got it to work. Now the game should be able to throw a multiplicity of errors, catch almost all hangs through one technique or another, and connect with little to no difficulty whatsoever. (There is still one hang that UnitTest manages to catch which takes like a full minute to happen). The only thing left is to detect that the plan starts and that the plan finishes.