/** * @return array */ public function getConnectionNames() { $this->loadConnections(); if ($this->connections instanceof \Pimple) { return $this->connections->keys(); } else { return array_keys($this->connections); } }
private function handlePlayerDisconnection(Connection $connection) { $player = $connection->getPlayer(); $seat = $player->getSeat(); $playerConnection = $this->getPlayerConnection($player); $this->connections = $this->connections->filter(function ($c) use($playerConnection) { return $c !== $playerConnection; }); $this->removePlayerFromSeat($seat, $assignBot = true); if (!$seat->getTable()->onlySeatedByBots() || count($this->tableManager->getTables()) === 1) { // Skip destroying table if this table is the last one standing // Or there's at least one computer bot connected via TCP return; } $this->destroyTable($seat->getTable()); }
/** * @return Connection[]|ArrayCollection */ public function getConnections() { return new ArrayCollection(array_merge($this->fluentSpeakerConnections->toArray(), $this->learnerConnections->toArray())); }