public function __construct(RealTimeClient $client, GameManager $gameManager, Message $message, array $args = null)
{
parent::__construct($client, $gameManager, $message, $args);
if ($this->channel[0] == 'D') {
throw new Exception("Can't join a game lobby by direct message.");
}
if (!$this->game) {
throw new Exception("No game in progress.");
}
if ($this->game->getState() != GameState::LOBBY) {
throw new Exception("Game in progress is not in lobby state.");
}
}