protected function run(Session $ses, array $args) { $game = $ses->getGame(); if ($game instanceof Game) { return $game->onStats($ses, $args); } else { return TextFormat::RED . "You aren't in a game."; } }
protected function onRun(Session $ses, array $args) { if (($game = $ses->getGame()) instanceof Game) { $ch = $game->getDefaultChatChannel(); } else { $ch = $this->main->getDefaultChannel(); } if (!$ch->isSubscribing($ses)) { return TextFormat::RED . "It seems like you were kicked from your current game's or hub's chat channel."; } $ses->setWriteToChannel($ch); return TextFormat::GREEN . "You are now talking on #{$ch}."; }
protected function checkPerm(Session $ses) { return $ses->getGame() instanceof Game; }