DoSomething/ds-mdata-responder — pull request #349 by tongxiang (2014-12-01 20:55:59+00:00)
Title: beta joining game in progress opts them into solo play

#### What's this PR do?
Currently, if a beta joins a game in progress, she's notified that the game has already started and tells her about the solo-play keyword (code described in `logicBetaJoin.js`.)

Now, if a beta joins a game in progress, 1) she's sent the same message that the game has already started (which we need to change to tell her that we're automatically opting her into a solo game), 2) a solo game's created for her, and 3) she receives the initial message of solo gameplay.

How did we do this?
1. Previously, we created a new controller `SGSoloController` for alpha-solo gameplay. Now, we've extracted the actual solo game creation logic (which involves two POSTs to the /sms-multiplayer-game/create and /sms-multiplayer-game/alpha-start app endpoints) into its own function--`createSoloGame`--attached to the the controller. (`.processRequest()`, also attached to the controller as per convention, calls this function.)

2. This function is thus imported into `logicBetaJoin.js`, and called if the game has already started.

#### Where should the reviewer start?
Check out the changes first to `SGSoloController`, and then those to `logicBetaJoin.js`.

#### How should this be manually tested?
I used `npm test` to ensure that normal beta joining still works. Then, I used Postman to create and start a game before a user could join, and then had that user respond to the join message.

#### What are the relevant tickets?
Begins to close #243.

#### Questions:
Is the modularization of `.createSoloGame` too messy?

Also, it does bother me that our solo game creation is hitting endpoints which essentially create a multiplayer game with empty betas. Is there a better way to modularize solo play?