willowtreeapps / wombats-api

Wombats API
https://github.com/willowtreeapps/wombats-documentation
MIT License
10 stars 4 forks source link

Feature/#194 leave game socket support #226

Closed oconn closed 7 years ago

oconn commented 7 years ago

Feature

We require a way to cleanup the socket state of game rooms. I a connected user joins game A and then leaves game A to join game B, the game engine will continue to broadcast messages from game A to the client.

Implementation

The client now sends a leave game message, so we tap into that to remove the requesting channel from the game-room. We also added a cleaning task to the scheduler that will remove connections that may not have had the chance to send that message.