/** * Loads the planet data */ protected function loadPlanetData() { global $resource; $fileName = $this->getReport(); if ($fileName == '') { return; } $xmlObj = new XML($fileName); // fleet for ($i = 200; $i < 500; ++$i) { if (!isset($resource[$i])) { continue; } $array = $xmlObj->xpath('//*[@id="' . $i . '"]'); if (!isset($array[0][0])) { continue; } $this->defenderFleets[1]['fleet'][$i] = intval(str_replace(WCF::getLanguage()->get('wcf.global.thousandsSeparator'), '', $array[0][0])); } // tech for ($i = 109; $i <= 111; ++$i) { if (!isset($resource[$i])) { continue; } $array = $xmlObj->xpath('//*[@id="' . $i . '"]'); if (!isset($array[0][0])) { continue; } $this->defenderFleets[1]['tech'][$i] = intval(str_replace(WCF::getLanguage()->get('wcf.global.thousandsSeparator'), '', $array[0][0])); } // own techs $this->attackerFleets[1]['tech'][109] = LWCore::getUser()->military_tech; $this->attackerFleets[1]['tech'][110] = LWCore::getUser()->defence_tech; $this->attackerFleets[1]['tech'][111] = LWCore::getUser()->shield_tech; }
/** * View system */ public function view() { global $lang, $user; includeLang('galaxy'); for ($i = 0; $i < 15; $i++) { $position = $i + 1; $lang['echo_galaxy'] .= $this->viewPositionRow($position); } $lang['dpath'] = !$user["dpath"] ? DEFAULT_SKINPATH : $user["dpath"]; $lang['galaxy'] = $this->galaxy; $lang['system'] = $this->system; $lang['tg'] = LWCore::getPlanet()->galaxy; $lang['ts'] = LWCore::getPlanet()->system; $lang['tp'] = LWCore::getPlanet()->planet; $lang['tpt'] = LWCore::getPlanet()->planet_type; $lang['planet_count'] = $this->planetCount(); $lang['iraks'] = LWCore::getPlanet()->interplanetary_misil; $lang['max_slots'] = LWCore::getUser()->computer_tech + 1; $lang['recycler'] = LWCore::getPlanet()->recycler; $lang['probes'] = LWCore::getPlanet()->spy_sonde; $lang['spio_anz'] = $user['spio_anz']; $lang['phalanx_costs'] = floor($this->getPhalanxCosts()); $fleets = Fleet::getByUserID(WCF::getUser()->userID); $lang['slots'] = count($fleets); $lang['Solar_system_at'] = str_replace('%g', $this->galaxy, $lang['Solar_system_at']); $lang['Solar_system_at'] = str_replace('%s', $this->system, $lang['Solar_system_at']); display(parsetemplate(gettemplate('galaxy_body'), $lang), '', false); }