public function renderDefault() { $params = $this->serverRepo->getRunParams($this->selectedServerId); $this->template->address = $this->hostIp . ":" . $params['port']; try { $logModel = new LogModel($params['path'] . 'logs/'); $this->template->logs = LogModel::makeColorful($logModel->getAll()); } catch (UnexpectedValueException $e) { $this->template->logs = array('nic nenalezeno'); } }
public function handleStartServer() { //check if running if ($this->runtimeHash != NULL) { $this->flashMessage('Server is already running! Or it looks to be like that. :/', 'error'); } else { //generte runtime hash $this->runtimeHash = $this->serverRepo->generateRuntimeHash(); $this->serverRepo->setRuntimeHash($this->selectedServerId, $this->runtimeHash); //set correct values from settings $params = $this->serverRepo->getRunParams($this->selectedServerId); $out = $this->serverCmd->startServer($params->path, $params->executable, $this->runtimeHash); if ($out === array()) { $this->flashMessage('Server naběhl. Adresa pro připojení: ' . $this->hostIp . ':' . $params->port, 'success'); } else { $this->flashMessage(implode(" \n", $out), 'error'); } } $this->redirect('this'); }
/** * @return FileEditor Component */ protected function createComponentServerProps() { return new FileEditor($this->serverRepo->getPath($this->selectedServerId) . 'server.properties', $this->fileModel, $this->user->isAllowed('server-settings', 'edit'), array('/server-port=[0-9]*/' => 'server-port=' . $this->serverRepo->getRunParams($this->selectedServerId)['port'])); }
public function renderSummary() { $this->template->params = $this->serverRepo->getRunParams($this->selectedServerId); $this->template->hostIp = $this->hostIp; $this->flashMessage("Server byl úspěšně vytvořen. Níže jsou nějaké detaily, které se mohou hodit.", 'success'); }