CheeseLord / warts

WAcky Real Time Strategy
MIT License
1 stars 0 forks source link

If a client joins and leaves on the same tick, its units don't get cleaned up #80

Closed kronmillerg closed 7 years ago

kronmillerg commented 7 years ago

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.