예제 #1
0
 function config($configFile = '')
 {
     $service = new \DedicatedManager\Services\ConfigFileService();
     if ($configFile) {
         list($options, $account, $system, $authLevel) = $service->get($configFile);
         $this->session->set('configFile', $configFile);
         $this->session->set('options', $options);
         $this->session->set('account', $account);
         $this->session->set('system', $system);
         $this->session->set('authLevel', $authLevel);
     } else {
         $options = new \DedicatedManager\Services\ServerOptions();
         $account = new \DedicatedManager\Services\Account();
         $system = new \DedicatedManager\Services\SystemConfig();
         $authLevel = new \DedicatedManager\Services\AuthorizationLevels();
     }
     $titleService = new \DedicatedManager\Services\TitleService();
     $this->response->titles = $titleService->getList();
     $this->response->configFile = $configFile;
     $this->response->configList = $service->getList();
     $this->response->authLevel = $this->session->get('authLevel', $authLevel);
     $this->response->options = $this->session->get('options', $options);
     $this->response->account = $this->session->get('account', $account);
     $this->response->system = $this->session->get('system', $system);
 }
예제 #2
0
 function index()
 {
     $service = new \DedicatedManager\Services\ConfigFileService();
     $this->response->configFiles = $service->getList();
     $service = new \DedicatedManager\Services\MatchSettingsFileService();
     $this->response->matchFiles = $service->getList();
     if (\DedicatedManager\Config::getInstance()->manialivePath) {
         $service = new \DedicatedManager\Services\ManialiveFileService();
         $this->response->manialiveFiles = $service->getList();
     }
 }
예제 #3
0
 /**
  * @redirect
  */
 function saveGuestlist($filename)
 {
     $service = new \DedicatedManager\Services\ConfigFileService();
     $configList = $service->getList();
     if (in_array($filename, $configList)) {
         $this->session->set('error', _('You cannot use this filename'));
         $this->request->redirectArgList('../guestlist', 'host', 'port');
     }
     try {
         $this->server->connection->saveGuestList($filename . '.txt');
         $this->session->set('success', _('Guestlist successfully saved'));
     } catch (\Exception $e) {
         \ManiaLib\Application\ErrorHandling::logException($e);
         $this->session->set('error', _('An error occurred while saving the guestlist'));
     }
     $this->request->redirectArgList('../guestlist/', 'host', 'port');
 }
 function quickStart($configFile = '', $matchFile = '', $isLan = false, $serverName = null, $login = null, $password = null, $title = null, $startManialive = false, $manialiveConfig = '')
 {
     $service = new \DedicatedManager\Services\ConfigFileService();
     $configFileList = $service->getList();
     if ($configFile) {
         list($config, $account, $system, ) = $service->get($configFile);
     } else {
         $config = new \DedicatedManager\Services\ServerOptions();
         $account = new \DedicatedManager\Services\Account();
         $system = new \DedicatedManager\Services\SystemConfig();
     }
     $service = new \DedicatedManager\Services\MatchSettingsFileService();
     $matchSettingsFileList = $service->getList();
     $service = new \DedicatedManager\Services\TitleService();
     $titles = $service->getList();
     $service = new \DedicatedManager\Services\ManialiveFileService();
     $manialiveFileList = $service->getList();
     $this->response->configFileList = $configFileList;
     $this->response->matchSettingsFileList = $matchSettingsFileList;
     $this->response->titles = $titles;
     $this->response->configFile = $configFile;
     $this->response->matchFile = $matchFile ?: $configFile;
     $this->response->isLan = $isLan || $account->login && $account->password ? true : false;
     $this->response->serverName = $config->name && !$serverName ? $config->name : $serverName;
     $this->response->serverLogin = $account->login && !$login ? $account->login : $login;
     $this->response->serverPassword = $account->password && !$password ? $account->password : $password;
     $this->response->title = $system->title && !$title ? $system->title : $title;
     $this->response->startManialive = $startManialive;
     $this->response->manialiveFileList = $manialiveFileList;
     $this->response->manialiveConfig = $manialiveConfig ?: $configFile;
 }