maniaControl = $maniaControl; $this->startTime = time(); if (!$rpc_infos) return; $this->name = $rpc_infos['Name']; $this->uid = $rpc_infos['UId']; $this->fileName = $rpc_infos['FileName']; $this->authorLogin = $rpc_infos['Author']; $this->environment = $rpc_infos['Environnement']; $this->goldTime = $rpc_infos['GoldTime']; $this->copperPrice = $rpc_infos['CopperPrice']; $this->mapType = $rpc_infos['MapType']; $this->mapStyle = $rpc_infos['MapStyle']; if (isset($rpc_infos['NbCheckpoints'])) { $this->nbCheckpoints = $rpc_infos['NbCheckpoints']; } $this->authorNick = $this->authorLogin; $mapsDirectory = $this->maniaControl->server->getMapsDirectory(); if ($this->maniaControl->server->checkAccess($mapsDirectory)) { $this->mapFetcher = new \GBXChallMapFetcher(true); try { $this->mapFetcher->processFile($mapsDirectory . $this->fileName); } catch (\Exception $e) { trigger_error($e->getMessage(), E_USER_WARNING); } $this->authorNick = FORMATTER::stripDirtyCodes($this->mapFetcher->authorNick); $this->authorEInfo = $this->mapFetcher->authorEInfo; $this->authorZone = $this->mapFetcher->authorZone; $this->comment = $this->mapFetcher->comment; } // TODO: define timeout if mx is down,todo fetch all map infos at once (maybe way faster) $serverInfo = $this->maniaControl->server->getSystemInfo(); $title = strtoupper(substr($serverInfo['TitleId'], 0, 2)); $this->mx = new \MXInfoFetcher($title, $this->uid, false); } }