/**
  * __construct()
  */
 public function __construct()
 {
     parent::__construct();
     $this->langs = parent::$lang;
     $this->_planet = FunctionsLib::load_library('PlanetLib');
     if ($this->serverRequirementes()) {
         $this->buildPage();
     } else {
         die(FunctionsLib::message($this->langs['ins_no_server_requirements']));
     }
 }
Beispiel #2
0
 /**
  * __construct()
  */
 public function __construct()
 {
     parent::__construct();
     $this->_lang = parent::$lang;
     if (FunctionsLib::read_config('reg_enable') == 1) {
         $this->_creator = FunctionsLib::load_library('CreatorLib');
         $this->build_page();
     } else {
         die(FunctionsLib::message($this->_lang['re_disabled'], 'index.php', '5', FALSE, FALSE));
     }
 }
Beispiel #3
0
 /**
  * __construct()
  */
 public function __construct()
 {
     parent::__construct();
     // check if session is active
     parent::$users->check_session();
     // Check module access
     FunctionsLib::module_message(FunctionsLib::is_module_accesible(self::MODULE_ID));
     $this->_lang = parent::$lang;
     $this->_current_user = parent::$users->get_user_data();
     $this->_current_planet = parent::$users->get_planet_data();
     $this->_noob = FunctionsLib::load_library('NoobsProtectionLib');
     $this->build_page();
 }
Beispiel #4
0
 /**
  * __construct()
  */
 public function __construct($user = '', $planet = '', $galaxy = '', $system = '')
 {
     parent::__construct();
     $this->_lang = parent::$lang;
     $this->_current_user = $user;
     $this->_current_planet = $planet;
     $this->_galaxy = $galaxy;
     $this->_system = $system;
     $this->_resource = parent::$objects->getObjects();
     $this->_pricelist = parent::$objects->getPrice();
     $this->_formula = FunctionsLib::load_library('FormulaLib');
     $this->_noob = FunctionsLib::load_library('NoobsProtectionLib');
 }
Beispiel #5
0
 /**
  * __construct()
  */
 public function __construct()
 {
     parent::__construct();
     // check if session is active
     parent::$users->check_session();
     $this->_lang = parent::$lang;
     $this->_creator = FunctionsLib::load_library('CreatorLib');
     $this->_current_user = parent::$users->get_user_data();
     // Check if the user is allowed to access
     if (AdministrationLib::have_access($this->_current_user['user_authlevel']) && AdministrationLib::authorization($this->_current_user['user_authlevel'], 'edit_users') == 1) {
         $this->build_page();
     } else {
         die(FunctionsLib::message($this->_lang['ge_no_permissions']));
     }
 }
Beispiel #6
0
 /**
  * __construct()
  */
 public function __construct()
 {
     parent::__construct();
     // check if session is active
     parent::$users->check_session();
     // Check module access
     FunctionsLib::module_message(FunctionsLib::is_module_accesible(self::MODULE_ID));
     $this->_current_user = parent::$users->get_user_data();
     $this->_current_planet = parent::$users->get_planet_data();
     $this->_lang = parent::$lang;
     $this->_resource = parent::$objects->getObjects();
     $this->_pricelist = parent::$objects->getPrice();
     $this->_reslist = parent::$objects->getObjectsList();
     $this->_formula = FunctionsLib::load_library('FormulaLib');
     $this->_noob = FunctionsLib::load_library('NoobsProtectionLib');
     $this->_galaxyLib = FunctionsLib::load_library('GalaxyLib');
     $this->build_page();
 }
Beispiel #7
0
 /**
  * __construct()
  */
 public function __construct()
 {
     parent::__construct();
     // check if session is active
     parent::$users->check_session();
     // Check module access
     FunctionsLib::module_message(FunctionsLib::is_module_accesible(self::MODULE_ID));
     // DEFAULT VALUES
     $this->_current_user = parent::$users->get_user_data();
     $this->_lang = parent::$lang;
     $this->bbcode = FunctionsLib::load_library('BBCodeLib');
     $this->_ally = '';
     $this->_permissions = array();
     // SOME REQUIRED PATHS
     $this->_lang['dpath'] = DPATH;
     $this->_lang['img_path'] = XGP_ROOT . IMG_PATH;
     $this->_lang['js_path'] = XGP_ROOT . JS_PATH;
     // SET THE PERMISSIONS
     $this->setPermissions();
     // BUILD THE ALLIANCE PAGE
     $this->buildPage();
 }
Beispiel #8
0
$lang = array();
// set time zone
date_default_timezone_set(FunctionsLib::read_config('date_time_zone'));
// default skin path
define('DPATH', DEFAULT_SKINPATH);
// For debugging
if (FunctionsLib::read_config('debug') == 1) {
    // Show all errors
    ini_set('display_errors', 1);
    error_reporting(E_ALL);
} else {
    // Only for Betas, it's going to be changed
    ini_set('display_errors', 1);
    error_reporting(E_ALL);
}
$debug = FunctionsLib::load_library('DebugLib');
$db = new Database();
$installed = FunctionsLib::read_config('game_installed');
$game_version = FunctionsLib::read_config('version');
$game_lang = FunctionsLib::read_config('lang');
$current_page = isset($_GET['page']) ? $_GET['page'] : '';
// check if is installed
if ($installed == 0 && !defined('IN_INSTALL')) {
    FunctionsLib::redirect(XGP_ROOT . 'install/');
}
// define game version
if ($installed != 0) {
    define('VERSION', $game_version == '' ? '' : 'v' . $game_version);
}
// define game language
define('DEFAULT_LANG', $game_lang == '' ? 'spanish' : $game_lang);
Beispiel #9
0
 /**
  * updateMoon
  *
  * @param array  $fleet_row     Fleet Row
  * @param Report $report        Report
  * @param string $moonName      Moon Name
  * @param int    $target_userId Target User ID
  * @param array  $target_planet Target planet
  *
  * @return void
  */
 private function updateMoon($fleet_row, $report, $moonName, $target_userId, $target_planet)
 {
     $moon = $report->tryMoon();
     if ($moon === false) {
         return;
     }
     $galaxy = $fleet_row['fleet_end_galaxy'];
     $system = $fleet_row['fleet_end_system'];
     $planet = $fleet_row['fleet_end_planet'];
     $moon_exists = parent::$db->queryFetch("SELECT `planet_id`\n            FROM `" . PLANETS . "`\n            WHERE `planet_galaxy` = '" . $galaxy . "'\n                AND `planet_system` = '" . $system . "'\n                AND `planet_planet` = '" . $planet . "'\n                AND `planet_type` = '3';");
     if ($moon_exists['planet_id'] != 0) {
         return;
     }
     // $size and $fields
     extract($moon);
     $_creator = FunctionsLib::load_library('CreatorLib');
     $_creator->create_moon($galaxy, $system, $planet, $target_userId, $moonName, '', $size);
 }