/** * OnError event * @param ConnectionInterface $conn * @param \Exception $e */ public function onError(ConnectionInterface $conn, \Exception $e) { echo "An error has occurred: {$e->getMessage()}\n"; $this->manager->getRouter()->error($conn, $e->getMessage()); }
/** * Ends selected user turn * @param ConnectionInterface $conn * @param $data * @throws GameException When trying end not active player turn */ public function endTurnRequest(ConnectionInterface $conn, $data) { $this->manager->log('User ended his turn'); $this->manager->getFight($data->fight)->endTurn((int) $data->player); }