OsQu/sinkohippa — pull request #4 by waltsu (2014-03-29 20:56:57+00:00)
Title: Support for multiple ongoing games

Major refactoring for backend which adds support for multiple games.

# Creating/joining game
The game creation and joining to existing game happens over REST api. After the user opens the page, the flow is following:
* Player connects to `SocketProxy` which proxies the socket to selected game later
* Player creates new game by POSTing to `/game`. The response contains newly created game id.
* Player can join to existing game by PUTting to `/game` url, The request body should contain `game_id` and player's `player_id` (socket-connection id)
* Player can also list all existing game ids by GETting the `/game`

# Changes
* The `SocketProxy` will listen all connections, previously it was `ActorManager`'s `SocketActor`.
* `ActorManager` has been renamed to `GameManager`. Before `ActorManager` was singleton, which contained state of the only game. Now the `SocketProxy` can create new games by creating new `GameManager`s.
* After the player joins to existing game, `SocketProxy` will pass the correct socket-object to `GameManager`. It will create `PlayerActor` from the player and tells its `SocketActor` to create new connection with it. After that all data from the player will go directly to the correct GM's `SocketActor`.