private function removePlayerFromSeat(TableSeat $seat, $assignBot = true) { if ($seat->isFree()) { throw new \LogicException('Unable to remove player from empty seat.'); } $this->logger->info('Removing player from seat', ['player' => $seat->getPlayer()->getName(), 'table_id' => $seat->getTable()->getId()]); $player = $seat->getPlayer(); $table = $seat->getTable(); $seat->setPlayer(null); $seat->setInPlay(false); $seat->resetHand(); $player->setSeat(null); $this->broadcastMessageIgnoringPlayer($table, $player, new SocketPlayerLeftTableMessage($seat->getSeatIndex())); if ($table instanceof WebSocketObservableTable) { $table->broadcast(new WebSocketPlayerLeftTableMessage($seat->getSeatIndex())); } if ($assignBot) { $bot = $this->playerFactory->newServerPlayer('Bot' . $seat->getSeatIndex(), $seat, 5000); $this->assignPlayerToSeat($seat, $bot); } }