diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..b74decb --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/config.php diff --git a/.htaccess b/.htaccess new file mode 100644 index 0000000..5eb217c --- /dev/null +++ b/.htaccess @@ -0,0 +1,2 @@ +SetEnv DEBUG On +SetEnv DEPRECATION Off \ No newline at end of file diff --git a/buildings.php b/buildings.php index d9f1a1c..b352d06 100644 --- a/buildings.php +++ b/buildings.php @@ -32,33 +32,32 @@ define('INSIDE' , true); define('INSTALL' , false); require_once dirname(__FILE__) .'/common.php'; - includeLang('buildings'); +includeLang('buildings'); - // Mise a jour de la liste de construction si necessaire - UpdatePlanetBatimentQueueList ( $planetrow, $user ); - $IsWorking = HandleTechnologieBuild ( $planetrow, $user ); +$user = Legacies_Empire_Model_User::getSingleton(); +$planet = $user->getCurrentPlanet(); - switch ($_GET['mode']) { - case 'fleet': - // -------------------------------------------------------------------------------------------------- - FleetBuildingPage ( $planetrow, $user ); - break; +switch ($_GET['mode']) { + case 'fleet': + // -------------------------------------------------------------------------------------------------- + FleetBuildingPage($planet, $user); + break; - case 'research': - // -------------------------------------------------------------------------------------------------- - ResearchBuildingPage ( $planetrow, $user, $IsWorking['OnWork'], $IsWorking['WorkOn'] ); - break; + case 'research': + // -------------------------------------------------------------------------------------------------- + ResearchBuildingPage($planet, $user, $IsWorking['OnWork'], $IsWorking['WorkOn'] ); + break; - case 'defense': - // -------------------------------------------------------------------------------------------------- - DefensesBuildingPage ( $planetrow, $user ); - break; + case 'defense': + // -------------------------------------------------------------------------------------------------- + DefensesBuildingPage($planet, $user); + break; - default: - // -------------------------------------------------------------------------------------------------- - BatimentBuildingPage ( $planetrow, $user ); - break; - } + default: + // -------------------------------------------------------------------------------------------------- + BatimentBuildingPage($planet, $user); + break; +} // ----------------------------------------------------------------------------------------------------------- // History version diff --git a/common.php b/common.php index 39454ad..7e91b9a 100644 --- a/common.php +++ b/common.php @@ -28,8 +28,25 @@ * */ -if (!defined('DEBUG') && in_array(strtolower(getenv('DEBUG')), array('1', 'on', 'true'))) { +define('DEPRECATION', true); +define('DEBUG', true); + +if (!defined('DEBUG') && ($env = getenv('DEBUG')) !== false && in_array(strtolower($env), array('1', 'on', 'true'))) { define('DEBUG', true); +} else if (!defined('DEBUG') && isset($_SERVER['DEBUG']) && in_array(strtolower($_SERVER['DEBUG']), array('1', 'on', 'true'))) { + define('DEBUG', true); +} + +if (!defined('DEPRECATION') && ($env = getenv('DEPRECATION')) !== false && in_array(strtolower($env), array('1', 'on', 'true'))) { + define('DEPRECATION', true); +} else if (!defined('DEPRECATION') && isset($_SERVER['DEPRECATION']) && in_array(strtolower($_SERVER['DEPRECATION']), array('1', 'on', 'true'))) { + define('DEPRECATION', true); +} + +if (!defined('BCNUMBERS') && ($env = getenv('BCNUMBERS')) !== false && in_array(strtolower($env), array('1', 'on', 'true'))) { + define('BCNUMBERS', true); +} else if (!defined('BCNUMBERS') && isset($_SERVER['BCNUMBERS']) && in_array(strtolower($_SERVER['BCNUMBERS']), array('1', 'on', 'true'))) { + define('BCNUMBERS', true); } if (!defined('DEBUG')) { @@ -47,6 +64,7 @@ defined('PHPEXT') || define('PHPEXT', require 'extension.inc'); defined('VERSION') || define('VERSION', '2011.1'); set_include_path(implode(PATH_SEPARATOR, array( + APPLICATION_PATH . DIRECTORY_SEPARATOR . 'code' . DIRECTORY_SEPARATOR . 'libraries', APPLICATION_PATH . DIRECTORY_SEPARATOR . 'code' . DIRECTORY_SEPARATOR . 'local', APPLICATION_PATH . DIRECTORY_SEPARATOR . 'code' . DIRECTORY_SEPARATOR . 'community', APPLICATION_PATH . DIRECTORY_SEPARATOR . 'code' . DIRECTORY_SEPARATOR . 'core', @@ -57,7 +75,8 @@ function __autoload($class) { include_once str_replace('_', '/', $class) . '.php'; } -Legacies_Core_Error::register(); +Legacies_Core_Time::init(); +Legacies_Core_ErrorProfiler::register(); if (0 === filesize(ROOT_PATH . 'config.php')) { header('Location: install/'); @@ -72,7 +91,6 @@ foreach (include ROOT_PATH . 'includes/data/events.php' as $event => $listenerLi $lang = array(); -define('DEFAULT_SKINPATH', 'skins/xnova/'); define('TEMPLATE_DIR', realpath(ROOT_PATH . '/templates/')); define('TEMPLATE_NAME', 'OpenGame'); define('DEFAULT_LANG', 'fr'); @@ -110,30 +128,17 @@ if (!defined('DISABLE_IDENTITY_CHECK')) { includeLang('system'); includeLang('tech'); -include(ROOT_PATH . 'rak.php'); - -$dpath = DEFAULT_SKINPATH; if (($user !== null && $user->getId())) { - $dpath = $user->getSkinPath(); - - if (empty($dpath)) { - $dpath = DEFAULT_SKINPATH; - } - - if (defined('IN_ADMIN')) { - $dpath = '../' . $dpath; - } - if (isset($_GET['cp']) && !empty($_GET['cp'])) { $user->updateCurrentPlanet((int) $_GET['cp']); } + $planet = $user->getCurrentPlanet(); + foreach ($user->getPlanetCollection() as $planet) { FlyingFleetHandler($planet); // TODO: implement logic into a refactored model } - $planet = $user->getCurrentPlanet(); - /* * Update planet resources and constructions */ diff --git a/config.php.default b/config.php.default new file mode 100644 index 0000000..85e7c1c --- /dev/null +++ b/config.php.default @@ -0,0 +1,21 @@ + array( + 'date' => array( + 'timezone' => 'Europe/Paris' + ), + 'database' => array( + 'engine' => 'mysql', + 'options' => array( + 'hostname' => 'localhost', + 'username' => 'root', + 'password' => '', + 'database' => 'db_xnova' + ), + 'table_prefix' => 'game_', + ), + 'layout' => array( + 'page' => 'page.php', + 'empire' => 'empire.php' + ) + ) + ); \ No newline at end of file diff --git a/frames.php b/frames.php index d7c97c3..367459c 100644 --- a/frames.php +++ b/frames.php @@ -1,64 +1,16 @@ - - * All rights reserved. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - * --> NOTICE <-- - * This file is part of the core development branch, changing its contents will - * make you unable to use the automatic updates manager. Please refer to the - * documentation for further information about customizing XNova. - * - */ - -define('INSIDE' , true); -define('INSTALL' , false); - -$XNova_Host = $_SERVER['HTTP_HOST']; -$XNova_Script = $_SERVER['SCRIPT_NAME']; -$Uri_Array = explode ('/', $XNova_Script); -// On vire le script -array_pop($Uri_Array); -$XNova_URI = implode ('/', $Uri_Array); - -$XNovaRootURL = "http://". $XNova_Host ."/". $XNova_URI ."/"; - -require_once dirname(__FILE__) .'/common.php'; - -$page = ""; -$page .= ""; -$page .= ""; -$page .= ""; -$page .= "". $gameConfig['game_name'] .""; -$page .= ""; - -$page .= ""; -$page .= ""; -$page .= ""; -$page .= ""; -$page .= "<body>"; -$page .= "<p>Votre navigateur ne gère pas les frames.</p>"; -$page .= ""; -$page .= ""; - $page .= ""; -$page .= ""; - -echo $page; - + + + + + XNova:Legacies + + + + + + <body> + <p>Votre navigateur ne gère pas les frames.</p> + </body> + + + diff --git a/includes/application/code/community/.placeholder b/includes/application/code/community/.placeholder new file mode 100644 index 0000000..e69de29 diff --git a/includes/application/code/community/Legacies/Core/View.php b/includes/application/code/community/Legacies/Core/View.php deleted file mode 100644 index 659c06c..0000000 --- a/includes/application/code/community/Legacies/Core/View.php +++ /dev/null @@ -1,70 +0,0 @@ -_prepareRender(); - - $path = APPLICATION_PATH . DIRECTORY_SEPARATOR . 'design' . DIRECTORY_SEPARATOR . 'scripts'; - - ob_start(); - include $path . DIRECTORY_SEPARATOR . $file; - $contents = ob_get_contents(); - ob_end_clean(); - - return $contents; - } - - public function render() - { - $template = $this->getTemplate(); - if (empty($template)) { - return null; - } - return $this->renderScript($this->getTemplate()); - } - - public function setTemplate($template) - { - $this->_template = $template; - - return $this; - } - - public function getTemplate() - { - return $this->_template; - } -} \ No newline at end of file diff --git a/includes/application/code/community/Legacies/Empire/Model/Fleet.php b/includes/application/code/community/Legacies/Empire/Model/Fleet.php deleted file mode 100644 index bbd1712..0000000 --- a/includes/application/code/community/Legacies/Empire/Model/Fleet.php +++ /dev/null @@ -1,39 +0,0 @@ -setIdFieldName('fleet_id'); - $this->setTableName('fleets'); - } - - public static function planetListener($eventData) - { - } -} \ No newline at end of file diff --git a/includes/application/code/community/Legacies/Empire/Model/Planet/Production.php b/includes/application/code/community/Legacies/Empire/Model/Planet/Production.php deleted file mode 100644 index 7a24a8c..0000000 --- a/includes/application/code/community/Legacies/Empire/Model/Planet/Production.php +++ /dev/null @@ -1,20 +0,0 @@ -_tableName = 'planet_production'; - $this->_idFieldNames = array( - 'production_code', - 'planet_id' - ); - } -} \ No newline at end of file diff --git a/includes/application/code/community/Legacies/Empire/Model/Planet/Resource.php b/includes/application/code/community/Legacies/Empire/Model/Planet/Resource.php deleted file mode 100644 index 5b1195d..0000000 --- a/includes/application/code/community/Legacies/Empire/Model/Planet/Resource.php +++ /dev/null @@ -1,20 +0,0 @@ -_tableName = 'planet_resource'; - $this->_idFieldNames = array( - 'resource_code', - 'planet_id' - ); - } -} \ No newline at end of file diff --git a/includes/application/code/community/Legacies/Empire/Model/Planet/ShipInterface.php b/includes/application/code/community/Legacies/Empire/Model/Planet/ShipInterface.php deleted file mode 100644 index ab3e0d5..0000000 --- a/includes/application/code/community/Legacies/Empire/Model/Planet/ShipInterface.php +++ /dev/null @@ -1,7 +0,0 @@ -translateArgs($message), $args); + return self::getTranslator($locale)->translateArgs($message, $args); } public static function __($message, $_ = null) diff --git a/includes/application/code/core/Legacies/Core/Block/Concat.php b/includes/application/code/core/Legacies/Core/Block/Concat.php new file mode 100644 index 0000000..5e3cfb5 --- /dev/null +++ b/includes/application/code/core/Legacies/Core/Block/Concat.php @@ -0,0 +1,14 @@ +_partials as $partial) { + $content .= $partial->render(); + } + return $content; + } +} \ No newline at end of file diff --git a/includes/application/code/core/Legacies/Core/Block/Html/Form.php b/includes/application/code/core/Legacies/Core/Block/Html/Form.php new file mode 100644 index 0000000..92f0098 --- /dev/null +++ b/includes/application/code/core/Legacies/Core/Block/Html/Form.php @@ -0,0 +1,11 @@ +getFormKey(true); + } +} \ No newline at end of file diff --git a/includes/application/code/core/Legacies/Core/Block/Html/Head.php b/includes/application/code/core/Legacies/Core/Block/Html/Head.php new file mode 100644 index 0000000..7580264 --- /dev/null +++ b/includes/application/code/core/Legacies/Core/Block/Html/Head.php @@ -0,0 +1,145 @@ +_items[$type])) { + $this->_items[$type] = array(); + } + $this->_items[$type][] = $options; + + return $this; + } + + public function addJs($script, $type = 'text/javascript', Array $options = array()) + { + $options['type'] = $type; + $options['path'] = $script; + + $this->addItem(self::TYPE_GLOBAL_JS, $options); + + return $this; + } + + public function addCss($stylesheet, $type = 'text/css', $condition = null, Array $options = array()) + { + $options['type'] = $type; + $options['path'] = $stylesheet; + $options['condition'] = $condition; + + $this->addItem(self::TYPE_SKIN_CSS, $options); + + return $this; + } + + public function addSkinJs($script, $type = 'text/javascript', Array $options = array()) + { + $options['type'] = $type; + $options['path'] = $script; + + $this->addItem(self::TYPE_SKIN_JS, $options); + + return $this; + } + + public function addInlineJs($content, $type = 'text/javascript', Array $options = array()) + { + $options['type'] = $type; + $options['content'] = $content; + + $this->addItem(self::TYPE_INLINE_JS, $options); + + return $this; + } + + public function addInlineCss($content, $type = 'text/css', Array $options = array()) + { + $options['type'] = $type; + $options['path'] = $path; + $options['content'] = $content; + + $this->addItem(self::TYPE_INLINE_CSS, $options); + + return $this; + } + + public function getCss() + { + if (isset($this->_items[self::TYPE_SKIN_CSS])) { + return $this->_items[self::TYPE_SKIN_CSS]; + } + return array(); + } + + public function getInlineCss() + { + if (isset($this->_items[self::TYPE_INLINE_CSS])) { + return $this->_items[self::TYPE_INLINE_CSS]; + } + return array(); + } + + public function getJs() + { + if (isset($this->_items[self::TYPE_GLOBAL_JS])) { + return $this->_items[self::TYPE_GLOBAL_JS]; + } + return array(); + } + + public function getSkinJs() + { + if (isset($this->_items[self::TYPE_SKIN_JS])) { + return $this->_items[self::TYPE_SKIN_JS]; + } + return array(); + } + + public function getInlineJs() + { + if (isset($this->_items[self::TYPE_INLINE_JS])) { + return $this->_items[self::TYPE_INLINE_JS]; + } + return array(); + } + + public function renderCss() + { + $render = ''; + foreach ($this->getCss() as $css) { + if (!isset($css['media'])) { + $css['media'] = 'all'; + } + $render .=<< +HTML_EOF; + } + return $render; + } + + public function renderJs() + { + $render = ''; + foreach ($this->getJs() as $js) { + if (!isset($css['media'])) { + $css['media'] = 'all'; + } + $render .=<< +HTML_EOF; + } + return $render; + } +} \ No newline at end of file diff --git a/includes/application/code/core/Legacies/Core/Block/Html/Navigation.php b/includes/application/code/core/Legacies/Core/Block/Html/Navigation.php new file mode 100644 index 0000000..407a3e6 --- /dev/null +++ b/includes/application/code/core/Legacies/Core/Block/Html/Navigation.php @@ -0,0 +1,6 @@ +_bodyClasses); + } + + public function addBodyClass($class) + { + $this->_bodyClasses[] = $class; + + return $this; + } +} \ No newline at end of file diff --git a/includes/application/code/core/Legacies/Core/Block/Template.php b/includes/application/code/core/Legacies/Core/Block/Template.php new file mode 100644 index 0000000..41d74b2 --- /dev/null +++ b/includes/application/code/core/Legacies/Core/Block/Template.php @@ -0,0 +1,7 @@ +_content = $content; + + return $this; + } + + public function getContent() + { + return $this->_content; + } + + public function render() + { + $content = $this->getContent(); + if (empty($content)) { + return null; + } + return $content; + } +} \ No newline at end of file diff --git a/includes/application/code/community/Legacies/Core/Collection.php b/includes/application/code/core/Legacies/Core/Collection.php similarity index 91% rename from includes/application/code/community/Legacies/Core/Collection.php rename to includes/application/code/core/Legacies/Core/Collection.php index ddb3d42..ed3265e 100644 --- a/includes/application/code/community/Legacies/Core/Collection.php +++ b/includes/application/code/core/Legacies/Core/Collection.php @@ -177,8 +177,8 @@ class Legacies_Core_Collection } else { $fields = '*'; } - if (!empty($where)) { - $where = 'WHERE ' . implode(" AND ", $this->_where); + if (!empty($this->_where)) { + $where = 'WHERE (' . implode(") AND (", $this->_where) . ')'; } else { $where = ''; } @@ -261,7 +261,12 @@ SQL_EOF; $statement->execute(array_shift($args)); $this->_items = array(); - $reflection = new ReflectionClass($this->getEntityClassName()); + if (func_num_args() > 1) { + $reflection = new ReflectionClass(array_shift($args)); + } else { + $reflection = new ReflectionClass($this->getEntityClassName()); + } + while ($row = $statement->fetch(PDO::FETCH_ASSOC)) { $params = array_merge(array($row), $args); $this->_items[] = $reflection->newInstanceArgs($params); @@ -288,6 +293,22 @@ SQL_EOF; return $this; } + public function getSize() + { + $clone = clone $this; + $clone->_fields = array(); + $clone->column('COUNT(*)'); + + $sql = $clone->_prepareSql(); + + $database = Legacies_Database::getSingleton(); + $statement = $database->prepare($sql); + + $args = func_get_args(); + $statement->execute(array_shift($args)); + return $statement->fetch(PDO::FETCH_COLUMN, 0); + } + public function count() { return count($this->_items); diff --git a/includes/application/code/core/Legacies/Core/Controller/Action.php b/includes/application/code/core/Legacies/Core/Controller/Action.php new file mode 100644 index 0000000..4bf9f30 --- /dev/null +++ b/includes/application/code/core/Legacies/Core/Controller/Action.php @@ -0,0 +1,54 @@ +_request; + } + + public function getResponse() + { + return $this->_response; + } + + protected function _forward($action, $controller = null, $module = null) + { + $request = $this->getRequest(); + + $request->setAction($action); + if ($controller !== null) { + $request->setController($controller); + if ($module != null) { + $request->setModule($module); + } + } + $request->setIsDispatched(false); + } + + protected function _redirect($url) + { + $this->getResponse() + ->setRawHeader('HTTP/1.1 302 Found') + ->setHeader('Location', $url) + ->setIsRedirect(true) + ; + + return $this; + } +} \ No newline at end of file diff --git a/includes/application/code/core/Legacies/Core/Controller/Request/Http.php b/includes/application/code/core/Legacies/Core/Controller/Request/Http.php new file mode 100644 index 0000000..f7e0735 --- /dev/null +++ b/includes/application/code/core/Legacies/Core/Controller/Request/Http.php @@ -0,0 +1,78 @@ +setData($key, $value); + } + + public function getParam($key, $default = null) + { + if ($this->hasData($key)) { + return $this->getData($key); + } + if (isset($_POST[$key])) { + return $_POST[$key]; + } + if (!isset($_GET[$key])) { + return $_GET[$key]; + } + if (!isset($_FILES[$key])) { + return $_FILES[$key]; + } + if (!isset($_COOKIE[$key])) { + return $_COOKIE[$key]; + } + if (!isset($_SERVER[$key])) { + return $_SERVER[$key]; + } + return $default; + } + + public function getQuery($key, $default = null) + { + if (!isset($_GET[$key])) { + return $default; + } + return $_GET[$key]; + } + + public function getFile($key, $default = null) + { + if (!isset($_FILES[$key])) { + return $default; + } + return $_FILES[$key]; + } + + public function getCookie($key, $default = null) + { + if (!isset($_COOKIE[$key])) { + return $default; + } + return unserialize(stripslashes($_COOKIE[$key])); + } + + public function getRawCookie($key, $default = null) + { + if (!isset($_COOKIE[$key])) { + return $default; + } + return $_COOKIE[$key]; + } + + public function getPost($key, $default = null) + { + if (!isset($_POST[$key])) { + return $default; + } + return $_POST[$key]; + } +} \ No newline at end of file diff --git a/includes/application/code/core/Legacies/Core/Controller/Response/Http.php b/includes/application/code/core/Legacies/Core/Controller/Response/Http.php new file mode 100644 index 0000000..712ac32 --- /dev/null +++ b/includes/application/code/core/Legacies/Core/Controller/Response/Http.php @@ -0,0 +1,132 @@ +clearBody(); + + return $this->appendBody($data); + } + + public function appendBody($data) + { + if (!isset($this->_data['body']) || !is_array($this->_data['body'])) { + $this->clearBody(); + } + $this->_data['body'][] = $data; + + return $this; + } + + public function clearBody() + { + $this->_data['body'] = array(); + + return $this; + } + + public function sendBody() + { + return implode('', $this->_data['body']); + } + + public function clearHeaders() + { + $this->_data['headers'] = array(); + + return $this; + } + + public function clearRawHeaders() + { + $this->_data['raw_headers'] = array(); + + return $this; + } + + public function clearAllHeaders() + { + $this->clearHeaders(); + $this->clearRawHeaders(); + + return $this; + } + + public function setHeader($name, $value) + { + if (!isset($this->_data['headers']) || !is_array($this->_data['headers'])) { + $this->clearHeaders(); + } + $this->_data['headers'][$name] = $value; + + return $this; + } + + public function setRawHeader($name, $value) + { + if (!isset($this->_data['raw_headers']) || !is_array($this->_data['raw_headers'])) { + $this->clearRawHeaders(); + } + $this->_data['raw_headers'][] = $value; + + return $this; + } + + public function sendHeaders() + { + if (isset($this->_data['raw_headers'])) { + foreach ($this->_data['raw_headers'] as $header) { + header($header); + } + } + if (isset($this->_data['headers'])) { + foreach ($this->_data['headers'] as $headerName => $headerValue) { + header("{$headerName}: {$headerValue}"); + } + } + $this->clearAllHeaders(); + + return $this; + } + + public function setIsRedirect($value = null) + { + if (is_bool($value)) { + $this->_data['is_redirect'] = $value; + } + return $this->_data['is_redirect']; + } + + public function setIsDispatched($dispatched = true) + { + return $this->setData('id_dispatched', $dispatched); + } + + public function getIsDispatched() + { + return $this->getData('id_dispatched'); + } + + public function setCookie($name, $value, $lifetime = null, $path = null, $domain = null) + { + return $this->setRawCookie($name, serialize($value), $lifetime, $path, $domain); + } + + public function unsetCookie($name, $path = null, $domain = null) + { + return $this->setRawCookie($name, null, 0, $path, $domain); + } + + public function setRawCookie($name, $value, $lifetime = null, $path = null, $domain = null) + { + setcookie($name, $value, time() + $lifetime, $path, $domain); + return $this; + } +} \ No newline at end of file diff --git a/includes/application/code/community/Legacies/Core/Entity.php b/includes/application/code/core/Legacies/Core/Entity.php similarity index 98% rename from includes/application/code/community/Legacies/Core/Entity.php rename to includes/application/code/core/Legacies/Core/Entity.php index e12a1f1..2378c75 100644 --- a/includes/application/code/community/Legacies/Core/Entity.php +++ b/includes/application/code/core/Legacies/Core/Entity.php @@ -7,6 +7,8 @@ abstract class Legacies_Core_Entity protected $_idFieldName = null; protected $_tableName = null; + protected $_eventPrefix = 'entity'; + public function setIdFieldName($fieldName) { $this->_idFieldName = $fieldName; diff --git a/includes/application/code/community/Legacies/Core/Entity/SubTable.php b/includes/application/code/core/Legacies/Core/Entity/SubTable.php similarity index 98% rename from includes/application/code/community/Legacies/Core/Entity/SubTable.php rename to includes/application/code/core/Legacies/Core/Entity/SubTable.php index 58720bf..550acb6 100644 --- a/includes/application/code/community/Legacies/Core/Entity/SubTable.php +++ b/includes/application/code/core/Legacies/Core/Entity/SubTable.php @@ -13,6 +13,8 @@ abstract class Legacies_Core_Entity_SubTable protected $_tableName = null; protected $_idFieldNames = array(); + protected $_eventPrefix = 'entity.sub-table'; + protected function _save() { if ($this->_isLoaded !== false) { diff --git a/includes/application/code/community/Legacies/Core/EntityInterface.php b/includes/application/code/core/Legacies/Core/EntityInterface.php similarity index 100% rename from includes/application/code/community/Legacies/Core/EntityInterface.php rename to includes/application/code/core/Legacies/Core/EntityInterface.php diff --git a/includes/application/code/community/Legacies/Core/Error.php b/includes/application/code/core/Legacies/Core/ErrorProfiler.php similarity index 68% rename from includes/application/code/community/Legacies/Core/Error.php rename to includes/application/code/core/Legacies/Core/ErrorProfiler.php index 0c80f40..53dc2d8 100644 --- a/includes/application/code/community/Legacies/Core/Error.php +++ b/includes/application/code/core/Legacies/Core/ErrorProfiler.php @@ -1,6 +1,6 @@ 'E_USER_DEPRECATED', ); - if (isset($types[$error['code']])) { + if (isset($error['code']) && isset($types[$error['code']])) { $code = $types[$error['code']]; } else { $code = "Unknown ({$error['code']})"; @@ -122,42 +124,56 @@ ERROR_EOF; public function shutdownManager() { - echo '
';
-        foreach ($this->_errors as $error) {
-            echo $this->_renderError($error);
+        echo '
'; + echo '

Debug profiler

'; + if (count($this->_errors) <= 0 && count($this->_warnings) <= 0 && + count($this->_notices) <= 0 && count($this->_otherErrors) <= 0 && + count($this->_exceptions) <= 0) { + echo '

Profiler was empty.

'; + } else { + echo '
';
+            foreach ($this->_errors as $error) {
+                echo $this->_renderError($error);
+            }
+            foreach ($this->_warnings as $error) {
+                echo $this->_renderError($error);
+            }
+            foreach ($this->_notices as $error) {
+                echo $this->_renderError($error);
+            }
+            foreach ($this->_otherErrors as $errorList) {
+                foreach ($errorList as $error) {
+                    echo $this->_renderError($error);
+                }
+            }
+            foreach ($this->_exceptions as $exception) {
+                echo $exception->getMessage() . PHP_EOL;
+                echo $exception->getTraceAsString();
+            }
+            echo '
'; } - foreach ($this->_warnings as $error) { - echo $this->_renderError($error); - } - foreach ($this->_notices as $error) { - echo $this->_renderError($error); - } - foreach ($this->_otherErrors as $error) { - echo $this->_renderError($error); - } - foreach ($this->_exceptions as $exception) { - echo $exception->getMessage(); - echo $exception->getTraceAsString(); - } - echo '
'; + echo ''; } public static function register() { - static $registered = false; - set_error_handler(array(self::getSingleton(), 'errorManager')); set_exception_handler(array(self::getSingleton(), 'exceptionManager')); - if ($registered === false && defined('DEBUG')) { - $registered = true; + if (self::$_isTraceRegistered === false && defined('DEBUG')) { + self::$_isTraceRegistered = true; register_shutdown_function(array(self::getSingleton(), 'shutdownManager')); } } - public static function unregister() + public static function unregister($force = false) { restore_error_handler(); restore_exception_handler(); + + if ((self::$_isTraceRegistered && defined('DEBUG')) || $force) { + self::$_isTraceRegistered = false; + register_shutdown_function(array(self::getSingleton(), 'shutdownManager')); + } } } diff --git a/includes/application/code/community/Legacies/Core/Event.php b/includes/application/code/core/Legacies/Core/Event.php similarity index 100% rename from includes/application/code/community/Legacies/Core/Event.php rename to includes/application/code/core/Legacies/Core/Event.php diff --git a/includes/application/code/community/Legacies/Core/Event/Break.php b/includes/application/code/core/Legacies/Core/Event/Break.php similarity index 100% rename from includes/application/code/community/Legacies/Core/Event/Break.php rename to includes/application/code/core/Legacies/Core/Event/Break.php diff --git a/includes/application/code/community/Legacies/Core/Exception.php b/includes/application/code/core/Legacies/Core/Exception.php similarity index 100% rename from includes/application/code/community/Legacies/Core/Exception.php rename to includes/application/code/core/Legacies/Core/Exception.php diff --git a/includes/application/code/core/Legacies/Core/Layout.php b/includes/application/code/core/Legacies/Core/Layout.php new file mode 100644 index 0000000..a56607d --- /dev/null +++ b/includes/application/code/core/Legacies/Core/Layout.php @@ -0,0 +1,220 @@ + $layoutConfig) { + if ($this->hasData($layoutId)) { + $declared = $this->getData($layoutId); + $layoutConfig = array_merge($declared, $layoutConfig); + } + + $this->setData($layoutId, $layoutConfig); + } + } + + return $this; + } + + public function _load() + { + $layoutId = func_get_arg(0); + + if (!$this->hasData($layoutId)) { + return $this; + } + + $layoutConfigs = array($this->getData($layoutId)); + $layoutUpdates = array(); + if (isset($layoutConfigs[0]['update'])) { + $parent = $layoutConfigs[0]['update']; + + $i = 0; + while (true) { + $layoutConfigs[++$i] = $this->getData($parent); + + if (!isset($layoutConfigs[$i]['update'])) { + break; + } + $parent = $layoutConfigs[$i]['update']; + } + } + + $layoutConfig = array(); + foreach (array_reverse($layoutConfigs) as $config) { + $layoutConfig = array_merge($layoutConfig, $config); + + if (isset($layoutConfig['reference'])) { + foreach ($layoutConfig['reference'] as $name => $update) { + if (!isset($layoutUpdates[$name])) { + $layoutUpdates[$name] = array(); + } + $layoutUpdates[$name][] = $update; + } + unset($layoutConfig['reference']); + } + } + unset($layoutConfigs, $layoutConfig['update']); + + $type = $layoutConfig['type']; + $name = isset($layoutConfig['name']) ? $layoutConfig['name'] : 'root'; + + $this->_view = $this->createBlock($type, $name, $layoutConfig); + + foreach ($layoutUpdates as $block => $updates) { + if (!isset($this->_blocks[$block])) { + continue; + } + $parent = $this->_blocks[$block]; + foreach ($updates as $update) { + if (isset($update['children'])) { + foreach ($update['children'] as $childName => $childConfig) { + $type = $childConfig['type']; + $alias = isset($childConfig['alias']) ? $childConfig['alias'] : $childName; + + $parent->$alias = $this->createBlock($type, $childName, $childConfig); + } + } + } + } + } + + public function _save() + { + } + + public function _delete() + { + } + + protected function _resolveBlockClassType($type) + { + $offset = strpos($type, '/'); + if ($offset === false) { + return null; + } + + $module = substr($type, 0, $offset); + $block = substr($type, $offset + 1); + + $module = str_replace(' ', '', ucwords(str_replace('-', ' ', $module))); + $module = str_replace(' ', '_', ucwords(str_replace('.', ' ', $module))); + $block = str_replace(' ', '', ucwords(str_replace('-', ' ', $block))); + $block = str_replace(' ', '_', ucwords(str_replace('.', ' ', $block))); + + return 'Legacies_' . $module . '_Block_' . $block; + } + + public function createBlock($type, $name, $config = array()) + { + $className = $this->_resolveBlockClassType($type); + + $children = array(); + if (isset($config['children'])) { + $children = $config['children']; + unset($config['children']); + } + $actions = array(); + if (isset($config['actions'])) { + $actions = $config['actions']; + unset($config['actions']); + } + + try { + $reflectionClass = new ReflectionClass($className); + + $instance = $reflectionClass->newInstance($config); + $this->_blocks[$name] = $instance; + + foreach ($children as $name => $config) { + if (isset($config['alias'])) { + $alias = $config['alias']; + } else { + $alias = $name; + } + + if (!isset($config['type'])) { + $instance->$alias = new Legacies_Core_View($config); + } else { + $instance->$alias = $this->createBlock($config['type'], $name, $config); + } + } + } catch (ReflectionException $e) { + return null; + } + + $instance->setLayout($this); + + foreach ($actions as $action) { + if (!isset($action['method'])) { + continue; + } + $method = $action['method']; + + $params = array(); + if (isset($action['params'])) { + $params = $action['params']; + } + + try { + $reflectionMethod = $reflectionClass->getMethod($method); + $callParamaters = array(); + foreach ($reflectionMethod->getParameters() as $parameter) { + $paramterName = $parameter->getName(); + $paramterPosition = $parameter->getPosition(); + + if (isset($params[$paramterName])) { + $callParamaters[$paramterPosition] = $params[$paramterName]; + } else if ($parameter->isDefaultValueAvailable()) { + $callParamaters[$paramterPosition] = $parameter->getDefaultValue(); + } else if ($parameter->isOptionnal()) { + continue; + } else { + throw RuntimeException(); + } + } + + $reflectionMethod->invokeArgs($instance, $callParamaters); + } catch (ReflectionException $e) { + continue; + } catch (RuntimeException $e) { + continue; + } + } + + $instance->prepareLayout(); + + return $instance; + } + + public function getBlock($code) + { + if (isset($this->_blocks[$code])) { + return $this->_blocks[$code]; + } + return null; + } + + public function render() + { + foreach ($this->_blocks as $block) { + $block->beforeToHtml(); + } + unset($block); + + return $this->_view->render(); + } +} \ No newline at end of file diff --git a/includes/application/code/community/Legacies/Core/Model.php b/includes/application/code/core/Legacies/Core/Model.php similarity index 59% rename from includes/application/code/community/Legacies/Core/Model.php rename to includes/application/code/core/Legacies/Core/Model.php index 5b48f99..15eae61 100644 --- a/includes/application/code/community/Legacies/Core/Model.php +++ b/includes/application/code/core/Legacies/Core/Model.php @@ -5,12 +5,15 @@ abstract class Legacies_Core_Model { protected $_originalData = array(); + protected $_eventPrefix = 'model'; + protected $_eventObject = 'model'; + public function __construct(Array $data = array()) { $this->_data = $data; - $this->_setOriginalData($data); $this->_init(); + $this->_setOriginalData($this->_data); } abstract protected function _init(); @@ -38,11 +41,17 @@ abstract class Legacies_Core_Model protected function _beforeSave() { + Legacies::dispatchEvent('model.before-save', array($this->_eventObject => $this)); + Legacies::dispatchEvent($this->_eventPrefix . '.before-save', array($this->_eventObject => $this)); + return $this; } protected function _afterSave() { + Legacies::dispatchEvent('model.after-save', array($this->_eventObject => $this)); + Legacies::dispatchEvent($this->_eventPrefix . '.after-save', array($this->_eventObject => $this)); + return $this; } @@ -64,11 +73,17 @@ abstract class Legacies_Core_Model protected function _beforeLoad() { + Legacies::dispatchEvent('model.before-load', array($this->_eventObject => $this)); + Legacies::dispatchEvent($this->_eventPrefix . '.before-load', array($this->_eventObject => $this)); + return $this; } protected function _afterLoad() { + Legacies::dispatchEvent('model.after-load', array($this->_eventObject => $this)); + Legacies::dispatchEvent($this->_eventPrefix . '.after-load', array($this->_eventObject => $this)); + return $this; } @@ -89,11 +104,37 @@ abstract class Legacies_Core_Model protected function _beforeDelete() { + Legacies::dispatchEvent('model.before-delete', array($this->_eventObject => $this)); + Legacies::dispatchEvent($this->_eventPrefix . '.before-delete', array($this->_eventObject => $this)); + return $this; } protected function _afterDelete() { + Legacies::dispatchEvent('model.after-delete', array($this->_eventObject => $this)); + Legacies::dispatchEvent($this->_eventPrefix . '.after-delete', array($this->_eventObject => $this)); + return $this; } + + public function __set($key, $value) + { + return $this->setData($key, $value); + } + + public function __get($key) + { + return $this->getData($key); + } + + public function __unset($key) + { + return $this->unsetData($key); + } + + public function __isset($key) + { + return $this->hasData($key); + } } \ No newline at end of file diff --git a/includes/application/code/community/Legacies/Core/Model/Config.php b/includes/application/code/core/Legacies/Core/Model/Config.php similarity index 95% rename from includes/application/code/community/Legacies/Core/Model/Config.php rename to includes/application/code/core/Legacies/Core/Model/Config.php index 16eaa6d..6f365e3 100644 --- a/includes/application/code/community/Legacies/Core/Model/Config.php +++ b/includes/application/code/core/Legacies/Core/Model/Config.php @@ -13,6 +13,9 @@ class Legacies_Core_Model_Config { private static $_singleton = null; + protected $_eventPrefix = 'core.config'; + protected $_eventObject = 'config'; + public static function getSingleton() { if (self::$_singleton === null) { diff --git a/includes/application/code/community/Legacies/Core/Model/Exception.php b/includes/application/code/core/Legacies/Core/Model/Exception.php similarity index 100% rename from includes/application/code/community/Legacies/Core/Model/Exception.php rename to includes/application/code/core/Legacies/Core/Model/Exception.php diff --git a/includes/application/code/community/Legacies/Core/Model/Session.php b/includes/application/code/core/Legacies/Core/Model/Session.php similarity index 79% rename from includes/application/code/community/Legacies/Core/Model/Session.php rename to includes/application/code/core/Legacies/Core/Model/Session.php index b093a67..aa62685 100644 --- a/includes/application/code/community/Legacies/Core/Model/Session.php +++ b/includes/application/code/core/Legacies/Core/Model/Session.php @@ -10,11 +10,12 @@ class Legacies_Core_Model_Session extends Legacies_Object { - const CRIT = 0x80; - const ERROR = 0x40; - const WARN = 0x20; - const INFO = 0x10; - const DEBUG = 0x01; + const CRIT = 0x80; + const ERROR = 0x40; + const WARN = 0x20; + const INFO = 0x10; + const DEBUG = 0x01; + const SUCCESS = 0; protected static $_instances = null; @@ -98,6 +99,14 @@ class Legacies_Core_Model_Session return $this->addMessage(vsprintf($message, $args), self::WARN); } + public function addSuccess($message, $_ = null) + { + $args = func_get_args(); + array_shift($args); + + return $this->addMessage(vsprintf($message, $args), self::SUCCESS); + } + public function addInfo($message, $_ = null) { $args = func_get_args(); @@ -113,4 +122,19 @@ class Legacies_Core_Model_Session return $this->addMessage(vsprintf($message, $args), self::DEBUG); } + + public function getFormKey($reset = false) + { + if (!$this->getData('form_key')) { + $this->setData('form_key', uniqid()); + return $this->getData('form_key'); + } + + $key = $this->getData('form_key'); + if ($reset == true) { + $this->setData('form_key', uniqid()); + } + + return $key; + } } \ No newline at end of file diff --git a/includes/application/code/community/Legacies/Core/Model/Translator.php b/includes/application/code/core/Legacies/Core/Model/Translator.php similarity index 100% rename from includes/application/code/community/Legacies/Core/Model/Translator.php rename to includes/application/code/core/Legacies/Core/Model/Translator.php diff --git a/includes/application/code/community/Legacies/Core/Setup/Updater/ScriptQueue.php b/includes/application/code/core/Legacies/Core/Setup/Updater/ScriptQueue.php similarity index 100% rename from includes/application/code/community/Legacies/Core/Setup/Updater/ScriptQueue.php rename to includes/application/code/core/Legacies/Core/Setup/Updater/ScriptQueue.php diff --git a/includes/application/code/community/Legacies/Core/Singleton.php b/includes/application/code/core/Legacies/Core/Singleton.php similarity index 100% rename from includes/application/code/community/Legacies/Core/Singleton.php rename to includes/application/code/core/Legacies/Core/Singleton.php diff --git a/includes/application/code/core/Legacies/Core/Time.php b/includes/application/code/core/Legacies/Core/Time.php new file mode 100644 index 0000000..a10a2d9 --- /dev/null +++ b/includes/application/code/core/Legacies/Core/Time.php @@ -0,0 +1,13 @@ +_template = $data['template']; + unset($data['template']); + } + + parent::__construct($data); + } + + protected function _prepareRender() + { + return $this; + } + + public function renderNumber($number) + { + return Math::render($number); + } + + protected function escape($unescaped) + { + return htmlspecialchars($unescaped, ENT_QUOTES, 'UTF-8'); + } + + public function __($message, $_ = null) + { + $args = func_get_args(); + array_shift($args); + + return Legacies::translate(Legacies::getLocale(), $message, $args); + } + + public function translate($message, $_ = null) + { + $args = func_get_args(); + array_shift($args); + + return Legacies::translate(Legacies::getLocale(), $message, $args); + } + + public function renderScript($file) + { + $this->_prepareRender(); + + $path = APPLICATION_PATH . DIRECTORY_SEPARATOR . 'design' . DIRECTORY_SEPARATOR . 'scripts'; + + ob_start(); + include $path . DIRECTORY_SEPARATOR . $file; + $contents = ob_get_contents(); + ob_end_clean(); + + return $contents; + } + + public function render() + { + $template = $this->getTemplate(); + if (empty($template)) { + return null; + } + return $this->renderScript($template); + } + + public function setTemplate($template) + { + $this->_template = $template; + + return $this; + } + + public function getTemplate() + { + return $this->_template; + } + + public function getUrl($uri, Array $params = array()) + { + // TODO: base path integration + $serializedParams = array(); + foreach ($params as $paramKey => $paramValue) { + if ($paramValue) { + $serializedParams[] = "{$paramKey}={$paramValue}"; + } + } + + if (count($serializedParams) > 0) { + return $uri . '?' . implode('&', $serializedParams); + } + return $uri; + } + + public function getSkinUrl($uri) + { + static $baseUrl = null; + if ($baseUrl === null) { + $user = Legacies_Empire_Model_User::getSingleton(); + if ($user !== null && $user->getId() && ($baseUrl = $user->getSkinPath()) == '') { + $baseUrl = DEFAULT_SKINPATH; + } + } + + return $baseUrl . $uri; + } + + public function setPartial($name, $content) + { + if (!is_string($content) && !$content instanceof self) { + return $this; + } + + $this->_partials[$name] = $content; + + return $this; + } + + public function getPartial($name) + { + return $this->_partials[$name]; + } + + public function unsetPartial($name) + { + if (isset($this->_partials[$name])) { + unset($this->_partials[$name]); + } + + return $this; + } + + public function hasPartial($name) + { + return isset($this->_partials[$name]) && (is_string($this->_partials[$name]) || $this->_partials[$name] instanceof self); + } + + public function __set($name, $content) + { + return $this->setPartial($name, $content); + } + + public function __get($name) + { + $name = str_replace(' ', '', ucwords(str_replace('-', ' ', $name))); + $name[0] = strtolower($name[0]); + return $this->getPartial($name); + } + + public function __unset($name) + { + return $this->unsetPartial($name); + } + + public function __isset($name) + { + return $this->hasPartial($name); + } + + public function setLayout($layout) + { + $this->_layout = $layout; + + return $this; + } + + public function getLayout() + { + return $this->_layout; + } + + public function prepareLayout() + { + } + + public function beforeToHtml() + { + } +} \ No newline at end of file diff --git a/includes/application/code/community/Legacies/Core/install/mysql5/install-2011.1.0.php b/includes/application/code/core/Legacies/Core/install/mysql5/install-2011.1.0.php similarity index 100% rename from includes/application/code/community/Legacies/Core/install/mysql5/install-2011.1.0.php rename to includes/application/code/core/Legacies/Core/install/mysql5/install-2011.1.0.php diff --git a/includes/application/code/community/Legacies/Core/install/mysql5/uninstall-2011.1.0.php b/includes/application/code/core/Legacies/Core/install/mysql5/uninstall-2011.1.0.php similarity index 100% rename from includes/application/code/community/Legacies/Core/install/mysql5/uninstall-2011.1.0.php rename to includes/application/code/core/Legacies/Core/install/mysql5/uninstall-2011.1.0.php diff --git a/includes/application/code/community/Legacies/Database.php b/includes/application/code/core/Legacies/Database.php similarity index 100% rename from includes/application/code/community/Legacies/Database.php rename to includes/application/code/core/Legacies/Database.php diff --git a/includes/application/code/community/Legacies/Empire.php b/includes/application/code/core/Legacies/Empire.php similarity index 100% rename from includes/application/code/community/Legacies/Empire.php rename to includes/application/code/core/Legacies/Empire.php diff --git a/includes/application/code/core/Legacies/Empire/Block/Overview.php b/includes/application/code/core/Legacies/Empire/Block/Overview.php new file mode 100644 index 0000000..3466417 --- /dev/null +++ b/includes/application/code/core/Legacies/Empire/Block/Overview.php @@ -0,0 +1,7 @@ +getCurrentUser()->getCurrentPlanet(); + } + + /** + * + * @return Legacies_Core_Collection + */ + public function getPlanetCollection() + { + return $this->getCurrentUser()->getPlanetCollection(); + } +} \ No newline at end of file diff --git a/includes/application/code/core/Legacies/Empire/Exception.php b/includes/application/code/core/Legacies/Empire/Exception.php new file mode 100644 index 0000000..73de227 --- /dev/null +++ b/includes/application/code/core/Legacies/Empire/Exception.php @@ -0,0 +1,3 @@ +_queue[$itemIndex])) { return $this->_queue[$itemIndex]; diff --git a/includes/application/code/core/Legacies/Empire/Model/Fleet.php b/includes/application/code/core/Legacies/Empire/Model/Fleet.php new file mode 100644 index 0000000..0e8afb8 --- /dev/null +++ b/includes/application/code/core/Legacies/Empire/Model/Fleet.php @@ -0,0 +1,79 @@ +setIdFieldName('fleet_id'); + $this->setTableName('fleets'); + } + + public static function planetListener($eventData) + { + } + + public function isOwnedBy(Legacies_Empire_Model_User $user) + { + if ($this->getData('fleet_owner') == $user->getId()) { + return true; + } + return false; + } + + public function isMission($missionType) + { + if ($this->getData('fleet_mission') == $missionType) { + return true; + } + return false; + } + + public function getRowClass() + { + if ($this->isMission(Legacies_Empire::ID_MISSION_ATTACK) || $this->isMission(Legacies_Empire::ID_MISSION_GROUP_ATTACK)) { + return 'attack'; + } else if ($this->isMission(Legacies_Empire::ID_MISSION_TRANSPORT)) { + return 'transport'; + } else if ($this->isMission(Legacies_Empire::ID_MISSION_STATION) || $this->isMission(Legacies_Empire::ID_MISSION_STATION_ALLY)) { + return 'station'; + } else if ($this->isMission(Legacies_Empire::ID_MISSION_SETTLE_COLONY)) { + return 'settle'; + } else if ($this->isMission(Legacies_Empire::ID_MISSION_RECYCLE)) { + return 'recycle'; + } else if ($this->isMission(Legacies_Empire::ID_MISSION_DESTROY)) { + return 'destroy'; + } else if ($this->isMission(Legacies_Empire::ID_MISSION_MISSILES)) { + return 'missiles'; + } else if ($this->isMission(Legacies_Empire::ID_MISSION_EXPEDITION)) { + return 'expedition'; + } + } +} \ No newline at end of file diff --git a/includes/application/code/core/Legacies/Empire/Model/Galaxy/Position.php b/includes/application/code/core/Legacies/Empire/Model/Galaxy/Position.php new file mode 100644 index 0000000..7da2968 --- /dev/null +++ b/includes/application/code/core/Legacies/Empire/Model/Galaxy/Position.php @@ -0,0 +1,11 @@ +_tableName = 'galaxy'; + $this->_idFieldNames = array('id_planet'); + } +} \ No newline at end of file diff --git a/includes/application/code/community/Legacies/Empire/Model/Game/Abstract.php b/includes/application/code/core/Legacies/Empire/Model/Game/Abstract.php similarity index 100% rename from includes/application/code/community/Legacies/Empire/Model/Game/Abstract.php rename to includes/application/code/core/Legacies/Empire/Model/Game/Abstract.php diff --git a/includes/application/code/community/Legacies/Empire/Model/Game/Combat.php b/includes/application/code/core/Legacies/Empire/Model/Game/Combat.php similarity index 100% rename from includes/application/code/community/Legacies/Empire/Model/Game/Combat.php rename to includes/application/code/core/Legacies/Empire/Model/Game/Combat.php diff --git a/includes/application/code/community/Legacies/Empire/Model/Game/FieldsAlias.php b/includes/application/code/core/Legacies/Empire/Model/Game/FieldsAlias.php similarity index 100% rename from includes/application/code/community/Legacies/Empire/Model/Game/FieldsAlias.php rename to includes/application/code/core/Legacies/Empire/Model/Game/FieldsAlias.php diff --git a/includes/application/code/community/Legacies/Empire/Model/Game/Prices.php b/includes/application/code/core/Legacies/Empire/Model/Game/Prices.php similarity index 100% rename from includes/application/code/community/Legacies/Empire/Model/Game/Prices.php rename to includes/application/code/core/Legacies/Empire/Model/Game/Prices.php diff --git a/includes/application/code/community/Legacies/Empire/Model/Game/Production.php b/includes/application/code/core/Legacies/Empire/Model/Game/Production.php similarity index 100% rename from includes/application/code/community/Legacies/Empire/Model/Game/Production.php rename to includes/application/code/core/Legacies/Empire/Model/Game/Production.php diff --git a/includes/application/code/community/Legacies/Empire/Model/Game/Requirements.php b/includes/application/code/core/Legacies/Empire/Model/Game/Requirements.php similarity index 100% rename from includes/application/code/community/Legacies/Empire/Model/Game/Requirements.php rename to includes/application/code/core/Legacies/Empire/Model/Game/Requirements.php diff --git a/includes/application/code/community/Legacies/Empire/Model/Game/Resources.php b/includes/application/code/core/Legacies/Empire/Model/Game/Resources.php similarity index 100% rename from includes/application/code/community/Legacies/Empire/Model/Game/Resources.php rename to includes/application/code/core/Legacies/Empire/Model/Game/Resources.php diff --git a/includes/application/code/community/Legacies/Empire/Model/Game/Types.php b/includes/application/code/core/Legacies/Empire/Model/Game/Types.php similarity index 100% rename from includes/application/code/community/Legacies/Empire/Model/Game/Types.php rename to includes/application/code/core/Legacies/Empire/Model/Game/Types.php diff --git a/includes/application/code/community/Legacies/Empire/Model/Planet.php b/includes/application/code/core/Legacies/Empire/Model/Planet.php similarity index 70% rename from includes/application/code/community/Legacies/Empire/Model/Planet.php rename to includes/application/code/core/Legacies/Empire/Model/Planet.php index 57e0e33..0f6c766 100644 --- a/includes/application/code/community/Legacies/Empire/Model/Planet.php +++ b/includes/application/code/core/Legacies/Empire/Model/Planet.php @@ -13,14 +13,37 @@ class Legacies_Empire_Model_Planet const TYPE_DEBRIS = 2; const TYPE_MOON = 3; - protected $_eventPrefix = 'planet.'; + protected $_eventPrefix = 'planet'; + protected $_eventObject = 'planet'; + /** + * @var Legacies_Empire_Model_User + */ protected $_user = null; + + /** + * @var Legacies_Empire_Model_Planet + */ protected $_moon = null; + /** + * @var Legacies_Empire_Model_Planet_Builder + */ protected $_builder = null; + + /** + * @var Legacies_Empire_Model_Planet_Building_Shipyard + */ protected $_shipyard = null; + /** + * @var Legacies_Empire_Model_Planet_Building_Laboratory + */ + protected $_laboratory = null; + + /** + * @var array + */ protected static $_instances = array(); protected static $_productionInstances = array(); @@ -45,15 +68,13 @@ class Legacies_Empire_Model_Planet { $this->_tableName = 'planets'; $this->_idFieldName = 'id'; - - $this->_builder = new Legacies_Empire_Model_Planet_Builder($this, $this->getUser()); } public function _afterLoad() { parent::_afterLoad(); - $this->_builder->init(); + $this->getBuildingQueue()->init(); return $this; } @@ -68,6 +89,24 @@ class Legacies_Empire_Model_Planet return $this->setData('last_update', $time); } + public function getBuildingFields() + { + return $this->getData('field_max'); + } + + public function getUsedFields() + { + return $this->getData('field_current'); + } + + public function getGalaxyData() + { + $entity = new Legacies_Empire_Model_Galaxy_Position(); + $entity->load(array('id_planet' => $this->getId())); + + return $entity; + } + public function updateStorages($time = null) { Math::setPrecision(50); @@ -77,7 +116,8 @@ class Legacies_Empire_Model_Planet continue; } - $officerEnhancement = (.5 * $this->getUser()->getData('rpg_stockeur')) + 1; + //$officerEnhancement = (.5 * $this->getUser()->getData('rpg_stockeur')) + 1; + $officerEnhancement = 1; $storageEnhancementFactor = Math::floor(Math::pow(1.6, $this[Legacies_Empire::getFieldName($resourceData['storage'])])); $storageEnhancement = Math::mul(BASE_STORAGE_SIZE / 2, $storageEnhancementFactor); @@ -137,7 +177,7 @@ class Legacies_Empire_Model_Planet $productionRatios = array(); foreach ($resources->getAllDatas() as $resource => $resourceData) { foreach ($resourceData['production'] as $productionUnit => $ratioField) { - if (!in_array($productionUnit, $types['prod'])) { + if (!$types->is($productionUnit, Legacies_Empire::TYPE_PRODUCTION)) { continue; } @@ -147,7 +187,6 @@ class Legacies_Empire_Model_Planet $productionRatios[$productionUnit] = $element->getProductionRatios($level, $ratio, $this, $this->getUser()); foreach ($productionRatios[$productionUnit] as $resourceId => $resourceProduction) { - $comp = Math::comp($resourceProduction, 0); if ($comp < 0) { if (!isset($resourcesConsumers[$resourceId])) { @@ -189,7 +228,7 @@ class Legacies_Empire_Model_Planet */ $actualProduction = $resourcesTotals; foreach ($resourcesTotals as $resource => $total) { - if (Math::isPositiveOrZero($total, 0)) { + if (Math::isPositiveOrZero($total)) { continue; } @@ -212,10 +251,28 @@ class Legacies_Empire_Model_Planet } } + // Dispatch 'planet.update-production.before' event + Legacies::dispatchEvent($this->_eventPrefix . '.update-production.before', array( + $this->_eventObject => $this, + 'user' => $this->getUser(), + 'productions' => $actualProduction + )); + foreach ($actualProduction as $resource => $production) { - $this->setData($resources[$resource]['production_field'], $production); + if ($resources[$resource]['storage_field']) { + $this->setData($resources[$resource]['production_field'], $production); + } else if (isset($resourcesProductionTotals[$resource])) { + $this->setData($resources[$resource]['field'], $production); + $this->setData($resources[$resource]['production_field'], $resourcesProductionTotals[$resource]); + } } + // Dispatch 'planet.update-production.after' event + Legacies::dispatchEvent($this->_eventPrefix . '.update-production.after', array( + $this->_eventObject => $this, + 'user' => $this->getUser() + )); + return $this; } @@ -229,6 +286,10 @@ class Legacies_Empire_Model_Planet $timeDiff = ($time - $this->getLastUpdate()) / 3600; foreach ($resources->getAllDatas() as $resourceId => $resourceConfig) { + if (!$resourceConfig['storage_field']) { + continue; + } + $production = Math::mul($this->getData($resourceConfig['production_field']), $timeDiff); $resourceValue = Math::add($this->getData($resourceConfig['field']), $production); $this->setData($resourceConfig['field'], Math::min($resourceValue, $this->getData($resourceConfig['storage_field']))); @@ -297,10 +358,15 @@ class Legacies_Empire_Model_Planet return $collection; } + public function getUserId() + { + return (int) $this->getData('id_owner'); + } + public function getUser() { - if ($this->_user === null) { - $this->_user = Legacies_Empire_Model_User::factory($this->getData('id_owner')); + if ($this->_user === null && $this->getUserId()) { + $this->_user = Legacies_Empire_Model_User::factory($this->getUserId()); } return $this->_user; } @@ -327,6 +393,21 @@ class Legacies_Empire_Model_Planet return $this; } + public function getLaboratory() + { + if ($this->_laboratory === null) { + $this->_laboratory = new Legacies_Empire_Model_Planet_Building_Laboratory($this, $this->getUser()); + } + return $this->_laboratory; + } + + public function setLaboratory(Legacies_Empire_Model_Planet_Building_Laboratory $laboratory) + { + $this->_laboratory = $laboratory; + + return $this; + } + public function isPlanet() { return (bool) ($this->getData('planet_type') == self::TYPE_PLANET); @@ -407,6 +488,33 @@ class Legacies_Empire_Model_Planet return (int) $this->getData('planet'); } + public function getCoords() + { + return sprintf('%d:%d:%d', $this->getGalaxy(), $this->getSystem(), $this->getPosition()); + } + + public function getName() + { + return $this->getData('name'); + } + + public function setName($name) + { + $this->setData('name', $name); + + return $this; + } + + public function getImage() + { + return 'graphics/planeten/' . $this->getData('image') . '.jpg'; + } + + public function getSmallImage() + { + return 'graphics/planeten/small/s_' . $this->getData('image') . '.jpg'; + } + public function setType($type) { $this->setData('planet_type', $type); @@ -419,6 +527,50 @@ class Legacies_Empire_Model_Planet return (int) $this->getData('planet_type'); } + public function isDestroyed() + { + return (bool) $this->getData('destruyed'); + } + + public function destroy() + { + if ($this->isDebris()) { + return $this; + } + + if ($this->isDestroyed()) { + throw new Legacies_Empire_Model_Planet_Exception(Legacies::__('Planet is already destroyed.')); + } + + if ($this->getFleetCollection()->count() > 0) { + throw new Legacies_Empire_Model_Planet_Exception(Legacies::__("Could not delete planet until fleets aten't retuned.")); + } + + $user = $this->getUser(); + if ($user->getHomePlanet()->getId() == $this->getId()) { + throw new Legacies_Empire_Model_Planet_Exception(Legacies::__("You can't destroy your home planet.")); + } + + if ($user->getCurrentPlanet()->getId() == $this->getId()) { + $homePlanet = $user->getHomePlanet(); + + if ($homePlanet !== null) { + $user->updateCurrentPlanet($homePlanet); + } + } + + if ($this->isPlanet() && ($moon = $this->getMoon())) { + $moon->destroy(); + } + + $this + ->setData('destruyed', true) + ->setData('id_owner', 0) + ->save(); + + return $this; + } + public function getElement($elementId) { $fields = Legacies_Empire_Model_Game_FieldsAlias::getSingleton(); @@ -458,12 +610,12 @@ class Legacies_Empire_Model_Planet } // Dispatch 'planet.building.append-queue.before' event - Legacies::dispatchEvent($this->_eventPrefix . 'building.append-queue.before', array( - 'bulding_id' => $buildingId, - 'level' => $this->getElement($buildingId), - 'planet' => $this, - 'user' => $this->getUser(), - 'destroy' => $destroy + Legacies::dispatchEvent($this->_eventPrefix . '.building.append-queue.before', array( + 'bulding_id' => $buildingId, + 'level' => $this->getElement($buildingId), + $this->_eventObject => $this, + 'user' => $this->getUser(), + 'destroy' => $destroy )); if ($destroy === false) { @@ -472,15 +624,15 @@ class Legacies_Empire_Model_Planet $level = max($this->getElement($buildingId) - 1, 0); } - $this->_builder->appendQueue($buildingId, $level, $time); + $this->getBuildingQueue()->appendQueue($buildingId, $level, $time); // Dispatch 'planet.shipyard.append-queue.after' event - Legacies::dispatchEvent($this->_eventPrefix . 'building.append-queue.after', array( - 'bulding_id' => $buildingId, - 'level' => $this->getElement($buildingId), - 'planet' => $this, - 'user' => $this->getUser(), - 'destroy' => $destroy + Legacies::dispatchEvent($this->_eventPrefix . '.building.append-queue.after', array( + 'bulding_id' => $buildingId, + 'level' => $this->getElement($buildingId), + $this->_eventObject => $this, + 'user' => $this->getUser(), + 'destroy' => $destroy )); return $this; @@ -493,30 +645,52 @@ class Legacies_Empire_Model_Planet } // Dispatch event - Legacies::dispatchEvent($this->_eventPrefix . 'update-queue.before', array( - 'time' => &$time, - 'planet' => $this->_currentPlanet, - 'user' => $this->_currentUser + Legacies::dispatchEvent($this->_eventPrefix . '.update-queue.before', array( + 'time' => &$time, + $this->_eventObject => $this->_currentPlanet, + 'user' => $this->_currentUser )); - $this->_builder->updateQueue($time); + $this->getBuildingQueue()->updateQueue($time); // Dispatch event - Legacies::dispatchEvent($this->_eventPrefix . 'update-queue.after', array( - 'time' => $time, - 'shipyard' => $this, - 'planet' => $this->_currentPlanet, - 'user' => $this->_currentUser + Legacies::dispatchEvent($this->_eventPrefix . '.update-queue.after', array( + 'time' => $time, + 'shipyard' => $this, + $this->_eventObject => $this->_currentPlanet, + 'user' => $this->_currentUser )); return $this; } + /** + * + * @return Legacies_Empire_Model_Planet_Builder + */ public function getBuildingQueue() { + if ($this->_builder === null) { + $this->_builder = new Legacies_Empire_Model_Planet_Builder($this, $this->getUser()); + } return $this->_builder; } + /** + * + * Enter description here ... + * @return Legacies_Empire_Model_Planet + */ + public function dequeueBuilding() + { + $this->getBuildingQueue()->rewind(); + $item = $this->getBuildingQueue()->current(); + + $this->getBuildingQueue()->dequeueFirstItem(Legacies::now()); + + return $this; + } + /** * Check if a building is actually buildable on the current planet, * depending on the technology and buildings requirements. @@ -526,15 +700,15 @@ class Legacies_Empire_Model_Planet */ public function checkAvailability($buildingId) { - $this->_builder->checkAvailability($buildingId); + $this->getBuildingQueue()->checkAvailability($buildingId); try { // Dispatch event. Throw an exception to break the avaliability. - Legacies::dispatchEvent($this->_eventPrefix . 'check-availability', array( - 'ship_id' => $buildingId, - 'shipyard' => $this, - 'planet' => $this->_currentPlanet, - 'user' => $this->_currentUser + Legacies::dispatchEvent($this->_eventPrefix . '.check-availability', array( + 'ship_id' => $buildingId, + 'shipyard' => $this, + $this->_eventObject => $this->_currentPlanet, + 'user' => $this->_currentUser )); } catch (Exception $e) { return false; @@ -551,7 +725,7 @@ class Legacies_Empire_Model_Planet */ public function getResourcesNeeded($buildingId, $level) { - return $this->_builder->getResourcesNeeded($buildingId, $level); + return $this->getBuildingQueue()->getResourcesNeeded($buildingId, $level); } /** @@ -562,7 +736,7 @@ class Legacies_Empire_Model_Planet */ public function getBuildingTime($buildingId, $level) { - return $this->_builder->getBuildingTime($buildingId, $level); + return $this->getBuildingQueue()->getBuildingTime($buildingId, $level); } public static function registrationListener($eventData) @@ -683,4 +857,38 @@ class Legacies_Empire_Model_Planet $planet->setLastUpdate($time); } } + + public function getResourceAmount($resourceType) + { + $resources = Legacies_Empire_Model_Game_Resources::getSingleton(); + + $resourceConfig = $resources->getData($resourceType); + if ($resourceConfig === null) { + return null; + } + return $this->getData($resourceConfig['field']); + } + + public function getResourceCap($resourceType) + { + $resources = Legacies_Empire_Model_Game_Resources::getSingleton(); + + $resourceConfig = $resources->getData($resourceType); + if ($resourceConfig === null) { + return null; + } + + if ($resourceConfig['storage_field'] === null) { + return $this->getData($resourceConfig['production_field']); + } + return $this->getData($resourceConfig['storage_field']); + } + + public function isResourceCapped($resourceType) + { + if (Math::comp($this->getResourceAmount($resourceType), $this->getResourceCap($resourceType)) >= 0) { + return true; + } + return false; + } } \ No newline at end of file diff --git a/includes/application/code/community/Legacies/Empire/Model/Planet/Builder.php b/includes/application/code/core/Legacies/Empire/Model/Planet/Builder.php similarity index 89% rename from includes/application/code/community/Legacies/Empire/Model/Planet/Builder.php rename to includes/application/code/core/Legacies/Empire/Model/Planet/Builder.php index 3de55aa..8b24112 100644 --- a/includes/application/code/community/Legacies/Empire/Model/Planet/Builder.php +++ b/includes/application/code/core/Legacies/Empire/Model/Planet/Builder.php @@ -19,7 +19,7 @@ class Legacies_Empire_Model_Planet_Builder $level = func_get_arg(1); $time = func_get_arg(2); - return new Legacies_Empire_Model_Planet_Building_Shipyard_Item(array( + return new Legacies_Empire_Model_Planet_Builder_Item(array( 'building_id' => $buildingId, 'level' => $level, 'created_at' => $time, @@ -166,4 +166,27 @@ class Legacies_Empire_Model_Planet_Builder return $this; } + + /** + * Append items to build to the construction list + * + * @param int $buildingId + * @param int|string $level + * @return Legacies_Empire_Model_Planet_Building_Shipyard + */ + public function dequeueFirstItem($time) + { + $types = Legacies_Empire_Model_Game_Types::getSingleton(); + $resources = Legacies_Empire_Model_Game_Resources::getSingleton(); + + if (!Math::isPositive($level)) { + return $this; + } + + // FIXME + + $this->_currentPlanet->setData('b_building_id', $this->serialize()); + + return $this; + } } \ No newline at end of file diff --git a/includes/application/code/core/Legacies/Empire/Model/Planet/Builder/Item.php b/includes/application/code/core/Legacies/Empire/Model/Planet/Builder/Item.php new file mode 100644 index 0000000..8f52b5f --- /dev/null +++ b/includes/application/code/core/Legacies/Empire/Model/Planet/Builder/Item.php @@ -0,0 +1,6 @@ +getElement(Legacies_Empire::ID_RESEARCH_COMBUSTION_DRIVE)); + } +} \ No newline at end of file diff --git a/includes/application/code/community/Legacies/Empire/Model/Planet/Ship/LightTransport.php b/includes/application/code/core/Legacies/Empire/Model/Planet/Ship/LightTransport.php similarity index 95% rename from includes/application/code/community/Legacies/Empire/Model/Planet/Ship/LightTransport.php rename to includes/application/code/core/Legacies/Empire/Model/Planet/Ship/LightTransport.php index f1baf5a..8ec8aaa 100644 --- a/includes/application/code/community/Legacies/Empire/Model/Planet/Ship/LightTransport.php +++ b/includes/application/code/core/Legacies/Empire/Model/Planet/Ship/LightTransport.php @@ -1,7 +1,7 @@ getElement(Legacies_Empire::ID_RESEARCH_COMBUSTION_DRIVE)); + } + + public function getActualSpeed(Legacies_Empire_Model_User $user) + { + return $this->getBaseSpeed($user) * $this->getSpeedMultiplier($user); + } + + public function getActualConsumption(Legacies_Empire_Model_User $user, $speed) + { + return $this->getBaseConsumption($user) * ($speed / 100) * $this->getSpeedMultiplier($user); + } +} \ No newline at end of file diff --git a/includes/application/code/core/Legacies/Empire/Model/Planet/ShipInterface.php b/includes/application/code/core/Legacies/Empire/Model/Planet/ShipInterface.php new file mode 100644 index 0000000..250c808 --- /dev/null +++ b/includes/application/code/core/Legacies/Empire/Model/Planet/ShipInterface.php @@ -0,0 +1,11 @@ +setIdFieldName('id'); @@ -118,23 +132,29 @@ class Legacies_Empire_Model_User public static function login($username, $password, $remember = false) { - static $statement = null; - $session = Legacies::getSession(self::SESSION_KEY); - $collection = new Legacies_Core_Collection(array('user' => 'users')); - $collection - ->column('user.id') - ->column('user.username') - ->column('user.banaday') - ->column('(CASE WHEN MD5(:password)=user.password THEN 1 ELSE 0 END) AS login_success') - ->column('CONCAT((@salt:=MID(MD5(RAND()), 0, 4)), SHA1(CONCAT(user.username, user.password, @salt))) AS login_rememberme') - ->where('user.username=:username') - ->load(array( - 'username' => $username, - 'password' => $password - )) - ; + try { + $collection = new Legacies_Core_Collection(array('user' => 'users')); + + $passwordHash = md5($password); + $collection + ->column('user.id') + ->column('user.username') + ->column('user.password') + ->column('user.banaday') + ->column('CONCAT((@salt:=MID(MD5(RAND()), 0, 4)), SHA1(CONCAT(user.username, user.password, @salt))) AS login_rememberme') + ->column('(CASE WHEN user.password="' . $passwordHash . '" THEN 1 ELSE 0 END) AS login_success') + ->where('user.username=:username') + ->load(array( + 'username' => $username + )) + ; + } catch (Legacies_Core_Model_Exception $e) { + Legacies_Core_ErrorProfiler::getSingleton()->exceptionManager($e); + $session->addError('No such user.'); + return null; + } if ($collection->count() <= 0) { $session->addError('No such user.'); @@ -197,33 +217,97 @@ class Legacies_Empire_Model_User return $user; } - public function updateCurrentPlanet($planetId) + /** + * + * Enter description here ... + * @param int|Legacies_Empire_Model_Planet $planet + */ + public function updateCurrentPlanet($planet) { - $planetColelction = $this->_preparePlanetCollection()->where('id=:id'); + if (!$planetId instanceof Legacies_Empire_Model_Planet) { + $planetColelction = $this->_preparePlanetCollection()->where('id=:id'); - $planetCollection->load(array( - 'id' => $planetId, - 'user' => $this->getId() - )); + $planetCollection->load(array( + 'id' => $planet, + 'user' => $this->getId() + )); - if ($planetCollection->count() !== 1) { - return false; + if ($planetCollection->count() !== 1) { + return $this; + } + + $planet = $planetCollection->current(); } - $planet = $planetCollection->current(); - $this->setData('current_planet', $planet->getId()); + if ($planet->getUserId() != $this->getId() || $planet->isDestroyed()) { + return $this; + } - return true; + $this->setData('current_planet', $planet->getId())->save(); + + return $this; } + /** + * + * Enter description here ... + * @param Legacies_Empire_Model_Planet $planet + */ + public function setCurrentPlanet(Legacies_Empire_Model_Planet $planet) + { + if ($planet->getUserId() != $this->getId() || $planet->isDestroyed()) { + return $this; + } + + $this->setData('current_planet', $planet->getId()); + + return $this; + } + + /** + * + * Enter description here ... + * @return Legacies_Empire_Model_Planet + */ + public function getHomePlanet() + { + $planetId = $this->getData('id_planet'); + if (!$planetId) { + return null; + } + + $planet = Legacies_Empire_Model_Planet::factory($planetId); + + if ($planet->getUserId() != $this->getId() || $planet->isDestroyed()) { + return null; + } + + return $planet; + } + + /** + * + * Enter description here ... + * @return Legacies_Empire_Model_Planet + */ public function getCurrentPlanet() { $planetId = $this->getData('current_planet'); + if (!$planetId) { - $planetId = $this->getData('id_planet'); - $this->setData('current_planet', $planetId)->save(); + $planet = $this->getHomePlanet(); + $this->setData('current_planet', $planet->getId())->save(); + + return $planet; } - return Legacies_Empire_Model_Planet::factory($planetId); + + $planet = Legacies_Empire_Model_Planet::factory($planetId); + + if ($planet->getUserId() != $this->getId() || $planet->isDestroyed()) { + return null; + } + + return $planet; } protected function _preparePlanetCollection() @@ -345,4 +429,59 @@ class Legacies_Empire_Model_User return $this; } + + public function checkPassword($password) + { + if (self::hash($password) == $this->getData('password')) { + return true; + } + return false; + } + + public function getFleetCollection($time = null) + { + $firstCollection = new Legacies_Core_Collection(array('fleet' => 'fleets')); + $firstCollection + ->column('*') + ->where('fleet.fleet_owner = :user') + ; + $backCollection = new Legacies_Core_Collection(array('fleet' => 'fleets')); + $backCollection + ->column('*') + ->where('fleet.fleet_target_owner = :user') + ; + + $options = array( + 'user' => $this->getId() + ); + + if ($time !== null) { + $options['now'] = $time; + $firstCollection->where('fleet_start_time <= :now'); + $backCollection->where('fleet_end_time <= :now'); + } + + $collection = new Legacies_Core_Collection(); + $collection + ->setEntityClassName('Legacies_Empire_Model_Fleet') + ->union($firstCollection) + ->union($backCollection) + ->load($options) + ; + + return $collection; + } + + public function getNewMessagesCount() + { + $messageCollection = new Legacies_Core_Collection('messages'); + $messageCollection->where('message_owner=:user'); + $messageCollection->where('message_read_at<=0'); + + $newMessages = null; + if (($count = $messageCollection->getSize(array('user' => $this->getId()))) > 0) { + return $count; + } + return null; + } } \ No newline at end of file diff --git a/includes/application/code/core/Legacies/Empire/Model/User/Message.php b/includes/application/code/core/Legacies/Empire/Model/User/Message.php new file mode 100644 index 0000000..89cc8b8 --- /dev/null +++ b/includes/application/code/core/Legacies/Empire/Model/User/Message.php @@ -0,0 +1,11 @@ +_tableName = 'messages'; + $this->_idFieldNames = array('message_id', 'message_owner'); + } +} \ No newline at end of file diff --git a/includes/application/code/community/Legacies/Exception.php b/includes/application/code/core/Legacies/Exception.php similarity index 100% rename from includes/application/code/community/Legacies/Exception.php rename to includes/application/code/core/Legacies/Exception.php diff --git a/includes/application/code/community/Legacies/Object.php b/includes/application/code/core/Legacies/Object.php similarity index 80% rename from includes/application/code/community/Legacies/Object.php rename to includes/application/code/core/Legacies/Object.php index ff5712c..16d47c1 100644 --- a/includes/application/code/community/Legacies/Object.php +++ b/includes/application/code/core/Legacies/Object.php @@ -79,24 +79,4 @@ class Legacies_Object { return $this->unsetData($offset); } - - public function __set($key, $value) - { - return $this->setData($key, $value); - } - - public function __get($key) - { - return $this->getData($key); - } - - public function __unset($key) - { - return $this->unsetData($key); - } - - public function __isset($key) - { - return $this->hasData($key); - } } \ No newline at end of file diff --git a/includes/application/code/core/Legacies/Officers/Model/Observer.php b/includes/application/code/core/Legacies/Officers/Model/Observer.php new file mode 100644 index 0000000..0bb5d6b --- /dev/null +++ b/includes/application/code/core/Legacies/Officers/Model/Observer.php @@ -0,0 +1,37 @@ +getUser(); + + $level = floor(sqrt($user->getData('xpminier') / 500)); + if ($user->getData('lvl_minier') < $level) { + $difference = $level - $user->getData('lvl_minier'); + if ($difference == 1) { + Legacies::getSession(Legacies_Empire_Model_User::SESSION_KEY) + ->addInfo('You gained 1 miner level.'); + } else { + Legacies::getSession(Legacies_Empire_Model_User::SESSION_KEY) + ->addInfo('You gained %1$d miner level.', (int) $difference); + } + } + + $level = floor(sqrt($user->getData('xpraid'))); + if ($user->getData('lvl_raid') < $level) { + $difference = $level - $user->getData('lvl_raid'); + if ($difference == 1) { + Legacies::getSession(Legacies_Empire_Model_User::SESSION_KEY) + ->addInfo('You gained 1 raider level.'); + } else { + Legacies::getSession(Legacies_Empire_Model_User::SESSION_KEY) + ->addInfo('You gained %1$d raider level.', (int) $difference); + } + } + } + } +} \ No newline at end of file diff --git a/includes/application/code/community/Math.php b/includes/application/code/libraries/Math.php similarity index 97% rename from includes/application/code/community/Math.php rename to includes/application/code/libraries/Math.php index d099d9a..bd77353 100644 --- a/includes/application/code/community/Math.php +++ b/includes/application/code/libraries/Math.php @@ -18,7 +18,7 @@ class Math public static function getSingleton() { if (self::$_singleton === null) { - if (extension_loaded('bcmath')) { + if (extension_loaded('bcmath') && defined('BCNUMBERS')) { self::$_singleton = new Math_Bcmath(); } else { self::$_singleton = new Math_Native(); diff --git a/includes/application/code/community/Math/Bcmath.php b/includes/application/code/libraries/Math/Bcmath.php similarity index 94% rename from includes/application/code/community/Math/Bcmath.php rename to includes/application/code/libraries/Math/Bcmath.php index 8730bfd..edd505a 100644 --- a/includes/application/code/community/Math/Bcmath.php +++ b/includes/application/code/libraries/Math/Bcmath.php @@ -83,9 +83,12 @@ class Math_Bcmath if (!$a) { return '0'; } + $a = strval($a); - $pos = strrpos(strval($a), '.'); - $a = substr(strval($a), 0, $pos); + $pos = strrpos($a, '.'); + if ($pos !== false) { + $a = substr($a, 0, $pos); + } $length = $pos + ((3 - ($pos % 3)) % 3); $a = str_pad($a, $length, ' ', STR_PAD_LEFT); diff --git a/includes/application/code/community/Math/Native.php b/includes/application/code/libraries/Math/Native.php similarity index 84% rename from includes/application/code/community/Math/Native.php rename to includes/application/code/libraries/Math/Native.php index da30722..80e9c96 100644 --- a/includes/application/code/community/Math/Native.php +++ b/includes/application/code/libraries/Math/Native.php @@ -38,7 +38,7 @@ class Math_Native public function comp($a, $b) { - return ($a > $b) ? 1 : ($a < $b) ? -1 : 0; + return ($a > $b) ? 1 : (($a < $b) ? -1 : 0); } public function ceil($x) @@ -56,8 +56,8 @@ class Math_Native return round($x, $range); } - public function render($a, $b) + public function render($a) { - return strval(number_format($a, 0, ',', '.')); + return number_format($a, 0, ',', '.'); } } \ No newline at end of file diff --git a/includes/application/code/local/.placeholder b/includes/application/code/local/.placeholder new file mode 100644 index 0000000..e69de29 diff --git a/includes/application/design/layouts/empire.php b/includes/application/design/layouts/empire.php new file mode 100644 index 0000000..e7f8f71 --- /dev/null +++ b/includes/application/design/layouts/empire.php @@ -0,0 +1,46 @@ + array( + 'update' => '1column', + 'reference' => array( + 'content' => array( + 'children' => array( + 'overview.forms' => array( + 'type' => 'core/concat' + ), + 'overview' => array( + 'type' => 'empire/overview', + 'template' => 'empire/overview.phtml' + ), + ) + ) + ) + ), + + 'overview.rename-planet' => array( + 'update' => 'overview', + 'reference' => array( + 'overview.forms' => array( + 'children' => array( + 'rename-planet' => array( + 'type' => 'empire/overview.rename-planet', + 'template' => 'empire/overview/form/rename-planet.phtml' + ), + ) + ) + ) + ), + + 'overview.destroy-planet' => array( + 'update' => 'overview', + 'reference' => array( + 'overview.forms' => array( + 'children' => array( + 'destroy-planet' => array( + 'type' => 'empire/overview.destroy-planet', + 'template' => 'empire/overview/form/destroy-planet.phtml' + ), + ) + ) + ) + ) + ); diff --git a/includes/application/design/layouts/page.php b/includes/application/design/layouts/page.php new file mode 100644 index 0000000..40349cc --- /dev/null +++ b/includes/application/design/layouts/page.php @@ -0,0 +1,120 @@ + array( + 'update' => 'default' + ), + + '2columns-left' => array( + 'update' => 'default', + 'template' => 'page/2columns-left.phtml', + 'reference' => array( + 'root' => array( + 'children' => array( + 'left' => array( + 'type' => 'core/concat' + ), + ) + ) + ) + ), + + '2columns-right' => array( + 'update' => 'default', + 'template' => 'page/2columns-right.phtml', + 'reference' => array( + 'root' => array( + 'children' => array( + 'right' => array( + 'type' => 'core/concat' + ), + ) + ) + ) + ), + + '3columns' => array( + 'update' => 'default', + 'template' => 'page/3columns.phtml', + 'reference' => array( + 'root' => array( + 'children' => array( + 'left' => array( + 'type' => 'core/concat' + ), + 'right' => array( + 'type' => 'core/concat' + ), + ) + ) + ) + ), + + 'default' => array( + 'type' => 'core/html.page', + 'template' => 'page/1column.phtml', + 'children' => array( + 'head' => array( + 'type' => 'core/html.head', + 'template' => 'page/html/head.phtml', + 'actions' => array( + array( + 'method' => 'addCss', + 'params' => array( + 'stylesheet' => 'css/default.css' + ) + ), + array( + 'method' => 'addCss', + 'params' => array( + 'stylesheet' => 'css/formate.css' + ) + ) + ) + ), + 'header' => array( + 'type' => 'core/template', + 'template' => 'page/html/header.phtml', + 'children' => array( + 'menu' => array( + 'type' => 'core/html.navigation', + 'template' => 'page/html/navigation.phtml', + ), + 'planet-list' => array( + 'type' => 'empire/planet-list', + 'template' => 'empire/planet-list.phtml', + ) + ) + ), + 'footer' => array( + 'type' => 'core/template', + 'template' => 'page/html/footer.phtml' + ), + 'content' => array( + 'type' => 'core/concat' + ) + ) + ), + + 'ajax' => array( + 'type' => 'core/html.page', + 'template' => 'page/empty.phtml', + 'children' => array( + 'content' => array( + 'type' => 'core/concat' + ) + ) + ), + + 'empty' => array( + 'type' => 'core/html.page', + 'template' => 'page/empty.phtml', + 'children' => array( + 'head' => array( + 'type' => 'core/html.head', + 'template' => 'page/html/head.phtml' + ), + 'content' => array( + 'type' => 'core/concat' + ) + ) + ), + ); diff --git a/includes/application/design/scripts/empire/overview.phtml b/includes/application/design/scripts/empire/overview.phtml new file mode 100644 index 0000000..b3d9bbc --- /dev/null +++ b/includes/application/design/scripts/empire/overview.phtml @@ -0,0 +1 @@ + +
+ + + + + + +
+ \ No newline at end of file diff --git a/includes/application/design/scripts/empire/overview/form/rename-planet.phtml b/includes/application/design/scripts/empire/overview/form/rename-planet.phtml new file mode 100644 index 0000000..45ba7da --- /dev/null +++ b/includes/application/design/scripts/empire/overview/form/rename-planet.phtml @@ -0,0 +1,10 @@ +
+
+ + + + + + +
+
\ No newline at end of file diff --git a/includes/application/design/scripts/empire/overview/messages.phtml b/includes/application/design/scripts/empire/overview/messages.phtml new file mode 100644 index 0000000..3a5a543 --- /dev/null +++ b/includes/application/design/scripts/empire/overview/messages.phtml @@ -0,0 +1,11 @@ + 0):?> + + + + __('You have 1 unread message.')?> + + __('You have %1$d unread messages.', $this['count'])?> + + + + \ No newline at end of file diff --git a/includes/application/design/scripts/empire/overview/planet/list/item.phtml b/includes/application/design/scripts/empire/overview/planet/list/item.phtml new file mode 100644 index 0000000..7d778ea --- /dev/null +++ b/includes/application/design/scripts/empire/overview/planet/list/item.phtml @@ -0,0 +1,10 @@ + +

escape($this['planet']->getData('name'))?>

+

+ +

+ count() > 0):?> +

escape($this['queue_item']->getData('building_id'))?>

+ +

__('Idle.')?>

+ \ No newline at end of file diff --git a/includes/application/design/scripts/empire/overview/planet/view.phtml b/includes/application/design/scripts/empire/overview/planet/view.phtml new file mode 100644 index 0000000..8230a16 --- /dev/null +++ b/includes/application/design/scripts/empire/overview/planet/view.phtml @@ -0,0 +1 @@ +planetList->render() ?> diff --git a/includes/application/design/scripts/empire/topnav.phtml b/includes/application/design/scripts/empire/topnav.phtml new file mode 100644 index 0000000..3bd8d91 --- /dev/null +++ b/includes/application/design/scripts/empire/topnav.phtml @@ -0,0 +1,77 @@ +
+ + + + + + + +
+
+ + + + + + + +
+ +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
__('Metal')?>__('Cristal')?>__('Deuterium')?>__('Energy')?>__('Messages')?>
+ getCurrentPlanet()->isResourceCapped(Legacies_Empire::RESOURCE_METAL)):?> + renderNumber($this->getCurrentPlanet()->getResourceAmount(Legacies_Empire::RESOURCE_METAL))?> + + renderNumber($this->getCurrentPlanet()->getResourceAmount(Legacies_Empire::RESOURCE_METAL))?> + + + getCurrentPlanet()->isResourceCapped(Legacies_Empire::RESOURCE_CRISTAL)):?> + renderNumber($this->getCurrentPlanet()->getResourceAmount(Legacies_Empire::RESOURCE_CRISTAL))?> + + renderNumber($this->getCurrentPlanet()->getResourceAmount(Legacies_Empire::RESOURCE_CRISTAL))?> + + + getCurrentPlanet()->isResourceCapped(Legacies_Empire::RESOURCE_DEUTERIUM)):?> + renderNumber($this->getCurrentPlanet()->getResourceAmount(Legacies_Empire::RESOURCE_DEUTERIUM))?> + + renderNumber($this->getCurrentPlanet()->getResourceAmount(Legacies_Empire::RESOURCE_DEUTERIUM))?> + + + getCurrentPlanet()->isResourceCapped(Legacies_Empire::RESOURCE_ENERGY)):?> + renderNumber($this->getCurrentPlanet()->getResourceAmount(Legacies_Empire::RESOURCE_ENERGY))?> / renderNumber($this->getCurrentPlanet()->getResourceCap(Legacies_Empire::RESOURCE_ENERGY))?> + + renderNumber($this->getCurrentPlanet()->getResourceAmount(Legacies_Empire::RESOURCE_ENERGY))?> / renderNumber($this->getCurrentPlanet()->getResourceCap(Legacies_Empire::RESOURCE_ENERGY))?> + + getCurrentUser()->getNewMessagesCount()?>
+
+
diff --git a/includes/application/design/scripts/page/1column.phtml b/includes/application/design/scripts/page/1column.phtml new file mode 100644 index 0000000..dcae32f --- /dev/null +++ b/includes/application/design/scripts/page/1column.phtml @@ -0,0 +1,15 @@ + + + head->render()?> + + getBodyClasses()):?> class="escape($classes)?>"> +
+
+ topnav)):?> + topnav->render()?> + + content->render()?> +
+
+ + diff --git a/includes/application/design/scripts/page/2columns-left.phtml b/includes/application/design/scripts/page/2columns-left.phtml new file mode 100644 index 0000000..75c296d --- /dev/null +++ b/includes/application/design/scripts/page/2columns-left.phtml @@ -0,0 +1,18 @@ + + + head->render()?> + + getBodyClasses()):?> class="escape($classes)?>"> +
+
+ left->render()?> +
+
+ topnav)):?> + topnav->render()?> + + content->render()?> +
+
+ + diff --git a/includes/application/design/scripts/page/2columns-right.phtml b/includes/application/design/scripts/page/2columns-right.phtml new file mode 100644 index 0000000..eec29ab --- /dev/null +++ b/includes/application/design/scripts/page/2columns-right.phtml @@ -0,0 +1,18 @@ + + + head->render()?> + + getBodyClasses()):?> class="escape($classes)?>"> +
+
+ topnav)):?> + topnav->render()?> + + content->render()?> +
+
+ left->render()?> +
+
+ + diff --git a/includes/application/design/scripts/page/3columns.phtml b/includes/application/design/scripts/page/3columns.phtml new file mode 100644 index 0000000..34fca7d --- /dev/null +++ b/includes/application/design/scripts/page/3columns.phtml @@ -0,0 +1,21 @@ + + + head->render()?> + + getBodyClasses()):?> class="escape($classes)?>"> +
+
+ left->render()?> +
+
+ topnav)):?> + topnav->render()?> + + content->render()?> +
+
+ left->render()?> +
+
+ + diff --git a/includes/application/design/scripts/page/html/head.phtml b/includes/application/design/scripts/page/html/head.phtml new file mode 100644 index 0000000..7933554 --- /dev/null +++ b/includes/application/design/scripts/page/html/head.phtml @@ -0,0 +1,26 @@ +XNova:Legacies + +getCss() as $css):?> + + +getInlineCss() as $css):?> + + + +getJs() as $js):?> + + +getSkinJs() as $js):?> + + +getInlineJs() as $js):?> + + \ No newline at end of file diff --git a/includes/application/locale/fr_FR/Legacies_User.csv b/includes/application/locale/fr_FR/Legacies_User.csv index 3441058..5543a04 100644 --- a/includes/application/locale/fr_FR/Legacies_User.csv +++ b/includes/application/locale/fr_FR/Legacies_User.csv @@ -1,4 +1,6 @@ "Your session has expired, please login.","Votre session a expiré, veuillez vous identifier de nouveau." "Your username or credential is invalid, please check your input.","Your username or credential is invalid, please check your input." "No such user.","No such user." -"You were banned, please contact admin for more information.","You were banned, please contact admin for more information." \ No newline at end of file +"You were banned, please contact admin for more information.","You were banned, please contact admin for more information." +"You have 1 unread message.","Vous avez un message non lu." +"You have %1$d unread messages.","Vous avez %1$d messages non lus." \ No newline at end of file diff --git a/includes/application/test/UpdatePlanet.php b/includes/application/test/UpdatePlanet.php index 995fbb6..3e1815e 100644 --- a/includes/application/test/UpdatePlanet.php +++ b/includes/application/test/UpdatePlanet.php @@ -87,12 +87,24 @@ $data = array( $planet = new Legacies_Empire_Model_Planet($data); $planet->setUser($user); +var_dump(array('$planet->setUser($user)', array_diff($planet->getAllDatas(), $data))); +$data = $planet->getAllDatas(); $planet->updateStorages(0); +var_dump(array('$planet->updateStorages(0)', array_diff($planet->getAllDatas(), $data))); +$data = $planet->getAllDatas(); + $planet->updateResourceProduction(0); +var_dump(array('$planet->updateResourceProduction(0)', array_diff($planet->getAllDatas(), $data))); +$data = $planet->getAllDatas(); $planet->getShipyard()->appendQueue(Legacies_Empire::ID_SHIP_LIGHT_FIGHTER, 10, 0); +var_dump(array('$planet->getShipyard()->appendQueue(Legacies_Empire::ID_SHIP_LIGHT_FIGHTER, 10, 0)', array_diff($planet->getAllDatas(), $data))); +$data = $planet->getAllDatas(); + $planet->appendBuildingQueue(Legacies_Empire::ID_BUILDING_CRISTAL_MINE, false, 0); +var_dump(array('$planet->appendBuildingQueue(Legacies_Empire::ID_BUILDING_CRISTAL_MINE, false, 0)', array_diff($planet->getAllDatas(), $data))); +$data = $planet->getAllDatas(); var_dump(array_diff($planet->getAllDatas(), $data)); $data = $planet->getAllDatas(); diff --git a/includes/application/test/bootstrap.php b/includes/application/test/bootstrap.php index 9e013d7..4171bf9 100644 --- a/includes/application/test/bootstrap.php +++ b/includes/application/test/bootstrap.php @@ -1,5 +1,7 @@ getElement(Legacies_Empire::ID_BUILDING_TERRAFORMER) * 5)); +} + + +/** + * + * @deprecated + * @param Legacies_Empire_Model_User|array $currentUser + * @param Legacies_Empire_Model_Planet|array $currentPlanet + */ +function AbandonColony($currentUser, $currentPlanet) +{ + defined('DEPRECATION') || trigger_error(sprintf('%s is deprecated', __FUNCTION__), E_USER_DEPRECATED); + + if (!$currentPlanet instanceof Legacies_Empire_Model_Planet) { + trigger_error('$currentPlanet should be an instance of Legacies_Empire_Model_Planet', E_USER_WARNING); + $currentPlanet = Legacies_Empire_Model_Planet::factory($currentPlanet['id']); + } + + try { + $currentPlanet->destroy(); + } catch (Legacies_Core_Model_Exception $e) { + Legacies_Core_Model_Session::factory('empire')->addCritical($e->getMessage()); + } catch (Legacies_Empire_Model_Planet_Exception $e) { + Legacies_Core_Model_Session::factory('empire')->addError($e->getMessage()); + } +} + +/** + * + * @deprecated + * @param Legacies_Empire_Model_Planet|array $currentPlanet + */ +function CheckFleets($currentPlanet) +{ + defined('DEPRECATION') || trigger_error(sprintf('%s is deprecated', __FUNCTION__), E_USER_DEPRECATED); + + if (!$currentPlanet instanceof Legacies_Empire_Model_Planet) { + trigger_error('$currentPlanet should be an instance of Legacies_Empire_Model_Planet', E_USER_WARNING); + $currentPlanet = Legacies_Empire_Model_Planet::factory($currentPlanet['id']); + } + + return (bool) ($currentPlanet->getFleetCollection()->count() > 0); +} + +/** + * + * @deprecated + * @param Legacies_Empire_Model_User|array $currentUser + * @param Legacies_Empire_Model_Planet|array $currentPlanet + */ +function CancelBuildingFromQueue($currentPlanet, $currentUser) +{ + defined('DEPRECATION') || trigger_error(sprintf('%s is deprecated', __FUNCTION__), E_USER_DEPRECATED); + + if (!$currentPlanet instanceof Legacies_Empire_Model_Planet) { + trigger_error('$currentPlanet should be an instance of Legacies_Empire_Model_Planet', E_USER_WARNING); + $currentPlanet = Legacies_Empire_Model_Planet::factory($currentPlanet['id']); + } + + if ($currentPlanet->getBuildingQueue()->count() <= 0) { + return false; + } + + $currentPlanet->dequeueBuilding(); + + return true; +} + +/** + * + * @deprecated + * @param string $page The page content + * @param string $title The page title + * @param bool $topnav Wether we show the top navigation or not + * @param null $metatags Extra meta tags + * @param bool $AdminPage unused + */ +function display($page, $title = '', $topnav = true, $metatags = '', $AdminPage = false) +{ + defined('DEPRECATION') || trigger_error(sprintf('%s is deprecated', __FUNCTION__), E_USER_DEPRECATED); + + // TODO: implement extra meta tags + $layout = new Legacies_Core_Layout(); + $layout->load('1column'); + $content = $layout->getBlock('content'); + + if ($topnav) { + $topnav = $layout->createBlock('empire/topnav', 'topnav'); + $topnav->setTemplate('empire/topnav.phtml'); + $content->topnav = $topnav; + } + + $pageContent = $layout->createBlock('core/text', 'content'); + $pageContent->setContent($page); + $content->page = $pageContent; + + echo $layout->render(); + exit(0); } \ No newline at end of file diff --git a/includes/functions.php b/includes/functions.php index 367a6f7..294c61f 100644 --- a/includes/functions.php +++ b/includes/functions.php @@ -84,90 +84,3 @@ function message($mes, $title = 'Error', $dest = "", $time = "3", $color = 'oran display ($page, $title, false, (($dest != "") ? "" : ""), true); } - -// ---------------------------------------------------------------------------------------------------------------- -// -// Routine d'affichage d'une page dans un cadre donn� -// -// $page -> la page -// $title -> le titre de la page -// $topnav -> Affichage des ressources ? oui ou non ?? -// $metatags -> S'il y a quelques actions particulieres a faire ... -// $AdminPage -> Si on est dans la section admin ... faut le dire ... -function display ($page, $title = '', $topnav = true, $metatags = '', $AdminPage = false) { - global $link, $gameConfig, $debug, $user, $planetrow; - - if (!$AdminPage) { - $DisplayPage = StdUserHeader ($title, $metatags); - } else { - $DisplayPage = AdminUserHeader ($title, $metatags); - } - - if ($topnav) { - $DisplayPage .= ShowTopNavigationBar( $user, $planetrow ); - } - $DisplayPage .= "
\n". $page ."\n
\n"; - // Affichage du Debug si necessaire - if (isset($user['authlevel']) && in_array($user['authlevel'], array(LEVEL_ADMIN, LEVEL_OPERATOR))) { - if ($gameConfig['debug'] == 1) $debug->echo_log(); - } - - $DisplayPage .= StdFooter(); - if (isset($link)) { - mysql_close($link); - } - - echo $DisplayPage; - - die(); -} - -// ---------------------------------------------------------------------------------------------------------------- -// -// Entete de page -// -function StdUserHeader ($title = '', $metatags = '') { - global $user, $langInfos; - - $parse = $langInfos; - $parse['title'] = $title; - if ( defined('LOGIN') ) { - $parse['dpath'] = "skins/xnova/"; - $parse['-style-'] = "\n"; - $parse['-style-'] .= "\n"; - } else { - $parse['dpath'] = DEFAULT_SKINPATH; - $parse['-style-'] = ""; - $parse['-style-'] .= ""; - } - - $parse['-meta-'] = ($metatags) ? $metatags : ""; - $parse['-body-'] = ""; // class=\"style\" topmargin=\"0\" leftmargin=\"0\" marginwidth=\"0\" marginheight=\"0\">"; - return parsetemplate(gettemplate('simple_header'), $parse); -} - -// ---------------------------------------------------------------------------------------------------------------- -// -// Entete de page administration -// -function AdminUserHeader ($title = '', $metatags = '') { - global $user, $dpath, $langInfos; - - $parse = $langInfos; - $parse['dpath'] = $dpath; - $parse['title'] = $title; - $parse['-meta-'] = ($metatags) ? $metatags : ""; - $parse['-body-'] = ""; // class=\"style\" topmargin=\"0\" leftmargin=\"0\" marginwidth=\"0\" marginheight=\"0\">"; - return parsetemplate(gettemplate('admin/simple_header'), $parse); -} - -// ---------------------------------------------------------------------------------------------------------------- -// -// Pied de page -// -function StdFooter() { - global $gameConfig, $lang; - $parse['copyright'] = isset($gameConfig['copyright']) ? $gameConfig['copyright'] : 'XNova Support Team'; - $parse['TranslationBy'] = isset($lang['TranslationBy']) ? $lang['TranslationBy'] : ''; - return parsetemplate(gettemplate('overall_footer'), $parse); -} diff --git a/includes/functions/AbandonColony.php b/includes/functions/AbandonColony.php deleted file mode 100644 index 8f95eac..0000000 --- a/includes/functions/AbandonColony.php +++ /dev/null @@ -1,123 +0,0 @@ - - * All rights reserved. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - * --> NOTICE <-- - * This file is part of the core development branch, changing its contents will - * make you unable to use the automatic updates manager. Please refer to the - * documentation for further information about customizing XNova. - * - */ - -/** - * - * @deprecated - * @param unknown_type $user - * @param unknown_type $planetrow - */ -function AbandonColony($user,$planetrow) { - trigger_error(sprintf('%s is deprecated', __FUNCTION__), E_USER_DEPRECATED); - $destruyed = time() + 3600; //Temps avant la suppression dans la galaxie - $DeleteMoon = false; - if ($planetrow["planet_type"]==1){ - //Selectionne si il y a une lune sur la colonie a supprim�e - $QryWithMoon = "SELECT * FROM {{table}} "; - $QryWithMoon .= "WHERE "; - $QryWithMoon .= "`destruyed` = '0' AND "; - $QryWithMoon .= "`galaxy` = '". $planetrow['galaxy'] ."' AND "; - $QryWithMoon .= "`system` = '". $planetrow['system'] ."' AND "; - $QryWithMoon .= "`lunapos` = '". $planetrow['planet'] ."' AND "; - $QryWithMoon .= "`id_owner` = '". $user['id'] ."' ;"; - $IsMoon = doquery( $QryWithMoon , 'lunas',true); - if($IsMoon){ - //Envoi la demande de suppression de la lune associ� a la colonie - $DeleteMoon = true; // borrar luna - } - - //Mise en mode destruction d ela colonie - $QryUpdatePlanet = "UPDATE {{table}} SET "; - $QryUpdatePlanet .= "`destruyed` = '" . $destruyed . "', "; - $QryUpdatePlanet .= "`id_owner` = '0' "; - $QryUpdatePlanet .= "WHERE "; - $QryUpdatePlanet .= "`id` = '" . $user['current_planet'] . "' LIMIT 1;"; - doquery($QryUpdatePlanet , 'planets'); - - //Si on veut supprimer une lune - }elseif($planetrow["planet_type"]==3){ - $DeleteMoon = true; //borrar luna - } - - if ($DeleteMoon){ - $QryDeleteMoon = "DELETE FROM {{table}} "; - $QryDeleteMoon .= "WHERE "; - $QryDeleteMoon .= "`galaxy` = '". $planetrow['galaxy'] ."' AND "; - $QryDeleteMoon .= "`system` = '". $planetrow['system'] ."' AND "; - $QryDeleteMoon .= "`planet` = '". $planetrow['planet'] ."' AND "; - $QryDeleteMoon .= "`planet_type` = '3' AND "; - $QryDeleteMoon .= "`id_owner` = '". $user['id'] ."' ;"; - doquery($QryDeleteMoon , 'planets'); - - $Qrydestructionlune = "DELETE FROM {{table}} "; - $Qrydestructionlune .= "WHERE "; - $Qrydestructionlune .= "`galaxy` = '". $planetrow['galaxy'] ."' AND "; - $Qrydestructionlune .= "`system` = '". $planetrow['system'] ."' AND "; - $Qrydestructionlune .= "`lunapos` = '". $planetrow['planet'] ."' AND "; - $Qrydestructionlune .= "`id_owner` = '". $user['id'] ."' ;"; - doquery( $Qrydestructionlune , 'lunas'); - - $Qrydestructionlune2 = "UPDATE {{table}} SET "; - $Qrydestructionlune2 .= "`id_luna` = '0' "; - $Qrydestructionlune2 .= "WHERE "; - $Qrydestructionlune2 .= "`galaxy` = '". $planetrow['galaxy'] ."' AND "; - $Qrydestructionlune2 .= "`system` = '". $planetrow['system'] ."' AND "; - $Qrydestructionlune2 .= "`planet` = '". $planetrow['planet'] ."' ;"; - doquery( $Qrydestructionlune2 , 'galaxy'); - - } - - } - - function CheckFleets($planetrow){ - - $QryFleet = "SELECT * FROM {{table}} WHERE "; - $QryFleet .= "(`fleet_start_galaxy` = '".$planetrow["galaxy"]."' AND "; - $QryFleet .= "`fleet_start_system` = '".$planetrow["system"]."' AND "; - $QryFleet .= "`fleet_start_planet` = '".$planetrow["planet"]."'"; - if ($planetrow["planet_type"]==3){ - $QryFleet .= " AND `fleet_start_type` = '3'"; - } - $QryFleet .= ") OR "; - $QryFleet .= "(`fleet_end_galaxy` = '".$planetrow["galaxy"]."' AND "; - $QryFleet .= "`fleet_end_system` = '".$planetrow["system"]."' AND "; - $QryFleet .= "`fleet_end_planet` = '".$planetrow["planet"]."'"; - if ($planetrow["planet_type"]==3){ - $QryFleet .= " AND `fleet_end_type` = '3'"; - } - $QryFleet .= " AND `fleet_mess` <> 1 ); "; - $fleets = doquery($QryFleet, 'fleets',true); - if($fleets){ - return true; - } - return false; - } - - ?> \ No newline at end of file diff --git a/includes/functions/BBcodeFunction.php b/includes/functions/BBcodeFunction.php index 4e69866..957f65d 100644 --- a/includes/functions/BBcodeFunction.php +++ b/includes/functions/BBcodeFunction.php @@ -34,7 +34,6 @@ * @param unknown_type $string */ function bbcode($string) { - trigger_error(sprintf('%s is deprecated', __FUNCTION__), E_USER_DEPRECATED); $pattern = array( '/\\n/', '/\\r/', @@ -78,7 +77,6 @@ function bbcode($string) { function image($string) { - trigger_error(sprintf('%s is deprecated', __FUNCTION__), E_USER_DEPRECATED); //On va pas se casser le fion a lire les accents quand meme !!!!!!! $string = str_replace("'", "'", $string); @@ -101,14 +99,12 @@ function image($string) function sCode($string){ - trigger_error(sprintf('%s is deprecated', __FUNCTION__), E_USER_DEPRECATED); $pattern = '/\\\\"(.*?)\\\"/s'; $string = preg_replace($pattern, '\3', $string); return '
' . trim($string) . '
'; } function sList($string) { - trigger_error(sprintf('%s is deprecated', __FUNCTION__), E_USER_DEPRECATED); $tmp = explode('[*]', stripslashes($string)); $out = null; foreach($tmp as $list) { @@ -120,7 +116,6 @@ function sList($string) { } function imagefix($img) { - trigger_error(sprintf('%s is deprecated', __FUNCTION__), E_USER_DEPRECATED); if(substr($img, 0, 7) != 'http://') { $img = './images/' . $img; } @@ -128,7 +123,6 @@ function imagefix($img) { } function urlfix($url, $title) { - trigger_error(sprintf('%s is deprecated', __FUNCTION__), E_USER_DEPRECATED); $title = stripslashes($title); return '' . $title . ''; } diff --git a/includes/functions/BatimentBuildingPage.php b/includes/functions/BatimentBuildingPage.php index 00dabc0..b46cdce 100644 --- a/includes/functions/BatimentBuildingPage.php +++ b/includes/functions/BatimentBuildingPage.php @@ -34,11 +34,9 @@ * @param unknown_type $CurrentPlanet * @param unknown_type $CurrentUser */ -function BatimentBuildingPage (&$CurrentPlanet, $CurrentUser) { - trigger_error(sprintf('%s is deprecated', __FUNCTION__), E_USER_DEPRECATED); - global $lang, $resource, $reslist, $dpath, $gameConfig, $_GET; - - CheckPlanetUsedFields ( $CurrentPlanet ); +function BatimentBuildingPage($CurrentPlanet, $CurrentUser) +{ + global $lang, $resource, $reslist, $dpath, $gameConfig; // Tables des batiments possibles par type de planete $Allowed['1'] = array( 1, 2, 3, 4, 12, 14, 15, 21, 22, 23, 24, 31, 33, 34, 44); @@ -100,15 +98,8 @@ function BatimentBuildingPage (&$CurrentPlanet, $CurrentUser) { } } - SetNextQueueElementOnTop ( $CurrentPlanet, $CurrentUser ); - $Queue = ShowBuildingQueue ( $CurrentPlanet, $CurrentUser ); - // On enregistre ce que l'on a modifi� dans planet ! - BuildingSavePlanetRecord ( $CurrentPlanet ); - // On enregistre ce que l'on a eventuellement modifi� dans users - BuildingSaveUserRecord ( $CurrentUser ); - if ($Queue['lenght'] < MAX_BUILDING_QUEUE_SIZE) { $CanBuildElement = true; } else { @@ -206,4 +197,3 @@ function BatimentBuildingPage (&$CurrentPlanet, $CurrentUser) { display($page, $lang['Builds']); } -?> diff --git a/includes/functions/BuildFleetEventTable.php b/includes/functions/BuildFleetEventTable.php index 544c056..9d633d1 100644 --- a/includes/functions/BuildFleetEventTable.php +++ b/includes/functions/BuildFleetEventTable.php @@ -38,7 +38,6 @@ * @param unknown_type $Record */ function BuildFleetEventTable ( $FleetRow, $Status, $Owner, $Label, $Record ) { - trigger_error(sprintf('%s is deprecated', __FUNCTION__), E_USER_DEPRECATED); global $lang; $FleetStyle = array ( diff --git a/includes/functions/BuildFlyingFleetTable.php b/includes/functions/BuildFlyingFleetTable.php index 4958283..5ce94a7 100644 --- a/includes/functions/BuildFlyingFleetTable.php +++ b/includes/functions/BuildFlyingFleetTable.php @@ -33,7 +33,6 @@ * @deprecated */ function BuildFlyingFleetTable () { - trigger_error(sprintf('%s is deprecated', __FUNCTION__), E_USER_DEPRECATED); global $lang; $TableTPL = gettemplate('admin/fleet_rows'); diff --git a/includes/functions/CancelBuildingFromQueue.php b/includes/functions/CancelBuildingFromQueue.php deleted file mode 100644 index 9895357..0000000 --- a/includes/functions/CancelBuildingFromQueue.php +++ /dev/null @@ -1,115 +0,0 @@ - - * All rights reserved. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - * --> NOTICE <-- - * This file is part of the core development branch, changing its contents will - * make you unable to use the automatic updates manager. Please refer to the - * documentation for further information about customizing XNova. - * - */ - -/** - * - * @deprecated - * @param unknown_type $CurrentPlanet - * @param unknown_type $CurrentUser - */ -function CancelBuildingFromQueue ( &$CurrentPlanet, &$CurrentUser ) { - trigger_error(sprintf('%s is deprecated', __FUNCTION__), E_USER_DEPRECATED); - - $CurrentQueue = $CurrentPlanet['b_building_id']; - if ($CurrentQueue != 0) { - // Creation du tableau de la liste de construction - $QueueArray = explode ( ";", $CurrentQueue ); - // Comptage du nombre d'elements dans la liste - $ActualCount = count ( $QueueArray ); - - // Stockage de l'element a 'interrompre' - $CanceledIDArray = explode ( ",", $QueueArray[0] ); - $Element = $CanceledIDArray[0]; - $BuildMode = $CanceledIDArray[4]; // pour savoir si on construit ou detruit - - $nb_item = $Element; - - if ($ActualCount > 1) { - array_shift( $QueueArray ); - $NewCount = count( $QueueArray ); - // Mise a jour de l'heure de fin de construction theorique du batiment - $BuildEndTime = time(); - - for ($ID = 0; $ID < $NewCount ; $ID++ ) { - $ListIDArray = explode ( ",", $QueueArray[$ID] ); - - // Pour diminuer le niveau et le temps de construction - // si le bâtiment qui est annulé se trouve plusieurs fois dans la queue - // Exemple de queue de construction : - // Mine de métal (Niveau 40) | Silo de missile (Niveau 30) | Silo de missiles (Niveau 31) | Mine de métal (Niveau 41) - - // Si on supprime le premier bâtiment, on aura dans la queue de construction : - // Silo de missile (Niveau 30) | Silo de missiles (Niveau 31) | Mine de métal (Niveau 40) - if ( $nb_item == $ListIDArray[0]) - { - $ListIDArray[1] -= 1; - $ListIDArray[2] = GetBuildingTimeLevel($CurrentUser, $CurrentPlanet, $ListIDArray[0], $ListIDArray[1]); - } - $BuildEndTime += $ListIDArray[2]; - $ListIDArray[3] = $BuildEndTime; - $QueueArray[$ID] = implode ( ",", $ListIDArray ); - } - $NewQueue = implode(";", $QueueArray ); - $ReturnValue = true; - $BuildEndTime = '0'; - } else { - $NewQueue = '0'; - $ReturnValue = false; - $BuildEndTime = '0'; - } - - // Ici on va rembourser les ressources engagées ... - // Deja le mode (car quand on detruit ca ne coute que la moitié du prix de construction classique - if ($BuildMode == 'destroy') { - $ForDestroy = true; - } else { - $ForDestroy = false; - } - - if ( $Element != false ) { - $Needed = GetBuildingPrice ($CurrentUser, $CurrentPlanet, $Element, true, $ForDestroy); - $CurrentPlanet['metal'] += $Needed['metal']; - $CurrentPlanet['crystal'] += $Needed['crystal']; - $CurrentPlanet['deuterium'] += $Needed['deuterium']; - } - - } else { - $NewQueue = '0'; - $BuildEndTime = '0'; - $ReturnValue = false; - } - - $CurrentPlanet['b_building_id'] = $NewQueue; - $CurrentPlanet['b_building'] = $BuildEndTime; - - return $ReturnValue; -} - -?> \ No newline at end of file diff --git a/includes/functions/CheckInputStrings.php b/includes/functions/CheckInputStrings.php index 7124aad..eedf3e1 100644 --- a/includes/functions/CheckInputStrings.php +++ b/includes/functions/CheckInputStrings.php @@ -35,7 +35,5 @@ */ function CheckInputStrings($string) { - trigger_error(sprintf('%s is deprecated', __FUNCTION__), E_USER_DEPRECATED); - return htmlspecialchars($string, ENT_QUOTES, 'UTF-8'); } \ No newline at end of file diff --git a/includes/functions/CheckLabSettingsInQueue.php b/includes/functions/CheckLabSettingsInQueue.php index ca11750..1626279 100644 --- a/includes/functions/CheckLabSettingsInQueue.php +++ b/includes/functions/CheckLabSettingsInQueue.php @@ -34,7 +34,6 @@ * @param unknown_type $CurrentPlanet */ function CheckLabSettingsInQueue ( $CurrentPlanet ) { - trigger_error(sprintf('%s is deprecated', __FUNCTION__), E_USER_DEPRECATED); global $lang, $gameConfig; if ($CurrentPlanet['b_building_id'] != "0") { diff --git a/includes/functions/ChekUser.php b/includes/functions/ChekUser.php deleted file mode 100644 index 9f354b7..0000000 --- a/includes/functions/ChekUser.php +++ /dev/null @@ -1,63 +0,0 @@ - - * All rights reserved. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - * --> NOTICE <-- - * This file is part of the core development branch, changing its contents will - * make you unable to use the automatic updates manager. Please refer to the - * documentation for further information about customizing XNova. - * - */ - -/** - * - * @deprecated - * @param unknown_type $IsUserChecked - */ -function CheckTheUser($IsUserChecked) -{ - trigger_error(sprintf('%s is deprecated', __FUNCTION__), E_USER_DEPRECATED); - global $user; - includeLang('admin'); - $Result = CheckCookies( $IsUserChecked ); - $IsUserChecked = $Result['state']; - - - if ($Result['record'] != false) { - $user = $Result['record']; - if ($user['bana'] == "1") { - die ( - - $page .= parsetemplate(gettemplate('usr_banned'), $lang) - - ); - } - $RetValue['record'] = $user; - $RetValue['state'] = $IsUserChecked; - } else { - $RetValue['record'] = array(); - $RetValue['state'] = false; - } - - return $RetValue; -} - diff --git a/includes/functions/CreateOneMoonRecord.php b/includes/functions/CreateOneMoonRecord.php index 9109efe..a014010 100644 --- a/includes/functions/CreateOneMoonRecord.php +++ b/includes/functions/CreateOneMoonRecord.php @@ -41,7 +41,6 @@ */ function CreateOneMoonRecord ( $Galaxy, $System, $Planet, $Owner, $MoonID, $MoonName, $Chance ) { global $lang; - trigger_error(sprintf('%s is deprecated', __FUNCTION__), E_USER_DEPRECATED); $PlanetName = ""; diff --git a/includes/functions/CreateOnePlanetRecord.php b/includes/functions/CreateOnePlanetRecord.php index f22bdfc..d7cef08 100644 --- a/includes/functions/CreateOnePlanetRecord.php +++ b/includes/functions/CreateOnePlanetRecord.php @@ -36,7 +36,6 @@ */ function PlanetSizeRandomiser ($Position, $HomeWorld = false) { global $gameConfig; - trigger_error(sprintf('%s is deprecated', __FUNCTION__), E_USER_DEPRECATED); if (!$HomeWorld) { $ClassicBase = 163; diff --git a/includes/functions/DefensesBuildingPage.php b/includes/functions/DefensesBuildingPage.php index 0ad5a34..1e23d06 100644 --- a/includes/functions/DefensesBuildingPage.php +++ b/includes/functions/DefensesBuildingPage.php @@ -36,7 +36,6 @@ */ function DefensesBuildingPage ( &$currentPlanet, $currentUser ) { global $lang, $resource, $dpath; - trigger_error(sprintf('%s is deprecated', __FUNCTION__), E_USER_DEPRECATED); // S'il n'y a pas de Chantier if (!isset($currentPlanet[$resource[Legacies_Empire::ID_BUILDING_SHIPYARD]]) || $currentPlanet[$resource[Legacies_Empire::ID_BUILDING_SHIPYARD]] == 0) { diff --git a/includes/functions/FleetBuildingPage.php b/includes/functions/FleetBuildingPage.php index 7547efd..99bc8ae 100644 --- a/includes/functions/FleetBuildingPage.php +++ b/includes/functions/FleetBuildingPage.php @@ -36,7 +36,6 @@ */ function FleetBuildingPage(&$currentPlanet, &$currentUser) { - trigger_error(sprintf('%s is deprecated', __FUNCTION__), E_USER_DEPRECATED); global $lang, $resource, $dpath; // S'il n'y a pas de Chantier diff --git a/includes/functions/FlyingFleetHandler.php b/includes/functions/FlyingFleetHandler.php index b050403..cc2b852 100644 --- a/includes/functions/FlyingFleetHandler.php +++ b/includes/functions/FlyingFleetHandler.php @@ -36,7 +36,6 @@ function FlyingFleetHandler($planet) { global $resource; - //trigger_error(sprintf('%s is deprecated', __FUNCTION__), E_USER_DEPRECATED); $sql =<<getFleetCollection(Legacies::now()) as $CurrentFleet) { - var_dump($CurrentFleet); switch ($CurrentFleet["fleet_mission"]) { case Legacies_Empire::ID_MISSION_ATTACK: // Attaquer diff --git a/includes/functions/GalaxyCheckFunctions.php b/includes/functions/GalaxyCheckFunctions.php index a61e815..d5c3d66 100644 --- a/includes/functions/GalaxyCheckFunctions.php +++ b/includes/functions/GalaxyCheckFunctions.php @@ -34,7 +34,6 @@ * @param unknown_type $lunarow */ function CheckAbandonMoonState ($lunarow) { - trigger_error(sprintf('%s is deprecated', __FUNCTION__), E_USER_DEPRECATED); if (($lunarow['destruyed'] + 172800) <= time() && $lunarow['destruyed'] != 0) { $query = doquery("DELETE FROM {{table}} WHERE id = '" . $lunarow['id'] . "'", "lunas"); } diff --git a/includes/functions/GalaxyLegendPopup.php b/includes/functions/GalaxyLegendPopup.php index bac5975..a397aa5 100644 --- a/includes/functions/GalaxyLegendPopup.php +++ b/includes/functions/GalaxyLegendPopup.php @@ -33,7 +33,6 @@ * @deprecated */ function GalaxyLegendPopup () { - trigger_error(sprintf('%s is deprecated', __FUNCTION__), E_USER_DEPRECATED); global $lang; $Result = ""; diff --git a/includes/functions/GalaxyRowAlly.php b/includes/functions/GalaxyRowAlly.php index 19d53f5..e9a17a6 100644 --- a/includes/functions/GalaxyRowAlly.php +++ b/includes/functions/GalaxyRowAlly.php @@ -40,7 +40,6 @@ * @param unknown_type $PlanetType */ function GalaxyRowAlly ( $GalaxyRow, $GalaxyRowPlanet, $GalaxyRowUser, $Galaxy, $System, $Planet, $PlanetType ) { - trigger_error(sprintf('%s is deprecated', __FUNCTION__), E_USER_DEPRECATED); global $lang, $user; // Alliances diff --git a/includes/functions/GalaxyRowDebris.php b/includes/functions/GalaxyRowDebris.php index 5958fcf..b31b0d2 100644 --- a/includes/functions/GalaxyRowDebris.php +++ b/includes/functions/GalaxyRowDebris.php @@ -40,7 +40,6 @@ * @param unknown_type $PlanetType */ function GalaxyRowDebris ( $GalaxyRow, $GalaxyRowPlanet, $GalaxyRowUser, $Galaxy, $System, $Planet, $PlanetType ) { - trigger_error(sprintf('%s is deprecated', __FUNCTION__), E_USER_DEPRECATED); global $lang, $dpath, $CurrentRC, $user, $pricelist; // Cdr $Result = ""; diff --git a/includes/functions/GalaxyRowMoon.php b/includes/functions/GalaxyRowMoon.php index 8831ab0..950b68d 100644 --- a/includes/functions/GalaxyRowMoon.php +++ b/includes/functions/GalaxyRowMoon.php @@ -40,7 +40,6 @@ * @param unknown_type $PlanetType */ function GalaxyRowMoon ( $GalaxyRow, $GalaxyRowPlanet, $GalaxyRowUser, $Galaxy, $System, $Planet, $PlanetType ) { - trigger_error(sprintf('%s is deprecated', __FUNCTION__), E_USER_DEPRECATED); global $lang, $user, $dpath, $HavePhalanx, $CurrentSystem, $CurrentGalaxy, $CanDestroy; // Lune diff --git a/includes/functions/GalaxyRowPlanet.php b/includes/functions/GalaxyRowPlanet.php index 5e941fa..65e1abf 100644 --- a/includes/functions/GalaxyRowPlanet.php +++ b/includes/functions/GalaxyRowPlanet.php @@ -40,7 +40,6 @@ * @param unknown_type $PlanetType */ function GalaxyRowPlanet ( $GalaxyRow, $GalaxyRowPlanet, $GalaxyRowUser, $Galaxy, $System, $Planet, $PlanetType ) { - trigger_error(sprintf('%s is deprecated', __FUNCTION__), E_USER_DEPRECATED); global $lang, $dpath, $user, $HavePhalanx, $CurrentSystem, $CurrentGalaxy; // Planete (Image) diff --git a/includes/functions/GalaxyRowPlanetName.php b/includes/functions/GalaxyRowPlanetName.php index ce49c2d..1db22f6 100644 --- a/includes/functions/GalaxyRowPlanetName.php +++ b/includes/functions/GalaxyRowPlanetName.php @@ -40,7 +40,6 @@ * @param unknown_type $PlanetType */ function GalaxyRowPlanetName ( $GalaxyRow, $GalaxyRowPlanet, $GalaxyRowUser, $Galaxy, $System, $Planet, $PlanetType ) { - trigger_error(sprintf('%s is deprecated', __FUNCTION__), E_USER_DEPRECATED); global $lang, $user, $HavePhalanx, $CurrentSystem, $CurrentGalaxy; // Planete (Nom) diff --git a/includes/functions/GalaxyRowPos.php b/includes/functions/GalaxyRowPos.php index 786442e..d111681 100644 --- a/includes/functions/GalaxyRowPos.php +++ b/includes/functions/GalaxyRowPos.php @@ -35,7 +35,6 @@ * @param unknown_type $GalaxyRow */ function GalaxyRowPos ( $Planet, $GalaxyRow ) { - trigger_error(sprintf('%s is deprecated', __FUNCTION__), E_USER_DEPRECATED); // Pos $Result = ""; $Result .= " 0) { $MissileRange = ($user[$resource[117]] * 5) - 1; diff --git a/includes/functions/GetPhalanxRange.php b/includes/functions/GetPhalanxRange.php index 5e6a1b9..1fbd16c 100644 --- a/includes/functions/GetPhalanxRange.php +++ b/includes/functions/GetPhalanxRange.php @@ -34,7 +34,6 @@ * @param unknown_type $PhalanxLevel */ function GetPhalanxRange ( $PhalanxLevel ) { - trigger_error(sprintf('%s is deprecated', __FUNCTION__), E_USER_DEPRECATED); // Niveau 1 2 3 4 5 6 7 = lvl // Portée ajouté 0 3 5 7 9 11 13 = (lvl * 2) - 1 // Phalanx en nbre de systemes 0 3 8 15 24 35 48 = diff --git a/includes/functions/InsertGalaxyScripts.php b/includes/functions/InsertGalaxyScripts.php index f0f52af..48109a1 100644 --- a/includes/functions/InsertGalaxyScripts.php +++ b/includes/functions/InsertGalaxyScripts.php @@ -34,7 +34,7 @@ */ function InsertGalaxyScripts ( $CurrentPlanet ) { global $lang; - trigger_error(sprintf('%s is deprecated', __FUNCTION__), E_USER_DEPRECATED); + $Script = "
"; $Script .= "\n"; - - $parse['building'] = $Build; - } else { - $parse['building'] = $lang['Free']; - } - } else { - $parse['building'] = $lang['Free']; - } - $query = doquery('SELECT username FROM {{table}} ORDER BY register_time DESC', 'users', true); - $parse['last_user'] = $query['username']; - $query = doquery("SELECT COUNT(DISTINCT(id)) FROM {{table}} WHERE onlinetime>" . (time()-900), 'users', true); - $parse['online_users'] = $query[0]; - // $count = doquery(","users",true); - $parse['users_amount'] = $gameConfig['users_amount']; - // Rajout d'une barre pourcentage - // Calcul du pourcentage de remplissage - $parse['case_pourcentage'] = floor($planetrow["field_current"] / (1 + CalculateMaxPlanetFields($planetrow)) * 100) . $lang['o/o']; - // Barre de remplissage - $parse['case_barre'] = floor($planetrow["field_current"] / CalculateMaxPlanetFields($planetrow) * 100) * 4.0; - // Couleur de la barre de remplissage - if ($parse['case_barre'] > (100 * 4.0)) { - $parse['case_barre'] = 400; - $parse['case_barre_barcolor'] = '#C00000'; - } elseif ($parse['case_barre'] > (80 * 4.0)) { - $parse['case_barre_barcolor'] = '#C0C000'; - } else { - $parse['case_barre_barcolor'] = '#00C000'; - } - // Mode Améliorations - $parse['xpminier'] = $user['xpminier']; - $parse['xpraid'] = $user['xpraid']; - $parse['lvl_minier'] = $user['lvl_minier']; - $parse['lvl_raid'] = $user['lvl_raid']; - - $LvlMinier = $user['lvl_minier']; - $LvlRaid = $user['lvl_raid']; - - $parse['lvl_up_minier'] = $LvlMinier * 5000; - $parse['lvl_up_raid'] = $LvlRaid * 10; - // Nombre de raids, pertes, etc ... - $parse['Raids'] = $lang['Raids']; - $parse['NumberOfRaids'] = $lang['NumberOfRaids']; - $parse['RaidsWin'] = $lang['RaidsWin']; - $parse['RaidsLoose'] = $lang['RaidsLoose']; - - $parse['raids'] = $user['raids']; - $parse['raidswin'] = $user['raidswin']; - $parse['raidsloose'] = $user['raidsloose']; - // Compteur de Membres en ligne - $OnlineUsers = doquery("SELECT COUNT(*) FROM {{table}} WHERE onlinetime>='" . (time()-15 * 60) . "'", 'users', 'true'); - $parse['NumberMembersOnline'] = $OnlineUsers[0]; - - $page = parsetemplate(gettemplate('overview_body'), $parse); - - display($page, $lang['Overview']); - break; + } else { + $parse['moon_img'] = ""; + $parse['moon'] = ""; } -} + // Moon END + $parse['planet_name'] = $planet['name']; + $parse['planet_diameter'] = Math::render($planet['diameter']); + $parse['planet_field_current'] = Math::render($planet->getUsedFields()); + $parse['planet_field_max'] = Math::render($planet->getBuildingFields()); + $parse['planet_temp_min'] = $planet['temp_min']; + $parse['planet_temp_max'] = $planet['temp_max']; + $parse['galaxy_galaxy'] = $planet['galaxy']; + $parse['galaxy_planet'] = $planet['planet']; + $parse['galaxy_system'] = $planet['system']; + $StatRecord = doquery("SELECT * FROM {{table}} WHERE `stat_type` = '1' AND `stat_code` = '1' AND `id_owner` = '" . $user['id'] . "';", 'statpoints', true); + $parse['user_points'] = Math::render($StatRecord['build_points']); + $parse['user_fleet'] = Math::render($StatRecord['fleet_points']); + $parse['player_points_tech'] = Math::render($StatRecord['tech_points']); + $parse['total_points'] = Math::render($StatRecord['total_points']);; + + $parse['user_rank'] = $StatRecord['total_rank']; + $ile = $StatRecord['total_old_rank'] - $StatRecord['total_rank']; + if ($ile >= 1) { + $parse['ile'] = "+" . $ile . ""; + } elseif ($ile < 0) { + $parse['ile'] = "-" . $ile . ""; + } elseif ($ile == 0) { + $parse['ile'] = "" . $ile . ""; + } + $parse['u_user_rank'] = $StatRecord['total_rank']; + $parse['user_username'] = $user['username']; + + $parse['fleet_list'] = $fleetList->render(); + $parse['energy_used'] = $planet["energy_max"] - $planet["energy_used"]; + + $parse['Have_new_message'] = $newMessages->render(); + $parse['time'] = "
"; + $parse['planet_image'] = $planet['image']; + $parse['anothers_planets'] = $planetBlock->render(); + $parse['max_users'] = $gameConfig['users_amount']; + + $galaxyData = $planet->getGalaxyData(); + $parse['metal_debris'] = Math::render($galaxyData['metal']); + $parse['crystal_debris'] = Math::render($galaxyData['crystal']); + if (($galaxyData['metal'] != 0 || $galaxyData['crystal'] != 0) && Math::isPositive($planet->getElement(Legacies_Empire::ID_SHIP_RECYCLER))) { + $parse['get_link'] = " (
" . $lang['type_mission'][Legacies_Empire::ID_MISSION_RECYCLE] . ")"; + } else { + $parse['get_link'] = ''; + } + + $query = doquery('SELECT username FROM {{table}} ORDER BY register_time DESC', 'users', true); + $parse['last_user'] = $query['username']; + $query = doquery("SELECT COUNT(DISTINCT(id)) FROM {{table}} WHERE onlinetime>" . (time()-900), 'users', true); + $parse['online_users'] = $query[0]; + // $count = doquery(","users",true); + $parse['users_amount'] = $gameConfig['users_amount']; + + // Rajout d'une barre pourcentage + // Calcul du pourcentage de remplissage + // Barre de remplissage + $size = Math::floor(Math::div($planet->getBuildingFields(), $planet->getUsedFields()) * 100); + // Couleur de la barre de remplissage + $parse['case_pourcentage'] = $size . $lang['o/o']; + if (Math::comp($size, 100) > 0) { + $size = 100; + $parse['case_barre_barcolor'] = '#C00000'; + } elseif (Math::comp($size, 80) > 0) { + $parse['case_barre_barcolor'] = '#C0C000'; + } else { + $parse['case_barre_barcolor'] = '#00C000'; + } + $parse['case_barre'] = $size; + + // Mode Améliorations + $parse['xpminier'] = $user['xpminier']; + $parse['xpraid'] = $user['xpraid']; + $parse['lvl_minier'] = $user['lvl_minier']; + $parse['lvl_raid'] = $user['lvl_raid']; + + $LvlMinier = $user['lvl_minier']; + $LvlRaid = $user['lvl_raid']; + + $parse['lvl_up_minier'] = $LvlMinier * 5000; + $parse['lvl_up_raid'] = $LvlRaid * 10; + // Nombre de raids, pertes, etc ... + $parse['Raids'] = $lang['Raids']; + $parse['NumberOfRaids'] = $lang['NumberOfRaids']; + $parse['RaidsWin'] = $lang['RaidsWin']; + $parse['RaidsLoose'] = $lang['RaidsLoose']; + + $parse['raids'] = $user['raids']; + $parse['raidswin'] = $user['raidswin']; + $parse['raidsloose'] = $user['raidsloose']; + // Compteur de Membres en ligne + $OnlineUsers = doquery("SELECT COUNT(*) FROM {{table}} WHERE onlinetime>='" . (time()-15 * 60) . "'", 'users', 'true'); + $parse['NumberMembersOnline'] = $OnlineUsers[0]; + + $page = parsetemplate(gettemplate('overview_body'), $parse); + + display($page); + /** + * }}} + */ + } +} \ No newline at end of file diff --git a/skins/xnova/default.css b/skin/default/css/default.css similarity index 100% rename from skins/xnova/default.css rename to skin/default/css/default.css diff --git a/skins/xnova/formate.css b/skin/default/css/formate.css similarity index 100% rename from skins/xnova/formate.css rename to skin/default/css/formate.css diff --git a/skins/xnova/gebaeude/1.gif b/skin/default/graphics/gebaeude/1.gif similarity index 100% rename from skins/xnova/gebaeude/1.gif rename to skin/default/graphics/gebaeude/1.gif diff --git a/skins/xnova/gebaeude/106.gif b/skin/default/graphics/gebaeude/106.gif similarity index 100% rename from skins/xnova/gebaeude/106.gif rename to skin/default/graphics/gebaeude/106.gif diff --git a/skins/xnova/gebaeude/108.gif b/skin/default/graphics/gebaeude/108.gif similarity index 100% rename from skins/xnova/gebaeude/108.gif rename to skin/default/graphics/gebaeude/108.gif diff --git a/skins/xnova/gebaeude/109.gif b/skin/default/graphics/gebaeude/109.gif similarity index 100% rename from skins/xnova/gebaeude/109.gif rename to skin/default/graphics/gebaeude/109.gif diff --git a/skins/xnova/gebaeude/110.gif b/skin/default/graphics/gebaeude/110.gif similarity index 100% rename from skins/xnova/gebaeude/110.gif rename to skin/default/graphics/gebaeude/110.gif diff --git a/skins/xnova/gebaeude/111.gif b/skin/default/graphics/gebaeude/111.gif similarity index 100% rename from skins/xnova/gebaeude/111.gif rename to skin/default/graphics/gebaeude/111.gif diff --git a/skins/xnova/gebaeude/113.gif b/skin/default/graphics/gebaeude/113.gif similarity index 100% rename from skins/xnova/gebaeude/113.gif rename to skin/default/graphics/gebaeude/113.gif diff --git a/skins/xnova/gebaeude/114.gif b/skin/default/graphics/gebaeude/114.gif similarity index 100% rename from skins/xnova/gebaeude/114.gif rename to skin/default/graphics/gebaeude/114.gif diff --git a/skins/xnova/gebaeude/115.gif b/skin/default/graphics/gebaeude/115.gif similarity index 100% rename from skins/xnova/gebaeude/115.gif rename to skin/default/graphics/gebaeude/115.gif diff --git a/skins/xnova/gebaeude/117.gif b/skin/default/graphics/gebaeude/117.gif similarity index 100% rename from skins/xnova/gebaeude/117.gif rename to skin/default/graphics/gebaeude/117.gif diff --git a/skins/xnova/gebaeude/118.gif b/skin/default/graphics/gebaeude/118.gif similarity index 100% rename from skins/xnova/gebaeude/118.gif rename to skin/default/graphics/gebaeude/118.gif diff --git a/skins/xnova/gebaeude/12.gif b/skin/default/graphics/gebaeude/12.gif similarity index 100% rename from skins/xnova/gebaeude/12.gif rename to skin/default/graphics/gebaeude/12.gif diff --git a/skins/xnova/gebaeude/120.gif b/skin/default/graphics/gebaeude/120.gif similarity index 100% rename from skins/xnova/gebaeude/120.gif rename to skin/default/graphics/gebaeude/120.gif diff --git a/skins/xnova/gebaeude/121.gif b/skin/default/graphics/gebaeude/121.gif similarity index 100% rename from skins/xnova/gebaeude/121.gif rename to skin/default/graphics/gebaeude/121.gif diff --git a/skins/xnova/gebaeude/122.gif b/skin/default/graphics/gebaeude/122.gif similarity index 100% rename from skins/xnova/gebaeude/122.gif rename to skin/default/graphics/gebaeude/122.gif diff --git a/skins/xnova/gebaeude/123.gif b/skin/default/graphics/gebaeude/123.gif similarity index 100% rename from skins/xnova/gebaeude/123.gif rename to skin/default/graphics/gebaeude/123.gif diff --git a/skins/xnova/gebaeude/124.gif b/skin/default/graphics/gebaeude/124.gif similarity index 100% rename from skins/xnova/gebaeude/124.gif rename to skin/default/graphics/gebaeude/124.gif diff --git a/skins/xnova/gebaeude/14.gif b/skin/default/graphics/gebaeude/14.gif similarity index 100% rename from skins/xnova/gebaeude/14.gif rename to skin/default/graphics/gebaeude/14.gif diff --git a/skins/xnova/gebaeude/15.gif b/skin/default/graphics/gebaeude/15.gif similarity index 100% rename from skins/xnova/gebaeude/15.gif rename to skin/default/graphics/gebaeude/15.gif diff --git a/skins/xnova/gebaeude/199.gif b/skin/default/graphics/gebaeude/199.gif similarity index 100% rename from skins/xnova/gebaeude/199.gif rename to skin/default/graphics/gebaeude/199.gif diff --git a/skins/xnova/gebaeude/2.gif b/skin/default/graphics/gebaeude/2.gif similarity index 100% rename from skins/xnova/gebaeude/2.gif rename to skin/default/graphics/gebaeude/2.gif diff --git a/skins/xnova/gebaeude/202.gif b/skin/default/graphics/gebaeude/202.gif similarity index 100% rename from skins/xnova/gebaeude/202.gif rename to skin/default/graphics/gebaeude/202.gif diff --git a/skins/xnova/gebaeude/203.gif b/skin/default/graphics/gebaeude/203.gif similarity index 100% rename from skins/xnova/gebaeude/203.gif rename to skin/default/graphics/gebaeude/203.gif diff --git a/skins/xnova/gebaeude/204.gif b/skin/default/graphics/gebaeude/204.gif similarity index 100% rename from skins/xnova/gebaeude/204.gif rename to skin/default/graphics/gebaeude/204.gif diff --git a/skins/xnova/gebaeude/205.gif b/skin/default/graphics/gebaeude/205.gif similarity index 100% rename from skins/xnova/gebaeude/205.gif rename to skin/default/graphics/gebaeude/205.gif diff --git a/skins/xnova/gebaeude/206.gif b/skin/default/graphics/gebaeude/206.gif similarity index 100% rename from skins/xnova/gebaeude/206.gif rename to skin/default/graphics/gebaeude/206.gif diff --git a/skins/xnova/gebaeude/206.jpg b/skin/default/graphics/gebaeude/206.jpg similarity index 100% rename from skins/xnova/gebaeude/206.jpg rename to skin/default/graphics/gebaeude/206.jpg diff --git a/skins/xnova/gebaeude/207.gif b/skin/default/graphics/gebaeude/207.gif similarity index 100% rename from skins/xnova/gebaeude/207.gif rename to skin/default/graphics/gebaeude/207.gif diff --git a/skins/xnova/gebaeude/208.gif b/skin/default/graphics/gebaeude/208.gif similarity index 100% rename from skins/xnova/gebaeude/208.gif rename to skin/default/graphics/gebaeude/208.gif diff --git a/skins/xnova/gebaeude/209.gif b/skin/default/graphics/gebaeude/209.gif similarity index 100% rename from skins/xnova/gebaeude/209.gif rename to skin/default/graphics/gebaeude/209.gif diff --git a/skins/xnova/gebaeude/21.gif b/skin/default/graphics/gebaeude/21.gif similarity index 100% rename from skins/xnova/gebaeude/21.gif rename to skin/default/graphics/gebaeude/21.gif diff --git a/skins/xnova/gebaeude/210.gif b/skin/default/graphics/gebaeude/210.gif similarity index 100% rename from skins/xnova/gebaeude/210.gif rename to skin/default/graphics/gebaeude/210.gif diff --git a/skins/xnova/gebaeude/211.gif b/skin/default/graphics/gebaeude/211.gif similarity index 100% rename from skins/xnova/gebaeude/211.gif rename to skin/default/graphics/gebaeude/211.gif diff --git a/skins/xnova/gebaeude/212.gif b/skin/default/graphics/gebaeude/212.gif similarity index 100% rename from skins/xnova/gebaeude/212.gif rename to skin/default/graphics/gebaeude/212.gif diff --git a/skins/xnova/gebaeude/213.gif b/skin/default/graphics/gebaeude/213.gif similarity index 100% rename from skins/xnova/gebaeude/213.gif rename to skin/default/graphics/gebaeude/213.gif diff --git a/skins/xnova/gebaeude/214.gif b/skin/default/graphics/gebaeude/214.gif similarity index 100% rename from skins/xnova/gebaeude/214.gif rename to skin/default/graphics/gebaeude/214.gif diff --git a/skins/xnova/gebaeude/215.gif b/skin/default/graphics/gebaeude/215.gif similarity index 100% rename from skins/xnova/gebaeude/215.gif rename to skin/default/graphics/gebaeude/215.gif diff --git a/skins/xnova/gebaeude/216.gif b/skin/default/graphics/gebaeude/216.gif similarity index 100% rename from skins/xnova/gebaeude/216.gif rename to skin/default/graphics/gebaeude/216.gif diff --git a/skins/xnova/gebaeude/21_a.gif b/skin/default/graphics/gebaeude/21_a.gif similarity index 100% rename from skins/xnova/gebaeude/21_a.gif rename to skin/default/graphics/gebaeude/21_a.gif diff --git a/skins/xnova/gebaeude/22.gif b/skin/default/graphics/gebaeude/22.gif similarity index 100% rename from skins/xnova/gebaeude/22.gif rename to skin/default/graphics/gebaeude/22.gif diff --git a/skins/xnova/gebaeude/23.gif b/skin/default/graphics/gebaeude/23.gif similarity index 100% rename from skins/xnova/gebaeude/23.gif rename to skin/default/graphics/gebaeude/23.gif diff --git a/skins/xnova/gebaeude/24.gif b/skin/default/graphics/gebaeude/24.gif similarity index 100% rename from skins/xnova/gebaeude/24.gif rename to skin/default/graphics/gebaeude/24.gif diff --git a/skins/xnova/gebaeude/3.gif b/skin/default/graphics/gebaeude/3.gif similarity index 100% rename from skins/xnova/gebaeude/3.gif rename to skin/default/graphics/gebaeude/3.gif diff --git a/skins/xnova/gebaeude/31.gif b/skin/default/graphics/gebaeude/31.gif similarity index 100% rename from skins/xnova/gebaeude/31.gif rename to skin/default/graphics/gebaeude/31.gif diff --git a/skins/xnova/gebaeude/33.gif b/skin/default/graphics/gebaeude/33.gif similarity index 100% rename from skins/xnova/gebaeude/33.gif rename to skin/default/graphics/gebaeude/33.gif diff --git a/skins/xnova/gebaeude/34.gif b/skin/default/graphics/gebaeude/34.gif similarity index 100% rename from skins/xnova/gebaeude/34.gif rename to skin/default/graphics/gebaeude/34.gif diff --git a/skins/xnova/gebaeude/4.gif b/skin/default/graphics/gebaeude/4.gif similarity index 100% rename from skins/xnova/gebaeude/4.gif rename to skin/default/graphics/gebaeude/4.gif diff --git a/skins/xnova/gebaeude/401.gif b/skin/default/graphics/gebaeude/401.gif similarity index 100% rename from skins/xnova/gebaeude/401.gif rename to skin/default/graphics/gebaeude/401.gif diff --git a/skins/xnova/gebaeude/402.gif b/skin/default/graphics/gebaeude/402.gif similarity index 100% rename from skins/xnova/gebaeude/402.gif rename to skin/default/graphics/gebaeude/402.gif diff --git a/skins/xnova/gebaeude/403.gif b/skin/default/graphics/gebaeude/403.gif similarity index 100% rename from skins/xnova/gebaeude/403.gif rename to skin/default/graphics/gebaeude/403.gif diff --git a/skins/xnova/gebaeude/404.gif b/skin/default/graphics/gebaeude/404.gif similarity index 100% rename from skins/xnova/gebaeude/404.gif rename to skin/default/graphics/gebaeude/404.gif diff --git a/skins/xnova/gebaeude/405.gif b/skin/default/graphics/gebaeude/405.gif similarity index 100% rename from skins/xnova/gebaeude/405.gif rename to skin/default/graphics/gebaeude/405.gif diff --git a/skins/xnova/gebaeude/406.gif b/skin/default/graphics/gebaeude/406.gif similarity index 100% rename from skins/xnova/gebaeude/406.gif rename to skin/default/graphics/gebaeude/406.gif diff --git a/skins/xnova/gebaeude/407.gif b/skin/default/graphics/gebaeude/407.gif similarity index 100% rename from skins/xnova/gebaeude/407.gif rename to skin/default/graphics/gebaeude/407.gif diff --git a/skins/xnova/gebaeude/408.gif b/skin/default/graphics/gebaeude/408.gif similarity index 100% rename from skins/xnova/gebaeude/408.gif rename to skin/default/graphics/gebaeude/408.gif diff --git a/skins/xnova/gebaeude/41.gif b/skin/default/graphics/gebaeude/41.gif similarity index 100% rename from skins/xnova/gebaeude/41.gif rename to skin/default/graphics/gebaeude/41.gif diff --git a/skins/xnova/gebaeude/42.gif b/skin/default/graphics/gebaeude/42.gif similarity index 100% rename from skins/xnova/gebaeude/42.gif rename to skin/default/graphics/gebaeude/42.gif diff --git a/skins/xnova/gebaeude/43.gif b/skin/default/graphics/gebaeude/43.gif similarity index 100% rename from skins/xnova/gebaeude/43.gif rename to skin/default/graphics/gebaeude/43.gif diff --git a/skins/xnova/gebaeude/44.gif b/skin/default/graphics/gebaeude/44.gif similarity index 100% rename from skins/xnova/gebaeude/44.gif rename to skin/default/graphics/gebaeude/44.gif diff --git a/skins/xnova/gebaeude/501.gif b/skin/default/graphics/gebaeude/501.gif similarity index 100% rename from skins/xnova/gebaeude/501.gif rename to skin/default/graphics/gebaeude/501.gif diff --git a/skins/xnova/gebaeude/502.gif b/skin/default/graphics/gebaeude/502.gif similarity index 100% rename from skins/xnova/gebaeude/502.gif rename to skin/default/graphics/gebaeude/502.gif diff --git a/skins/xnova/gebaeude/503.gif b/skin/default/graphics/gebaeude/503.gif similarity index 100% rename from skins/xnova/gebaeude/503.gif rename to skin/default/graphics/gebaeude/503.gif diff --git a/skins/xnova/gebaeude/ionen.gif.1 b/skin/default/graphics/gebaeude/ionen.gif.1 similarity index 100% rename from skins/xnova/gebaeude/ionen.gif.1 rename to skin/default/graphics/gebaeude/ionen.gif.1 diff --git a/skins/xnova/gfx/info-help.jpg b/skin/default/graphics/gfx/info-help.jpg similarity index 100% rename from skins/xnova/gfx/info-help.jpg rename to skin/default/graphics/gfx/info-help.jpg diff --git a/skins/xnova/gfx/user-menu.jpg b/skin/default/graphics/gfx/user-menu.jpg similarity index 100% rename from skins/xnova/gfx/user-menu.jpg rename to skin/default/graphics/gfx/user-menu.jpg diff --git a/skins/xnova/images/deuterium.gif b/skin/default/graphics/images/deuterium.gif similarity index 100% rename from skins/xnova/images/deuterium.gif rename to skin/default/graphics/images/deuterium.gif diff --git a/skins/xnova/images/energie.gif b/skin/default/graphics/images/energie.gif similarity index 100% rename from skins/xnova/images/energie.gif rename to skin/default/graphics/images/energie.gif diff --git a/skins/xnova/images/kristall.gif b/skin/default/graphics/images/kristall.gif similarity index 100% rename from skins/xnova/images/kristall.gif rename to skin/default/graphics/images/kristall.gif diff --git a/skins/xnova/images/message.gif b/skin/default/graphics/images/message.gif similarity index 100% rename from skins/xnova/images/message.gif rename to skin/default/graphics/images/message.gif diff --git a/skins/xnova/images/metall.gif b/skin/default/graphics/images/metall.gif similarity index 100% rename from skins/xnova/images/metall.gif rename to skin/default/graphics/images/metall.gif diff --git a/skins/xnova/img/b.gif b/skin/default/graphics/img/b.gif similarity index 100% rename from skins/xnova/img/b.gif rename to skin/default/graphics/img/b.gif diff --git a/skins/xnova/img/background1.jpg b/skin/default/graphics/img/background1.jpg similarity index 100% rename from skins/xnova/img/background1.jpg rename to skin/default/graphics/img/background1.jpg diff --git a/skins/xnova/img/background2.jpg b/skin/default/graphics/img/background2.jpg similarity index 100% rename from skins/xnova/img/background2.jpg rename to skin/default/graphics/img/background2.jpg diff --git a/skins/xnova/img/bg1.gif b/skin/default/graphics/img/bg1.gif similarity index 100% rename from skins/xnova/img/bg1.gif rename to skin/default/graphics/img/bg1.gif diff --git a/skins/xnova/img/e.gif b/skin/default/graphics/img/e.gif similarity index 100% rename from skins/xnova/img/e.gif rename to skin/default/graphics/img/e.gif diff --git a/skins/xnova/img/link.gif b/skin/default/graphics/img/link.gif similarity index 100% rename from skins/xnova/img/link.gif rename to skin/default/graphics/img/link.gif diff --git a/skins/xnova/img/m.gif b/skin/default/graphics/img/m.gif similarity index 100% rename from skins/xnova/img/m.gif rename to skin/default/graphics/img/m.gif diff --git a/skins/xnova/img/p.png b/skin/default/graphics/img/p.png similarity index 100% rename from skins/xnova/img/p.png rename to skin/default/graphics/img/p.png diff --git a/skins/xnova/img/p1z1.png b/skin/default/graphics/img/p1z1.png similarity index 100% rename from skins/xnova/img/p1z1.png rename to skin/default/graphics/img/p1z1.png diff --git a/skins/xnova/img/p2z2.png b/skin/default/graphics/img/p2z2.png similarity index 100% rename from skins/xnova/img/p2z2.png rename to skin/default/graphics/img/p2z2.png diff --git a/skins/xnova/img/p3z2.png b/skin/default/graphics/img/p3z2.png similarity index 100% rename from skins/xnova/img/p3z2.png rename to skin/default/graphics/img/p3z2.png diff --git a/skins/xnova/img/r.gif b/skin/default/graphics/img/r.gif similarity index 100% rename from skins/xnova/img/r.gif rename to skin/default/graphics/img/r.gif diff --git a/skins/xnova/img/s.gif b/skin/default/graphics/img/s.gif similarity index 100% rename from skins/xnova/img/s.gif rename to skin/default/graphics/img/s.gif diff --git a/skins/xnova/img/starz2.png b/skin/default/graphics/img/starz2.png similarity index 100% rename from skins/xnova/img/starz2.png rename to skin/default/graphics/img/starz2.png diff --git a/skins/xnova/pic/abort.gif b/skin/default/graphics/pic/abort.gif similarity index 100% rename from skins/xnova/pic/abort.gif rename to skin/default/graphics/pic/abort.gif diff --git a/skins/xnova/pic/appwiz.gif b/skin/default/graphics/pic/appwiz.gif similarity index 100% rename from skins/xnova/pic/appwiz.gif rename to skin/default/graphics/pic/appwiz.gif diff --git a/skins/xnova/pic/key.gif b/skin/default/graphics/pic/key.gif similarity index 100% rename from skins/xnova/pic/key.gif rename to skin/default/graphics/pic/key.gif diff --git a/skins/xnova/planeten/debris.jpg b/skin/default/graphics/planeten/debris.jpg similarity index 100% rename from skins/xnova/planeten/debris.jpg rename to skin/default/graphics/planeten/debris.jpg diff --git a/skins/xnova/planeten/dschjungelplanet01.jpg b/skin/default/graphics/planeten/dschjungelplanet01.jpg similarity index 100% rename from skins/xnova/planeten/dschjungelplanet01.jpg rename to skin/default/graphics/planeten/dschjungelplanet01.jpg diff --git a/skins/xnova/planeten/dschjungelplanet02.jpg b/skin/default/graphics/planeten/dschjungelplanet02.jpg similarity index 100% rename from skins/xnova/planeten/dschjungelplanet02.jpg rename to skin/default/graphics/planeten/dschjungelplanet02.jpg diff --git a/skins/xnova/planeten/dschjungelplanet03.jpg b/skin/default/graphics/planeten/dschjungelplanet03.jpg similarity index 100% rename from skins/xnova/planeten/dschjungelplanet03.jpg rename to skin/default/graphics/planeten/dschjungelplanet03.jpg diff --git a/skins/xnova/planeten/dschjungelplanet04.jpg b/skin/default/graphics/planeten/dschjungelplanet04.jpg similarity index 100% rename from skins/xnova/planeten/dschjungelplanet04.jpg rename to skin/default/graphics/planeten/dschjungelplanet04.jpg diff --git a/skins/xnova/planeten/dschjungelplanet05.jpg b/skin/default/graphics/planeten/dschjungelplanet05.jpg similarity index 100% rename from skins/xnova/planeten/dschjungelplanet05.jpg rename to skin/default/graphics/planeten/dschjungelplanet05.jpg diff --git a/skins/xnova/planeten/dschjungelplanet06.jpg b/skin/default/graphics/planeten/dschjungelplanet06.jpg similarity index 100% rename from skins/xnova/planeten/dschjungelplanet06.jpg rename to skin/default/graphics/planeten/dschjungelplanet06.jpg diff --git a/skins/xnova/planeten/dschjungelplanet07.jpg b/skin/default/graphics/planeten/dschjungelplanet07.jpg similarity index 100% rename from skins/xnova/planeten/dschjungelplanet07.jpg rename to skin/default/graphics/planeten/dschjungelplanet07.jpg diff --git a/skins/xnova/planeten/dschjungelplanet08.jpg b/skin/default/graphics/planeten/dschjungelplanet08.jpg similarity index 100% rename from skins/xnova/planeten/dschjungelplanet08.jpg rename to skin/default/graphics/planeten/dschjungelplanet08.jpg diff --git a/skins/xnova/planeten/dschjungelplanet09.jpg b/skin/default/graphics/planeten/dschjungelplanet09.jpg similarity index 100% rename from skins/xnova/planeten/dschjungelplanet09.jpg rename to skin/default/graphics/planeten/dschjungelplanet09.jpg diff --git a/skins/xnova/planeten/dschjungelplanet10.jpg b/skin/default/graphics/planeten/dschjungelplanet10.jpg similarity index 100% rename from skins/xnova/planeten/dschjungelplanet10.jpg rename to skin/default/graphics/planeten/dschjungelplanet10.jpg diff --git a/skins/xnova/planeten/eisplanet01.jpg b/skin/default/graphics/planeten/eisplanet01.jpg similarity index 100% rename from skins/xnova/planeten/eisplanet01.jpg rename to skin/default/graphics/planeten/eisplanet01.jpg diff --git a/skins/xnova/planeten/eisplanet02.jpg b/skin/default/graphics/planeten/eisplanet02.jpg similarity index 100% rename from skins/xnova/planeten/eisplanet02.jpg rename to skin/default/graphics/planeten/eisplanet02.jpg diff --git a/skins/xnova/planeten/eisplanet03.jpg b/skin/default/graphics/planeten/eisplanet03.jpg similarity index 100% rename from skins/xnova/planeten/eisplanet03.jpg rename to skin/default/graphics/planeten/eisplanet03.jpg diff --git a/skins/xnova/planeten/eisplanet04.jpg b/skin/default/graphics/planeten/eisplanet04.jpg similarity index 100% rename from skins/xnova/planeten/eisplanet04.jpg rename to skin/default/graphics/planeten/eisplanet04.jpg diff --git a/skins/xnova/planeten/eisplanet05.jpg b/skin/default/graphics/planeten/eisplanet05.jpg similarity index 100% rename from skins/xnova/planeten/eisplanet05.jpg rename to skin/default/graphics/planeten/eisplanet05.jpg diff --git a/skins/xnova/planeten/eisplanet06.jpg b/skin/default/graphics/planeten/eisplanet06.jpg similarity index 100% rename from skins/xnova/planeten/eisplanet06.jpg rename to skin/default/graphics/planeten/eisplanet06.jpg diff --git a/skins/xnova/planeten/eisplanet07.jpg b/skin/default/graphics/planeten/eisplanet07.jpg similarity index 100% rename from skins/xnova/planeten/eisplanet07.jpg rename to skin/default/graphics/planeten/eisplanet07.jpg diff --git a/skins/xnova/planeten/eisplanet08.jpg b/skin/default/graphics/planeten/eisplanet08.jpg similarity index 100% rename from skins/xnova/planeten/eisplanet08.jpg rename to skin/default/graphics/planeten/eisplanet08.jpg diff --git a/skins/xnova/planeten/eisplanet09.jpg b/skin/default/graphics/planeten/eisplanet09.jpg similarity index 100% rename from skins/xnova/planeten/eisplanet09.jpg rename to skin/default/graphics/planeten/eisplanet09.jpg diff --git a/skins/xnova/planeten/eisplanet10.jpg b/skin/default/graphics/planeten/eisplanet10.jpg similarity index 100% rename from skins/xnova/planeten/eisplanet10.jpg rename to skin/default/graphics/planeten/eisplanet10.jpg diff --git a/skins/xnova/planeten/gasplanet01.jpg b/skin/default/graphics/planeten/gasplanet01.jpg similarity index 100% rename from skins/xnova/planeten/gasplanet01.jpg rename to skin/default/graphics/planeten/gasplanet01.jpg diff --git a/skins/xnova/planeten/gasplanet02.jpg b/skin/default/graphics/planeten/gasplanet02.jpg similarity index 100% rename from skins/xnova/planeten/gasplanet02.jpg rename to skin/default/graphics/planeten/gasplanet02.jpg diff --git a/skins/xnova/planeten/gasplanet03.jpg b/skin/default/graphics/planeten/gasplanet03.jpg similarity index 100% rename from skins/xnova/planeten/gasplanet03.jpg rename to skin/default/graphics/planeten/gasplanet03.jpg diff --git a/skins/xnova/planeten/gasplanet04.jpg b/skin/default/graphics/planeten/gasplanet04.jpg similarity index 100% rename from skins/xnova/planeten/gasplanet04.jpg rename to skin/default/graphics/planeten/gasplanet04.jpg diff --git a/skins/xnova/planeten/gasplanet05.jpg b/skin/default/graphics/planeten/gasplanet05.jpg similarity index 100% rename from skins/xnova/planeten/gasplanet05.jpg rename to skin/default/graphics/planeten/gasplanet05.jpg diff --git a/skins/xnova/planeten/gasplanet06.jpg b/skin/default/graphics/planeten/gasplanet06.jpg similarity index 100% rename from skins/xnova/planeten/gasplanet06.jpg rename to skin/default/graphics/planeten/gasplanet06.jpg diff --git a/skins/xnova/planeten/gasplanet07.jpg b/skin/default/graphics/planeten/gasplanet07.jpg similarity index 100% rename from skins/xnova/planeten/gasplanet07.jpg rename to skin/default/graphics/planeten/gasplanet07.jpg diff --git a/skins/xnova/planeten/gasplanet08.jpg b/skin/default/graphics/planeten/gasplanet08.jpg similarity index 100% rename from skins/xnova/planeten/gasplanet08.jpg rename to skin/default/graphics/planeten/gasplanet08.jpg diff --git a/skins/xnova/planeten/mond.jpg b/skin/default/graphics/planeten/mond.jpg similarity index 100% rename from skins/xnova/planeten/mond.jpg rename to skin/default/graphics/planeten/mond.jpg diff --git a/skins/xnova/planeten/normaltempplanet01.jpg b/skin/default/graphics/planeten/normaltempplanet01.jpg similarity index 100% rename from skins/xnova/planeten/normaltempplanet01.jpg rename to skin/default/graphics/planeten/normaltempplanet01.jpg diff --git a/skins/xnova/planeten/normaltempplanet02.jpg b/skin/default/graphics/planeten/normaltempplanet02.jpg similarity index 100% rename from skins/xnova/planeten/normaltempplanet02.jpg rename to skin/default/graphics/planeten/normaltempplanet02.jpg diff --git a/skins/xnova/planeten/normaltempplanet03.jpg b/skin/default/graphics/planeten/normaltempplanet03.jpg similarity index 100% rename from skins/xnova/planeten/normaltempplanet03.jpg rename to skin/default/graphics/planeten/normaltempplanet03.jpg diff --git a/skins/xnova/planeten/normaltempplanet04.jpg b/skin/default/graphics/planeten/normaltempplanet04.jpg similarity index 100% rename from skins/xnova/planeten/normaltempplanet04.jpg rename to skin/default/graphics/planeten/normaltempplanet04.jpg diff --git a/skins/xnova/planeten/normaltempplanet05.jpg b/skin/default/graphics/planeten/normaltempplanet05.jpg similarity index 100% rename from skins/xnova/planeten/normaltempplanet05.jpg rename to skin/default/graphics/planeten/normaltempplanet05.jpg diff --git a/skins/xnova/planeten/normaltempplanet06.jpg b/skin/default/graphics/planeten/normaltempplanet06.jpg similarity index 100% rename from skins/xnova/planeten/normaltempplanet06.jpg rename to skin/default/graphics/planeten/normaltempplanet06.jpg diff --git a/skins/xnova/planeten/normaltempplanet07.jpg b/skin/default/graphics/planeten/normaltempplanet07.jpg similarity index 100% rename from skins/xnova/planeten/normaltempplanet07.jpg rename to skin/default/graphics/planeten/normaltempplanet07.jpg diff --git a/skins/xnova/planeten/normaltempplanet08.jpg b/skin/default/graphics/planeten/normaltempplanet08.jpg similarity index 100% rename from skins/xnova/planeten/normaltempplanet08.jpg rename to skin/default/graphics/planeten/normaltempplanet08.jpg diff --git a/skins/xnova/planeten/small/s_dschjungelplanet01.jpg b/skin/default/graphics/planeten/small/s_dschjungelplanet01.jpg similarity index 100% rename from skins/xnova/planeten/small/s_dschjungelplanet01.jpg rename to skin/default/graphics/planeten/small/s_dschjungelplanet01.jpg diff --git a/skins/xnova/planeten/small/s_dschjungelplanet02.jpg b/skin/default/graphics/planeten/small/s_dschjungelplanet02.jpg similarity index 100% rename from skins/xnova/planeten/small/s_dschjungelplanet02.jpg rename to skin/default/graphics/planeten/small/s_dschjungelplanet02.jpg diff --git a/skins/xnova/planeten/small/s_dschjungelplanet03.jpg b/skin/default/graphics/planeten/small/s_dschjungelplanet03.jpg similarity index 100% rename from skins/xnova/planeten/small/s_dschjungelplanet03.jpg rename to skin/default/graphics/planeten/small/s_dschjungelplanet03.jpg diff --git a/skins/xnova/planeten/small/s_dschjungelplanet04.jpg b/skin/default/graphics/planeten/small/s_dschjungelplanet04.jpg similarity index 100% rename from skins/xnova/planeten/small/s_dschjungelplanet04.jpg rename to skin/default/graphics/planeten/small/s_dschjungelplanet04.jpg diff --git a/skins/xnova/planeten/small/s_dschjungelplanet05.jpg b/skin/default/graphics/planeten/small/s_dschjungelplanet05.jpg similarity index 100% rename from skins/xnova/planeten/small/s_dschjungelplanet05.jpg rename to skin/default/graphics/planeten/small/s_dschjungelplanet05.jpg diff --git a/skins/xnova/planeten/small/s_dschjungelplanet06.jpg b/skin/default/graphics/planeten/small/s_dschjungelplanet06.jpg similarity index 100% rename from skins/xnova/planeten/small/s_dschjungelplanet06.jpg rename to skin/default/graphics/planeten/small/s_dschjungelplanet06.jpg diff --git a/skins/xnova/planeten/small/s_dschjungelplanet07.jpg b/skin/default/graphics/planeten/small/s_dschjungelplanet07.jpg similarity index 100% rename from skins/xnova/planeten/small/s_dschjungelplanet07.jpg rename to skin/default/graphics/planeten/small/s_dschjungelplanet07.jpg diff --git a/skins/xnova/planeten/small/s_dschjungelplanet08.jpg b/skin/default/graphics/planeten/small/s_dschjungelplanet08.jpg similarity index 100% rename from skins/xnova/planeten/small/s_dschjungelplanet08.jpg rename to skin/default/graphics/planeten/small/s_dschjungelplanet08.jpg diff --git a/skins/xnova/planeten/small/s_dschjungelplanet09.jpg b/skin/default/graphics/planeten/small/s_dschjungelplanet09.jpg similarity index 100% rename from skins/xnova/planeten/small/s_dschjungelplanet09.jpg rename to skin/default/graphics/planeten/small/s_dschjungelplanet09.jpg diff --git a/skins/xnova/planeten/small/s_dschjungelplanet10.jpg b/skin/default/graphics/planeten/small/s_dschjungelplanet10.jpg similarity index 100% rename from skins/xnova/planeten/small/s_dschjungelplanet10.jpg rename to skin/default/graphics/planeten/small/s_dschjungelplanet10.jpg diff --git a/skins/xnova/planeten/small/s_eisplanet01.jpg b/skin/default/graphics/planeten/small/s_eisplanet01.jpg similarity index 100% rename from skins/xnova/planeten/small/s_eisplanet01.jpg rename to skin/default/graphics/planeten/small/s_eisplanet01.jpg diff --git a/skins/xnova/planeten/small/s_eisplanet02.jpg b/skin/default/graphics/planeten/small/s_eisplanet02.jpg similarity index 100% rename from skins/xnova/planeten/small/s_eisplanet02.jpg rename to skin/default/graphics/planeten/small/s_eisplanet02.jpg diff --git a/skins/xnova/planeten/small/s_eisplanet03.jpg b/skin/default/graphics/planeten/small/s_eisplanet03.jpg similarity index 100% rename from skins/xnova/planeten/small/s_eisplanet03.jpg rename to skin/default/graphics/planeten/small/s_eisplanet03.jpg diff --git a/skins/xnova/planeten/small/s_eisplanet04.jpg b/skin/default/graphics/planeten/small/s_eisplanet04.jpg similarity index 100% rename from skins/xnova/planeten/small/s_eisplanet04.jpg rename to skin/default/graphics/planeten/small/s_eisplanet04.jpg diff --git a/skins/xnova/planeten/small/s_eisplanet05.jpg b/skin/default/graphics/planeten/small/s_eisplanet05.jpg similarity index 100% rename from skins/xnova/planeten/small/s_eisplanet05.jpg rename to skin/default/graphics/planeten/small/s_eisplanet05.jpg diff --git a/skins/xnova/planeten/small/s_eisplanet06.jpg b/skin/default/graphics/planeten/small/s_eisplanet06.jpg similarity index 100% rename from skins/xnova/planeten/small/s_eisplanet06.jpg rename to skin/default/graphics/planeten/small/s_eisplanet06.jpg diff --git a/skins/xnova/planeten/small/s_eisplanet07.jpg b/skin/default/graphics/planeten/small/s_eisplanet07.jpg similarity index 100% rename from skins/xnova/planeten/small/s_eisplanet07.jpg rename to skin/default/graphics/planeten/small/s_eisplanet07.jpg diff --git a/skins/xnova/planeten/small/s_eisplanet08.jpg b/skin/default/graphics/planeten/small/s_eisplanet08.jpg similarity index 100% rename from skins/xnova/planeten/small/s_eisplanet08.jpg rename to skin/default/graphics/planeten/small/s_eisplanet08.jpg diff --git a/skins/xnova/planeten/small/s_eisplanet09.jpg b/skin/default/graphics/planeten/small/s_eisplanet09.jpg similarity index 100% rename from skins/xnova/planeten/small/s_eisplanet09.jpg rename to skin/default/graphics/planeten/small/s_eisplanet09.jpg diff --git a/skins/xnova/planeten/small/s_eisplanet10.jpg b/skin/default/graphics/planeten/small/s_eisplanet10.jpg similarity index 100% rename from skins/xnova/planeten/small/s_eisplanet10.jpg rename to skin/default/graphics/planeten/small/s_eisplanet10.jpg diff --git a/skins/xnova/planeten/small/s_gasplanet01.jpg b/skin/default/graphics/planeten/small/s_gasplanet01.jpg similarity index 100% rename from skins/xnova/planeten/small/s_gasplanet01.jpg rename to skin/default/graphics/planeten/small/s_gasplanet01.jpg diff --git a/skins/xnova/planeten/small/s_gasplanet02.jpg b/skin/default/graphics/planeten/small/s_gasplanet02.jpg similarity index 100% rename from skins/xnova/planeten/small/s_gasplanet02.jpg rename to skin/default/graphics/planeten/small/s_gasplanet02.jpg diff --git a/skins/xnova/planeten/small/s_gasplanet03.jpg b/skin/default/graphics/planeten/small/s_gasplanet03.jpg similarity index 100% rename from skins/xnova/planeten/small/s_gasplanet03.jpg rename to skin/default/graphics/planeten/small/s_gasplanet03.jpg diff --git a/skins/xnova/planeten/small/s_gasplanet04.jpg b/skin/default/graphics/planeten/small/s_gasplanet04.jpg similarity index 100% rename from skins/xnova/planeten/small/s_gasplanet04.jpg rename to skin/default/graphics/planeten/small/s_gasplanet04.jpg diff --git a/skins/xnova/planeten/small/s_gasplanet05.jpg b/skin/default/graphics/planeten/small/s_gasplanet05.jpg similarity index 100% rename from skins/xnova/planeten/small/s_gasplanet05.jpg rename to skin/default/graphics/planeten/small/s_gasplanet05.jpg diff --git a/skins/xnova/planeten/small/s_gasplanet06.jpg b/skin/default/graphics/planeten/small/s_gasplanet06.jpg similarity index 100% rename from skins/xnova/planeten/small/s_gasplanet06.jpg rename to skin/default/graphics/planeten/small/s_gasplanet06.jpg diff --git a/skins/xnova/planeten/small/s_gasplanet07.jpg b/skin/default/graphics/planeten/small/s_gasplanet07.jpg similarity index 100% rename from skins/xnova/planeten/small/s_gasplanet07.jpg rename to skin/default/graphics/planeten/small/s_gasplanet07.jpg diff --git a/skins/xnova/planeten/small/s_gasplanet08.jpg b/skin/default/graphics/planeten/small/s_gasplanet08.jpg similarity index 100% rename from skins/xnova/planeten/small/s_gasplanet08.jpg rename to skin/default/graphics/planeten/small/s_gasplanet08.jpg diff --git a/skins/xnova/planeten/small/s_mond.jpg b/skin/default/graphics/planeten/small/s_mond.jpg similarity index 100% rename from skins/xnova/planeten/small/s_mond.jpg rename to skin/default/graphics/planeten/small/s_mond.jpg diff --git a/skins/xnova/planeten/small/s_normaltempplanet01.jpg b/skin/default/graphics/planeten/small/s_normaltempplanet01.jpg similarity index 100% rename from skins/xnova/planeten/small/s_normaltempplanet01.jpg rename to skin/default/graphics/planeten/small/s_normaltempplanet01.jpg diff --git a/skins/xnova/planeten/small/s_normaltempplanet02.jpg b/skin/default/graphics/planeten/small/s_normaltempplanet02.jpg similarity index 100% rename from skins/xnova/planeten/small/s_normaltempplanet02.jpg rename to skin/default/graphics/planeten/small/s_normaltempplanet02.jpg diff --git a/skins/xnova/planeten/small/s_normaltempplanet03.jpg b/skin/default/graphics/planeten/small/s_normaltempplanet03.jpg similarity index 100% rename from skins/xnova/planeten/small/s_normaltempplanet03.jpg rename to skin/default/graphics/planeten/small/s_normaltempplanet03.jpg diff --git a/skins/xnova/planeten/small/s_normaltempplanet04.jpg b/skin/default/graphics/planeten/small/s_normaltempplanet04.jpg similarity index 100% rename from skins/xnova/planeten/small/s_normaltempplanet04.jpg rename to skin/default/graphics/planeten/small/s_normaltempplanet04.jpg diff --git a/skins/xnova/planeten/small/s_normaltempplanet05.jpg b/skin/default/graphics/planeten/small/s_normaltempplanet05.jpg similarity index 100% rename from skins/xnova/planeten/small/s_normaltempplanet05.jpg rename to skin/default/graphics/planeten/small/s_normaltempplanet05.jpg diff --git a/skins/xnova/planeten/small/s_normaltempplanet06.jpg b/skin/default/graphics/planeten/small/s_normaltempplanet06.jpg similarity index 100% rename from skins/xnova/planeten/small/s_normaltempplanet06.jpg rename to skin/default/graphics/planeten/small/s_normaltempplanet06.jpg diff --git a/skins/xnova/planeten/small/s_normaltempplanet07.jpg b/skin/default/graphics/planeten/small/s_normaltempplanet07.jpg similarity index 100% rename from skins/xnova/planeten/small/s_normaltempplanet07.jpg rename to skin/default/graphics/planeten/small/s_normaltempplanet07.jpg diff --git a/skins/xnova/planeten/small/s_normaltempplanet08.jpg b/skin/default/graphics/planeten/small/s_normaltempplanet08.jpg similarity index 100% rename from skins/xnova/planeten/small/s_normaltempplanet08.jpg rename to skin/default/graphics/planeten/small/s_normaltempplanet08.jpg diff --git a/skins/xnova/planeten/small/s_trockenplanet01.jpg b/skin/default/graphics/planeten/small/s_trockenplanet01.jpg similarity index 100% rename from skins/xnova/planeten/small/s_trockenplanet01.jpg rename to skin/default/graphics/planeten/small/s_trockenplanet01.jpg diff --git a/skins/xnova/planeten/small/s_trockenplanet02.jpg b/skin/default/graphics/planeten/small/s_trockenplanet02.jpg similarity index 100% rename from skins/xnova/planeten/small/s_trockenplanet02.jpg rename to skin/default/graphics/planeten/small/s_trockenplanet02.jpg diff --git a/skins/xnova/planeten/small/s_trockenplanet03.jpg b/skin/default/graphics/planeten/small/s_trockenplanet03.jpg similarity index 100% rename from skins/xnova/planeten/small/s_trockenplanet03.jpg rename to skin/default/graphics/planeten/small/s_trockenplanet03.jpg diff --git a/skins/xnova/planeten/small/s_trockenplanet04.jpg b/skin/default/graphics/planeten/small/s_trockenplanet04.jpg similarity index 100% rename from skins/xnova/planeten/small/s_trockenplanet04.jpg rename to skin/default/graphics/planeten/small/s_trockenplanet04.jpg diff --git a/skins/xnova/planeten/small/s_trockenplanet05.jpg b/skin/default/graphics/planeten/small/s_trockenplanet05.jpg similarity index 100% rename from skins/xnova/planeten/small/s_trockenplanet05.jpg rename to skin/default/graphics/planeten/small/s_trockenplanet05.jpg diff --git a/skins/xnova/planeten/small/s_trockenplanet06.jpg b/skin/default/graphics/planeten/small/s_trockenplanet06.jpg similarity index 100% rename from skins/xnova/planeten/small/s_trockenplanet06.jpg rename to skin/default/graphics/planeten/small/s_trockenplanet06.jpg diff --git a/skins/xnova/planeten/small/s_trockenplanet07.jpg b/skin/default/graphics/planeten/small/s_trockenplanet07.jpg similarity index 100% rename from skins/xnova/planeten/small/s_trockenplanet07.jpg rename to skin/default/graphics/planeten/small/s_trockenplanet07.jpg diff --git a/skins/xnova/planeten/small/s_trockenplanet08.jpg b/skin/default/graphics/planeten/small/s_trockenplanet08.jpg similarity index 100% rename from skins/xnova/planeten/small/s_trockenplanet08.jpg rename to skin/default/graphics/planeten/small/s_trockenplanet08.jpg diff --git a/skins/xnova/planeten/small/s_trockenplanet09.jpg b/skin/default/graphics/planeten/small/s_trockenplanet09.jpg similarity index 100% rename from skins/xnova/planeten/small/s_trockenplanet09.jpg rename to skin/default/graphics/planeten/small/s_trockenplanet09.jpg diff --git a/skins/xnova/planeten/small/s_trockenplanet10.jpg b/skin/default/graphics/planeten/small/s_trockenplanet10.jpg similarity index 100% rename from skins/xnova/planeten/small/s_trockenplanet10.jpg rename to skin/default/graphics/planeten/small/s_trockenplanet10.jpg diff --git a/skins/xnova/planeten/small/s_wasserplanet01.jpg b/skin/default/graphics/planeten/small/s_wasserplanet01.jpg similarity index 100% rename from skins/xnova/planeten/small/s_wasserplanet01.jpg rename to skin/default/graphics/planeten/small/s_wasserplanet01.jpg diff --git a/skins/xnova/planeten/small/s_wasserplanet02.jpg b/skin/default/graphics/planeten/small/s_wasserplanet02.jpg similarity index 100% rename from skins/xnova/planeten/small/s_wasserplanet02.jpg rename to skin/default/graphics/planeten/small/s_wasserplanet02.jpg diff --git a/skins/xnova/planeten/small/s_wasserplanet03.jpg b/skin/default/graphics/planeten/small/s_wasserplanet03.jpg similarity index 100% rename from skins/xnova/planeten/small/s_wasserplanet03.jpg rename to skin/default/graphics/planeten/small/s_wasserplanet03.jpg diff --git a/skins/xnova/planeten/small/s_wasserplanet04.jpg b/skin/default/graphics/planeten/small/s_wasserplanet04.jpg similarity index 100% rename from skins/xnova/planeten/small/s_wasserplanet04.jpg rename to skin/default/graphics/planeten/small/s_wasserplanet04.jpg diff --git a/skins/xnova/planeten/small/s_wasserplanet05.jpg b/skin/default/graphics/planeten/small/s_wasserplanet05.jpg similarity index 100% rename from skins/xnova/planeten/small/s_wasserplanet05.jpg rename to skin/default/graphics/planeten/small/s_wasserplanet05.jpg diff --git a/skins/xnova/planeten/small/s_wasserplanet06.jpg b/skin/default/graphics/planeten/small/s_wasserplanet06.jpg similarity index 100% rename from skins/xnova/planeten/small/s_wasserplanet06.jpg rename to skin/default/graphics/planeten/small/s_wasserplanet06.jpg diff --git a/skins/xnova/planeten/small/s_wasserplanet07.jpg b/skin/default/graphics/planeten/small/s_wasserplanet07.jpg similarity index 100% rename from skins/xnova/planeten/small/s_wasserplanet07.jpg rename to skin/default/graphics/planeten/small/s_wasserplanet07.jpg diff --git a/skins/xnova/planeten/small/s_wasserplanet08.jpg b/skin/default/graphics/planeten/small/s_wasserplanet08.jpg similarity index 100% rename from skins/xnova/planeten/small/s_wasserplanet08.jpg rename to skin/default/graphics/planeten/small/s_wasserplanet08.jpg diff --git a/skins/xnova/planeten/small/s_wasserplanet09.jpg b/skin/default/graphics/planeten/small/s_wasserplanet09.jpg similarity index 100% rename from skins/xnova/planeten/small/s_wasserplanet09.jpg rename to skin/default/graphics/planeten/small/s_wasserplanet09.jpg diff --git a/skins/xnova/planeten/small/s_wuestenplanet01.jpg b/skin/default/graphics/planeten/small/s_wuestenplanet01.jpg similarity index 100% rename from skins/xnova/planeten/small/s_wuestenplanet01.jpg rename to skin/default/graphics/planeten/small/s_wuestenplanet01.jpg diff --git a/skins/xnova/planeten/small/s_wuestenplanet02.jpg b/skin/default/graphics/planeten/small/s_wuestenplanet02.jpg similarity index 100% rename from skins/xnova/planeten/small/s_wuestenplanet02.jpg rename to skin/default/graphics/planeten/small/s_wuestenplanet02.jpg diff --git a/skins/xnova/planeten/small/s_wuestenplanet03.jpg b/skin/default/graphics/planeten/small/s_wuestenplanet03.jpg similarity index 100% rename from skins/xnova/planeten/small/s_wuestenplanet03.jpg rename to skin/default/graphics/planeten/small/s_wuestenplanet03.jpg diff --git a/skins/xnova/planeten/small/s_wuestenplanet04.jpg b/skin/default/graphics/planeten/small/s_wuestenplanet04.jpg similarity index 100% rename from skins/xnova/planeten/small/s_wuestenplanet04.jpg rename to skin/default/graphics/planeten/small/s_wuestenplanet04.jpg diff --git a/skins/xnova/planeten/trockenplanet01.jpg b/skin/default/graphics/planeten/trockenplanet01.jpg similarity index 100% rename from skins/xnova/planeten/trockenplanet01.jpg rename to skin/default/graphics/planeten/trockenplanet01.jpg diff --git a/skins/xnova/planeten/trockenplanet02.jpg b/skin/default/graphics/planeten/trockenplanet02.jpg similarity index 100% rename from skins/xnova/planeten/trockenplanet02.jpg rename to skin/default/graphics/planeten/trockenplanet02.jpg diff --git a/skins/xnova/planeten/trockenplanet03.jpg b/skin/default/graphics/planeten/trockenplanet03.jpg similarity index 100% rename from skins/xnova/planeten/trockenplanet03.jpg rename to skin/default/graphics/planeten/trockenplanet03.jpg diff --git a/skins/xnova/planeten/trockenplanet04.jpg b/skin/default/graphics/planeten/trockenplanet04.jpg similarity index 100% rename from skins/xnova/planeten/trockenplanet04.jpg rename to skin/default/graphics/planeten/trockenplanet04.jpg diff --git a/skins/xnova/planeten/trockenplanet05.jpg b/skin/default/graphics/planeten/trockenplanet05.jpg similarity index 100% rename from skins/xnova/planeten/trockenplanet05.jpg rename to skin/default/graphics/planeten/trockenplanet05.jpg diff --git a/skins/xnova/planeten/trockenplanet06.jpg b/skin/default/graphics/planeten/trockenplanet06.jpg similarity index 100% rename from skins/xnova/planeten/trockenplanet06.jpg rename to skin/default/graphics/planeten/trockenplanet06.jpg diff --git a/skins/xnova/planeten/trockenplanet07.jpg b/skin/default/graphics/planeten/trockenplanet07.jpg similarity index 100% rename from skins/xnova/planeten/trockenplanet07.jpg rename to skin/default/graphics/planeten/trockenplanet07.jpg diff --git a/skins/xnova/planeten/trockenplanet08.jpg b/skin/default/graphics/planeten/trockenplanet08.jpg similarity index 100% rename from skins/xnova/planeten/trockenplanet08.jpg rename to skin/default/graphics/planeten/trockenplanet08.jpg diff --git a/skins/xnova/planeten/trockenplanet09.jpg b/skin/default/graphics/planeten/trockenplanet09.jpg similarity index 100% rename from skins/xnova/planeten/trockenplanet09.jpg rename to skin/default/graphics/planeten/trockenplanet09.jpg diff --git a/skins/xnova/planeten/trockenplanet10.jpg b/skin/default/graphics/planeten/trockenplanet10.jpg similarity index 100% rename from skins/xnova/planeten/trockenplanet10.jpg rename to skin/default/graphics/planeten/trockenplanet10.jpg diff --git a/skins/xnova/planeten/wasserplanet01.jpg b/skin/default/graphics/planeten/wasserplanet01.jpg similarity index 100% rename from skins/xnova/planeten/wasserplanet01.jpg rename to skin/default/graphics/planeten/wasserplanet01.jpg diff --git a/skins/xnova/planeten/wasserplanet02.jpg b/skin/default/graphics/planeten/wasserplanet02.jpg similarity index 100% rename from skins/xnova/planeten/wasserplanet02.jpg rename to skin/default/graphics/planeten/wasserplanet02.jpg diff --git a/skins/xnova/planeten/wasserplanet03.jpg b/skin/default/graphics/planeten/wasserplanet03.jpg similarity index 100% rename from skins/xnova/planeten/wasserplanet03.jpg rename to skin/default/graphics/planeten/wasserplanet03.jpg diff --git a/skins/xnova/planeten/wasserplanet04.jpg b/skin/default/graphics/planeten/wasserplanet04.jpg similarity index 100% rename from skins/xnova/planeten/wasserplanet04.jpg rename to skin/default/graphics/planeten/wasserplanet04.jpg diff --git a/skins/xnova/planeten/wasserplanet05.jpg b/skin/default/graphics/planeten/wasserplanet05.jpg similarity index 100% rename from skins/xnova/planeten/wasserplanet05.jpg rename to skin/default/graphics/planeten/wasserplanet05.jpg diff --git a/skins/xnova/planeten/wasserplanet06.jpg b/skin/default/graphics/planeten/wasserplanet06.jpg similarity index 100% rename from skins/xnova/planeten/wasserplanet06.jpg rename to skin/default/graphics/planeten/wasserplanet06.jpg diff --git a/skins/xnova/planeten/wasserplanet07.jpg b/skin/default/graphics/planeten/wasserplanet07.jpg similarity index 100% rename from skins/xnova/planeten/wasserplanet07.jpg rename to skin/default/graphics/planeten/wasserplanet07.jpg diff --git a/skins/xnova/planeten/wasserplanet08.jpg b/skin/default/graphics/planeten/wasserplanet08.jpg similarity index 100% rename from skins/xnova/planeten/wasserplanet08.jpg rename to skin/default/graphics/planeten/wasserplanet08.jpg diff --git a/skins/xnova/planeten/wasserplanet09.jpg b/skin/default/graphics/planeten/wasserplanet09.jpg similarity index 100% rename from skins/xnova/planeten/wasserplanet09.jpg rename to skin/default/graphics/planeten/wasserplanet09.jpg diff --git a/skins/xnova/planeten/wuestenplanet01.jpg b/skin/default/graphics/planeten/wuestenplanet01.jpg similarity index 100% rename from skins/xnova/planeten/wuestenplanet01.jpg rename to skin/default/graphics/planeten/wuestenplanet01.jpg diff --git a/skins/xnova/planeten/wuestenplanet02.jpg b/skin/default/graphics/planeten/wuestenplanet02.jpg similarity index 100% rename from skins/xnova/planeten/wuestenplanet02.jpg rename to skin/default/graphics/planeten/wuestenplanet02.jpg diff --git a/skins/xnova/planeten/wuestenplanet03.jpg b/skin/default/graphics/planeten/wuestenplanet03.jpg similarity index 100% rename from skins/xnova/planeten/wuestenplanet03.jpg rename to skin/default/graphics/planeten/wuestenplanet03.jpg diff --git a/skins/xnova/planeten/wuestenplanet04.jpg b/skin/default/graphics/planeten/wuestenplanet04.jpg similarity index 100% rename from skins/xnova/planeten/wuestenplanet04.jpg rename to skin/default/graphics/planeten/wuestenplanet04.jpg diff --git a/templates/OpenGame/overview_body.tpl b/templates/OpenGame/overview_body.tpl index df231e7..a0ded62 100644 --- a/templates/OpenGame/overview_body.tpl +++ b/templates/OpenGame/overview_body.tpl @@ -1,7 +1,7 @@
- + {Have_new_message} {Have_new_level_mineur} {Have_new_level_raid} @@ -14,12 +14,12 @@ {fleet_list} - + - + diff --git a/templates/OpenGame/topnav.tpl b/templates/OpenGame/topnav.tpl deleted file mode 100644 index 6a49936..0000000 --- a/templates/OpenGame/topnav.tpl +++ /dev/null @@ -1,53 +0,0 @@ -
-
-
{Planet} "{planet_name}" ({user_username})
{Planet} "{planet_name}" ({user_username})
{moon_img}
{moon}

{building}

{building}
{anothers_planets}
{Diameter} {planet_diameter} km ({planet_field_current} / {planet_field_max} {fields})
{Developed_fields}
{case_pourcentage}
{case_pourcentage}
{ov_off_level}
{ov_off_mines} : {lvl_minier} {ov_off_raids} : {lvl_raid}
- - - - - - -
-
- - - - - - - -
- -
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
{Metal}{Crystal}{Deuterium}{Energy}{Message}
{metal}{crystal}{deuterium}{energy}{message}
-
- -
\ No newline at end of file