To reproduce this, add an assert False at the top of Graphics.addEntity, then try to join a few clients to the server. Each one will crash immediately, of course, but some of their units won't get cleaned up.
The problem is that when a client disconnects, the server calls GameStateManager.removePlayer to clean up after them. That function issues a DelUnitOrder for each of their units that already exists, but not for those units whose NewUnitOrders have yet to be resolved.
To reproduce this, add an
assert False
at the top of Graphics.addEntity, then try to join a few clients to the server. Each one will crash immediately, of course, but some of their units won't get cleaned up.The problem is that when a client disconnects, the server calls GameStateManager.removePlayer to clean up after them. That function issues a DelUnitOrder for each of their units that already exists, but not for those units whose NewUnitOrders have yet to be resolved.