Signed-off-by: Gregory PLANCHAT <g.planchat@gmail.com>

This commit is contained in:
Gregory PLANCHAT 2011-06-28 13:02:55 +02:00
commit 3fd8832b45
138 changed files with 2597 additions and 1253 deletions

View file

@ -34,7 +34,8 @@
* @param unknown_type $user
* @param unknown_type $planetrow
*/
function AbandonColony($user,$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){

View file

@ -1,114 +0,0 @@
<?php
/**
* This file is part of XNova:Legacies
*
* @license http://www.gnu.org/licenses/gpl-3.0.txt
* @see http://www.xnova-ng.org/
*
* Copyright (c) 2009-Present, XNova Support Team <http://www.xnova-ng.org>
* 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 <http://www.gnu.org/licenses/>.
*
* --> 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
* @param unknown_type $Element
* @param unknown_type $AddMode
*/
function AddBuildingToQueue ( &$CurrentPlanet, $CurrentUser, $Element, $AddMode = true) {
global $lang, $resource;
$CurrentQueue = $CurrentPlanet['b_building_id'];
if ($CurrentQueue != 0) {
$QueueArray = explode ( ";", $CurrentQueue );
$ActualCount = count ( $QueueArray );
} else {
$QueueArray = "";
$ActualCount = 0;
}
if ($AddMode == true) {
$BuildMode = 'build';
} else {
$BuildMode = 'destroy';
}
if ( $ActualCount < MAX_BUILDING_QUEUE_SIZE ) {
$QueueID = $ActualCount + 1;
} else {
$QueueID = false;
}
if ( $QueueID != false ) {
// Faut verifier si l'Element que l'on veut integrer est deja dans le tableau !
if ($QueueID > 1) {
$InArray = 0;
for ( $QueueElement = 0; $QueueElement < $ActualCount; $QueueElement++ ) {
$QueueSubArray = explode ( ",", $QueueArray[$QueueElement] );
if ($QueueSubArray[0] == $Element) {
$InArray++;
}
}
} else {
$InArray = 0;
}
if ($InArray != 0) {
$ActualLevel = $CurrentPlanet[$resource[$Element]];
if ($AddMode == true) {
$BuildLevel = $ActualLevel + 1 + $InArray;
$CurrentPlanet[$resource[$Element]] += $InArray;
$BuildTime = GetBuildingTime($CurrentUser, $CurrentPlanet, $Element);
$CurrentPlanet[$resource[$Element]] -= $InArray;
} else {
$BuildLevel = $ActualLevel - 1 + $InArray;
$CurrentPlanet[$resource[$Element]] -= $InArray;
$BuildTime = GetBuildingTime($CurrentUser, $CurrentPlanet, $Element) / 2;
$CurrentPlanet[$resource[$Element]] += $InArray;
}
} else {
$ActualLevel = $CurrentPlanet[$resource[$Element]];
if ($AddMode == true) {
$BuildLevel = $ActualLevel + 1;
$BuildTime = GetBuildingTime($CurrentUser, $CurrentPlanet, $Element);
} else {
$BuildLevel = $ActualLevel - 1;
$BuildTime = GetBuildingTime($CurrentUser, $CurrentPlanet, $Element) / 2;
}
}
if ($QueueID == 1) {
$BuildEndTime = time() + $BuildTime;
} else {
$PrevBuild = explode (",", $QueueArray[$ActualCount - 1]);
$BuildEndTime = $PrevBuild[3] + $BuildTime;
}
$QueueArray[$ActualCount] = $Element .",". $BuildLevel .",". $BuildTime .",". $BuildEndTime .",". $BuildMode;
$NewQueue = implode ( ";", $QueueArray );
$CurrentPlanet['b_building_id'] = $NewQueue;
}
return $QueueID;
}
?>

View file

@ -34,6 +34,7 @@
* @param unknown_type $string
*/
function bbcode($string) {
trigger_error(sprintf('%s is deprecated', __FUNCTION__), E_USER_DEPRECATED);
$pattern = array(
'/\\n/',
'/\\r/',
@ -77,6 +78,7 @@ 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("&#39;", "'", $string);
@ -99,12 +101,14 @@ function image($string)
function sCode($string){
trigger_error(sprintf('%s is deprecated', __FUNCTION__), E_USER_DEPRECATED);
$pattern = '/\<img src=\\\"(.*?)img\/smilies\/(.*?).png\\\" alt=\\\"(.*?)\\\" \/>/s';
$string = preg_replace($pattern, '\3', $string);
return '<pre>' . trim($string) . '</pre>';
}
function sList($string) {
trigger_error(sprintf('%s is deprecated', __FUNCTION__), E_USER_DEPRECATED);
$tmp = explode('[*]', stripslashes($string));
$out = null;
foreach($tmp as $list) {
@ -116,6 +120,7 @@ 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;
}
@ -123,6 +128,7 @@ function imagefix($img) {
}
function urlfix($url, $title) {
trigger_error(sprintf('%s is deprecated', __FUNCTION__), E_USER_DEPRECATED);
$title = stripslashes($title);
return '<a href="' . $url . '" title="' . $title . '">' . $title . '</a>';
}

View file

@ -35,6 +35,7 @@
* @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 );

View file

@ -38,6 +38,7 @@
* @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 (

View file

@ -33,6 +33,7 @@
* @deprecated
*/
function BuildFlyingFleetTable () {
trigger_error(sprintf('%s is deprecated', __FUNCTION__), E_USER_DEPRECATED);
global $lang;
$TableTPL = gettemplate('admin/fleet_rows');

View file

@ -1,49 +0,0 @@
<?php
/**
* This file is part of XNova:Legacies
*
* @license http://www.gnu.org/licenses/gpl-3.0.txt
* @see http://www.xnova-ng.org/
*
* Copyright (c) 2009-Present, XNova Support Team <http://www.xnova-ng.org>
* 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 <http://www.gnu.org/licenses/>.
*
* --> 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
*/
function BuildingSavePlanetRecord ( $CurrentPlanet ) {
// Enregistrement des divers changements dans les tables
$QryUpdatePlanet = "UPDATE {{table}} SET ";
$QryUpdatePlanet .= "`b_building_id` = '". $CurrentPlanet['b_building_id'] ."', ";
$QryUpdatePlanet .= "`b_building` = '". $CurrentPlanet['b_building'] ."' ";
$QryUpdatePlanet .= "WHERE ";
$QryUpdatePlanet .= "`id` = '". $CurrentPlanet['id'] ."';";
doquery( $QryUpdatePlanet, 'planets');
return;
}
?>

View file

@ -1,47 +0,0 @@
<?php
/**
* This file is part of XNova:Legacies
*
* @license http://www.gnu.org/licenses/gpl-3.0.txt
* @see http://www.xnova-ng.org/
*
* Copyright (c) 2009-Present, XNova Support Team <http://www.xnova-ng.org>
* 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 <http://www.gnu.org/licenses/>.
*
* --> 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 $CurrentUser
*/
function BuildingSaveUserRecord ( $CurrentUser ) {
$QryUpdateUser = "UPDATE {{table}} SET ";
$QryUpdateUser .= "`xpminier` = '". $CurrentUser['xpminier'] ."' ";
$QryUpdateUser .= "WHERE ";
$QryUpdateUser .= "`id` = '". $CurrentUser["id"] ."';";
doquery( $QryUpdateUser, 'users');
return;
}
?>

View file

@ -35,6 +35,7 @@
* @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) {

View file

@ -1,97 +0,0 @@
<?php
/**
* This file is part of XNova:Legacies
*
* @license http://www.gnu.org/licenses/gpl-3.0.txt
* @see http://www.xnova-ng.org/
*
* Copyright (c) 2009-Present, XNova Support Team <http://www.xnova-ng.org>
* 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 <http://www.gnu.org/licenses/>.
*
* --> 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 CheckCookies($IsUserChecked)
{
global $lang, $gameConfig;
includeLang('cookies');
$userData = array();
if (isset($_SESSION['user_id'])) {
$sql =<<<EOF
SELECT * FROM {{table}}
WHERE id={$_SESSION['user_id']}
LIMIT 1
EOF;
$userData = doquery($sql, 'users', true);
} else if (isset($_COOKIE['nova-cookie'])) {
$cookieData = unserialize(stripslashes($_COOKIE['nova-cookie']));
$cookieData = array(
'id' => (isset($cookieData['id']) ? (int) $cookieData['id'] : 0),
'key' => (isset($cookieData['key']) ? (string) $cookieData['key'] : null)
);
$sql =<<<EOF
SELECT * FROM {{table}} AS user
WHERE id={$cookieData['id']}
AND (@key:="{$cookieData['key']}")=CONCAT((@salt:=MID(@key, 0, 4)), SHA1(CONCAT(user.username, user.password, @salt)))
LIMIT 1
EOF;
$userData = doquery($sql, 'users', true);
$_SESSION['user_id'] = $userData['id'];
if (empty($userData)) {
message($lang['cookies']['Error2'] );
}
} else {
return array(
'state' => false,
'record' => array()
);
}
$sessionData = array(
'request_uri' => mysql_real_escape_string($_SERVER['REQUEST_URI']),
'remote_addr' => mysql_real_escape_string($_SERVER['REMOTE_ADDR']/* . (isset($_SERVER['HTTP_X_FORWARDED_FOR']) ? '|' . $_SERVER['HTTP_X_FORWARDED_FOR'] : '')*/),
'user_agent' => mysql_real_escape_string($_SERVER['HTTP_USER_AGENT'])
);
$now = time();
$sql =<<<EOF
UPDATE {{table}}
SET `onlinetime` = "{$now}",
`current_page` = "{$sessionData['request_uri']}",
`user_lastip` = "{$sessionData['remote_addr']}",
`user_agent` = "{$sessionData['user_agent']}"
WHERE `id`={$_SESSION['user_id']}
LIMIT 1;
EOF;
doquery($sql, 'users');
$IsUserChecked = true;
return array(
'state' => $IsUserChecked,
'record' => $userData
);
}

View file

@ -33,14 +33,9 @@
* @deprecated
* @param unknown_type $String
*/
function CheckInputStrings ( $String ) {
global $ListCensure;
function CheckInputStrings($string)
{
trigger_error(sprintf('%s is deprecated', __FUNCTION__), E_USER_DEPRECATED);
$ValidString = $String;
for ($Mot = 0; $Mot < count($ListCensure); $Mot++) {
$ValidString = eregi_replace( "$ListCensure[$Mot]", "*", $ValidString );
}
return ($ValidString);
}
?>
return htmlspecialchars($string, ENT_QUOTES, 'UTF-8');
}

View file

@ -34,6 +34,7 @@
* @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") {

View file

@ -1,156 +0,0 @@
<?php
/**
* This file is part of XNova:Legacies
*
* @license http://www.gnu.org/licenses/gpl-3.0.txt
* @see http://www.xnova-ng.org/
*
* Copyright (c) 2009-Present, XNova Support Team <http://www.xnova-ng.org>
* 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 <http://www.gnu.org/licenses/>.
*
* --> 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 CheckPlanetBuildingQueue ( &$CurrentPlanet, &$CurrentUser ) {
global $lang, $resource;
// Table des batiments donnant droit de l'experience minier
$XPBuildings = array( 1, 2, 3, 22, 23, 24);
$RetValue = false;
if ($CurrentPlanet['b_building_id'] != 0) {
$CurrentQueue = $CurrentPlanet['b_building_id'];
if ($CurrentQueue != 0) {
$QueueArray = explode ( ";", $CurrentQueue );
$ActualCount = count ( $QueueArray );
}
$BuildArray = explode (",", $QueueArray[0]);
$BuildEndTime = floor($BuildArray[3]);
$BuildMode = $BuildArray[4];
$Element = $BuildArray[0];
array_shift ( $QueueArray );
if ($BuildMode == 'destroy') {
$ForDestroy = true;
} else {
$ForDestroy = false;
}
if ($BuildEndTime <= time()) {
// Mise a jours des points
$Needed = GetBuildingPrice ($CurrentUser, $CurrentPlanet, $Element, true, $ForDestroy);
$Units = $Needed['metal'] + $Needed['crystal'] + $Needed['deuterium'];
if ($ForDestroy == false) {
// Mise a jours de l'XP Minier
if (in_array($Element, $XPBuildings)) {
$AjoutXP = $Units / 1000;
$CurrentUser['xpminier'] += $AjoutXP;
}
} else {
// Mise a jours de l'XP Minier
if (in_array($Element, $XPBuildings)) {
$AjoutXP = ($Units * 3) / 1000;
$CurrentUser['xpminier'] -= $AjoutXP;
}
}
$current = intval($CurrentPlanet['field_current']);
$max = intval($CurrentPlanet['field_max']);
// Pour une lune
if ($CurrentPlanet['planet_type'] == 3) {
if ($Element == 41) {
// Base Lunaire
$current += 1;
$max += FIELDS_BY_MOONBASIS_LEVEL;
$CurrentPlanet[$resource[$Element]]++;
} elseif ($Element != 0) {
if ($ForDestroy == false) {
$current += 1;
$CurrentPlanet[$resource[$Element]]++;
} else {
$current -= 1;
$CurrentPlanet[$resource[$Element]]--;
}
}
} elseif ($CurrentPlanet['planet_type'] == 1) {
if ($ForDestroy == false) {
$current += 1;
$CurrentPlanet[$resource[$Element]]++;
} else {
$current -= 1;
$CurrentPlanet[$resource[$Element]]--;
}
}
if (count ( $QueueArray ) == 0) {
$NewQueue = 0;
} else {
$NewQueue = implode (";", $QueueArray );
}
$CurrentPlanet['b_building'] = 0;
$CurrentPlanet['b_building_id'] = $NewQueue;
$CurrentPlanet['field_current'] = $current;
$CurrentPlanet['field_max'] = $max;
$QryUpdatePlanet = "UPDATE {{table}} SET ";
$QryUpdatePlanet .= "`".$resource[$Element]."` = '".$CurrentPlanet[$resource[$Element]]."', ";
// Mise a 0 de l'heure de fin de construction ...
// Ca va activer la mise en place du batiment suivant de la queue
$QryUpdatePlanet .= "`b_building` = '". $CurrentPlanet['b_building'] ."' , ";
$QryUpdatePlanet .= "`b_building_id` = '". $CurrentPlanet['b_building_id'] ."' , ";
$QryUpdatePlanet .= "`field_current` = '" . $CurrentPlanet['field_current'] . "', ";
$QryUpdatePlanet .= "`field_max` = '" . $CurrentPlanet['field_max'] . "' ";
$QryUpdatePlanet .= "WHERE ";
$QryUpdatePlanet .= "`id` = '" . $CurrentPlanet['id'] . "';";
doquery( $QryUpdatePlanet, 'planets');
$QryUpdateUser = "UPDATE {{table}} SET ";
$QryUpdateUser .= "`xpminier` = '".$CurrentUser['xpminier']."' ";
$QryUpdateUser .= "WHERE ";
$QryUpdateUser .= "`id` = '" . $CurrentUser['id'] . "';";
doquery( $QryUpdateUser, 'users');
$RetValue = true;
} else {
$RetValue = false;
}
} else {
$CurrentPlanet['b_building'] = 0;
$CurrentPlanet['b_building_id'] = 0;
$QryUpdatePlanet = "UPDATE {{table}} SET ";
$QryUpdatePlanet .= "`b_building` = '". $CurrentPlanet['b_building'] ."' , ";
$QryUpdatePlanet .= "`b_building_id` = '". $CurrentPlanet['b_building_id'] ."' ";
$QryUpdatePlanet .= "WHERE ";
$QryUpdatePlanet .= "`id` = '" . $CurrentPlanet['id'] . "';";
doquery( $QryUpdatePlanet, 'planets');
$RetValue = false;
}
return $RetValue;
}
?>

View file

@ -1,58 +0,0 @@
<?php
/**
* This file is part of XNova:Legacies
*
* @license http://www.gnu.org/licenses/gpl-3.0.txt
* @see http://www.xnova-ng.org/
*
* Copyright (c) 2009-Present, XNova Support Team <http://www.xnova-ng.org>
* 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 <http://www.gnu.org/licenses/>.
*
* --> 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 $planet
*/
function CheckPlanetUsedFields ( &$planet ) {
global $resource;
// Tous les batiments
$cfc = $planet[$resource[1]] + $planet[$resource[2]] + $planet[$resource[3]] ;
$cfc += $planet[$resource[4]] + $planet[$resource[12]] + $planet[$resource[14]];
$cfc += $planet[$resource[15]] + $planet[$resource[21]] + $planet[$resource[22]];
$cfc += $planet[$resource[23]] + $planet[$resource[24]] + $planet[$resource[31]];
$cfc += $planet[$resource[33]] + $planet[$resource[34]] + $planet[$resource[44]];
// Si on se trouve sur une lune ... Y a des choses a ajouter aussi
if ($planet['planet_type'] == '3') {
$cfc += $planet[$resource[41]] + $planet[$resource[42]] + $planet[$resource[43]];
}
// Mise a jour du nombre de case dans la BDD si incorrect
if ($planet['field_current'] != $cfc) {
$planet['field_current'] = $cfc;
doquery("UPDATE {{table}} SET field_current=$cfc WHERE id={$planet['id']}", 'planets');
}
}
?>

View file

@ -35,6 +35,7 @@
*/
function CheckTheUser($IsUserChecked)
{
trigger_error(sprintf('%s is deprecated', __FUNCTION__), E_USER_DEPRECATED);
global $user;
includeLang('admin');
$Result = CheckCookies( $IsUserChecked );

View file

@ -41,6 +41,7 @@
*/
function CreateOneMoonRecord ( $Galaxy, $System, $Planet, $Owner, $MoonID, $MoonName, $Chance ) {
global $lang;
trigger_error(sprintf('%s is deprecated', __FUNCTION__), E_USER_DEPRECATED);
$PlanetName = "";

View file

@ -36,6 +36,7 @@
*/
function PlanetSizeRandomiser ($Position, $HomeWorld = false) {
global $gameConfig;
trigger_error(sprintf('%s is deprecated', __FUNCTION__), E_USER_DEPRECATED);
if (!$HomeWorld) {
$ClassicBase = 163;

View file

@ -36,6 +36,7 @@
*/
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) {

View file

@ -35,6 +35,7 @@
*/
function DeleteSelectedUser ( $UserID ) {
trigger_error(sprintf('%s is deprecated', __FUNCTION__), E_USER_DEPRECATED);
$TheUser = doquery ( "SELECT * FROM {{table}} WHERE `id` = '" . $UserID . "';", 'users', true );
if ( $TheUser['ally_id'] != 0 ) {
$TheAlly = doquery ( "SELECT * FROM {{table}} WHERE `id` = '" . $TheUser['ally_id'] . "';", 'alliance', true );

View file

@ -37,6 +37,7 @@
function ElementBuildListBox ( $CurrentUser, $CurrentPlanet ) {
global $lang, $pricelist;
trigger_error(sprintf('%s is deprecated', __FUNCTION__), E_USER_DEPRECATED);
// // Array del b_hangar_id
// $ElementQueue = explode(';', $CurrentPlanet['b_hangar_id']);
// $NbrePerType = "";

View file

@ -37,6 +37,7 @@
function ElementBuildListQueue ( $CurrentUser, $CurrentPlanet ) {
// Jamais appelé pour le moment donc totalement modifiable !
trigger_error(sprintf('%s is deprecated', __FUNCTION__), E_USER_DEPRECATED);
/*
alter table `ogame`.`game_planets`
change `name` `name` varchar (255) NULL COLLATE latin1_general_ci,

View file

@ -36,6 +36,7 @@
*/
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

View file

@ -33,90 +33,79 @@
* @deprecated
* @param unknown_type $planet
*/
function FlyingFleetHandler (&$planet) {
global $resource;
function FlyingFleetHandler($planet) {
global $resource;
doquery("LOCK TABLE {{table}}lunas WRITE, {{table}}rw WRITE, {{table}}errors WRITE, {{table}}messages WRITE, {{table}}fleets WRITE, {{table}}planets WRITE, {{table}}galaxy WRITE ,{{table}}users WRITE", "");
//trigger_error(sprintf('%s is deprecated', __FUNCTION__), E_USER_DEPRECATED);
$sql =<<<SQL_EOF
LOCK TABLE
{{table}}lunas WRITE,
{{table}}rw WRITE,
{{table}}errors WRITE,
{{table}}messages WRITE,
{{table}}fleets WRITE,
{{table}}planets WRITE,
{{table}}galaxy WRITE,
{{table}}users WRITE
SQL_EOF;
//doquery($sql, ''); // FIXME: use transactions
$QryFleet = "SELECT * FROM {{table}} ";
$QryFleet .= "WHERE (";
$QryFleet .= "( ";
$QryFleet .= "`fleet_start_galaxy` = ". $planet['galaxy'] ." AND ";
$QryFleet .= "`fleet_start_system` = ". $planet['system'] ." AND ";
$QryFleet .= "`fleet_start_planet` = ". $planet['planet'] ." AND ";
$QryFleet .= "`fleet_start_type` = ". $planet['planet_type'] ." ";
$QryFleet .= ") OR ( ";
$QryFleet .= "`fleet_end_galaxy` = ". $planet['galaxy'] ." AND ";
$QryFleet .= "`fleet_end_system` = ". $planet['system'] ." AND ";
$QryFleet .= "`fleet_end_planet` = ". $planet['planet'] ." ) AND ";
$QryFleet .= "`fleet_end_type`= ". $planet['planet_type'] ." ) AND ";
$QryFleet .= "( `fleet_start_time` < '". time() ."' OR `fleet_end_time` < '". time() ."' );";
$fleetquery = doquery( $QryFleet, 'fleets' );
if (!$planet instanceof Legacies_Empire_Model_Planet) {var_dump($planet);}
foreach ($planet->getFleetCollection(Legacies::now()) as $CurrentFleet) {
var_dump($CurrentFleet);
switch ($CurrentFleet["fleet_mission"]) {
case Legacies_Empire::ID_MISSION_ATTACK:
// Attaquer
MissionCaseAttack ( $CurrentFleet );
break;
while ($CurrentFleet = mysql_fetch_array($fleetquery)) {
switch ($CurrentFleet["fleet_mission"]) {
case 1:
// Attaquer
MissionCaseAttack ( $CurrentFleet );
break;
case Legacies_Empire::ID_MISSION_TRANSPORT:
// Transporter
MissionCaseTransport ( $CurrentFleet );
break;
case 2:
// Attaque groupée
doquery ("DELETE FROM {{table}} WHERE `fleet_id` = '". $CurrentFleet['fleet_id'] ."';", 'fleets');
break;
case Legacies_Empire::ID_MISSION_STATION:
// Stationner
MissionCaseStay ( $CurrentFleet );
break;
case 3:
// Transporter
MissionCaseTransport ( $CurrentFleet );
break;
case Legacies_Empire::ID_MISSION_STATION_ALLY:
// Stationner chez un Allié
MissionCaseStayAlly ( $CurrentFleet );
break;
case 4:
// Stationner
MissionCaseStay ( $CurrentFleet );
break;
case Legacies_Empire::ID_MISSION_SPY:
// Flotte d'espionnage
MissionCaseSpy ( $CurrentFleet );
break;
case 5:
// Stationner chez un Allié
MissionCaseStayAlly ( $CurrentFleet );
break;
case Legacies_Empire::ID_MISSION_SETTLE_COLONY:
// Coloniser
MissionCaseColonisation ( $CurrentFleet );
break;
case 6:
// Flotte d'espionnage
MissionCaseSpy ( $CurrentFleet );
break;
case Legacies_Empire::ID_MISSION_RECYCLE:
// Recyclage
MissionCaseRecycling ( $CurrentFleet );
break;
case 7:
// Coloniser
MissionCaseColonisation ( $CurrentFleet );
break;
case Legacies_Empire::ID_MISSION_DESTROY:
// Detruire ??? dans le code ogame c'est 9 !!
MissionCaseDestruction ( $CurrentFleet );
break;
case 8:
// Recyclage
MissionCaseRecycling ( $CurrentFleet );
break;
case Legacies_Empire::ID_MISSION_EXPEDITION:
// Expeditions
MissionCaseExpedition ( $CurrentFleet );
break;
case 9:
// Detruire ??? dans le code ogame c'est 9 !!
MissionCaseDestruction ( $CurrentFleet );
break;
case Legacies_Empire::ID_MISSION_GROUP_ATTACK: // TODO: implement mission type
case Legacies_Empire::ID_MISSION_MISSILES: // TODO: implement mission type
default:
$CurrentFleet->delete();
break;
}
}
case 10:
// Missiles !!
break;
case 15:
// Expeditions
MissionCaseExpedition ( $CurrentFleet );
break;
default: {
doquery("DELETE FROM {{table}} WHERE `fleet_id` = '". $CurrentFleet['fleet_id'] ."';", 'fleets');
}
}
}
doquery("UNLOCK TABLES", "");
}
?>
//doquery("UNLOCK TABLES", ""); // FIXME: use transactions
}

View file

@ -34,6 +34,7 @@
* @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");
}
@ -45,6 +46,7 @@ function CheckAbandonMoonState ($lunarow) {
* @deprecated
*/
function CheckAbandonPlanetState (&$planet) {
trigger_error(sprintf('%s is deprecated', __FUNCTION__), E_USER_DEPRECATED);
if ($planet['destruyed'] <= time()) {
$id = $planet['id'];
doquery("DELETE FROM {{table}} WHERE id={$id}", 'planets');

View file

@ -33,6 +33,7 @@
* @deprecated
*/
function GalaxyLegendPopup () {
trigger_error(sprintf('%s is deprecated', __FUNCTION__), E_USER_DEPRECATED);
global $lang;
$Result = "<a href=# style=\"cursor: pointer;\"";

View file

@ -40,6 +40,7 @@
* @param unknown_type $PlanetType
*/
function GalaxyRowActions ( $GalaxyRow, $GalaxyRowPlanet, $GalaxyRowPlayer, $Galaxy, $System, $Planet, $PlanetType ) {
trigger_error(sprintf('%s is deprecated', __FUNCTION__), E_USER_DEPRECATED);
global $lang, $user, $dpath, $CurrentMIP, $CurrentSystem, $CurrentGalaxy;
// Icones action
$Result = "<th style=\"white-space: nowrap;\" width=125>";

View file

@ -40,6 +40,7 @@
* @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

View file

@ -40,6 +40,7 @@
* @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 = "<th style=\"white-space: nowrap;\" width=30>";

View file

@ -40,6 +40,7 @@
* @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

View file

@ -40,6 +40,7 @@
* @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)

View file

@ -40,6 +40,7 @@
* @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)

View file

@ -35,6 +35,7 @@
* @param unknown_type $GalaxyRow
*/
function GalaxyRowPos ( $Planet, $GalaxyRow ) {
trigger_error(sprintf('%s is deprecated', __FUNCTION__), E_USER_DEPRECATED);
// Pos
$Result = "<th width=30>";
$Result .= "<a href=\"#\"";

View file

@ -40,6 +40,7 @@
* @param unknown_type $PlanetType
*/
function GalaxyRowUser ( $GalaxyRow, $GalaxyRowPlanet, $GalaxyRowUser, $Galaxy, $System, $Planet, $PlanetType ) {
trigger_error(sprintf('%s is deprecated', __FUNCTION__), E_USER_DEPRECATED);
global $lang, $user;
// Joueur

View file

@ -1,64 +0,0 @@
<?php
/**
* This file is part of XNova:Legacies
*
* @license http://www.gnu.org/licenses/gpl-3.0.txt
* @see http://www.xnova-ng.org/
*
* Copyright (c) 2009-Present, XNova Support Team <http://www.xnova-ng.org>
* 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 <http://www.gnu.org/licenses/>.
*
* --> 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 $CurrentUser
* @param unknown_type $CurrentPlanet
* @param unknown_type $Element
* @param unknown_type $Incremental
* @param unknown_type $ForDestroy
*/
function GetBuildingPrice ($CurrentUser, $CurrentPlanet, $Element, $Incremental = true, $ForDestroy = false) {
global $pricelist, $resource;
if ($Incremental) {
$level = ($CurrentPlanet[$resource[$Element]]) ? $CurrentPlanet[$resource[$Element]] : $CurrentUser[$resource[$Element]];
}
$array = array('metal', 'crystal', 'deuterium', 'energy_max');
foreach ($array as $ResType) {
if ($Incremental) {
$cost[$ResType] = floor($pricelist[$Element][$ResType] * pow($pricelist[$Element]['factor'], $level));
} else {
$cost[$ResType] = floor($pricelist[$Element][$ResType]);
}
if ($ForDestroy == true) {
$cost[$ResType] = floor($cost[$ResType]) / 2;
$cost[$ResType] /= 2;
}
}
return $cost;
}
?>

View file

@ -1,86 +0,0 @@
<?php
/**
* This file is part of XNova:Legacies
*
* @license http://www.gnu.org/licenses/gpl-3.0.txt
* @see http://www.xnova-ng.org/
*
* Copyright (c) 2009-Present, XNova Support Team <http://www.xnova-ng.org>
* 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 <http://www.gnu.org/licenses/>.
*
* --> 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 $planet
* @param unknown_type $Element
*/
function GetBuildingTime ($user, $planet, $Element) {
global $pricelist, $resource, $reslist, $gameConfig;
$level = ($planet[$resource[$Element]]) ? $planet[$resource[$Element]] : $user[$resource[$Element]];
if (in_array($Element, $reslist['build'])) {
// Pour un batiment ...
$cost_metal = floor($pricelist[$Element]['metal'] * pow($pricelist[$Element]['factor'], $level));
$cost_crystal = floor($pricelist[$Element]['crystal'] * pow($pricelist[$Element]['factor'], $level));
$time = ((($cost_crystal) + ($cost_metal)) / $gameConfig['game_speed']) * (1 / ($planet[$resource['14']] + 1)) * pow(0.5, $planet[$resource['15']]);
$time = floor(($time * 60 * 60) * (1 - (($user['rpg_constructeur']) * 0.1)));
} elseif (in_array($Element, $reslist['tech'])) {
// Pour une recherche
$cost_metal = floor($pricelist[$Element]['metal'] * pow($pricelist[$Element]['factor'], $level));
$cost_crystal = floor($pricelist[$Element]['crystal'] * pow($pricelist[$Element]['factor'], $level));
$intergal_lab = $user[$resource[123]];
if ( $intergal_lab < "1" ) {
$lablevel = $planet[$resource['31']];
} elseif ( $intergal_lab >= "1" ) {
$empire = doquery("SELECT * FROM {{table}} WHERE id_owner='". $user[id] ."';", 'planets');
$NbLabs = 0;
while ($colonie = mysql_fetch_array($empire)) {
$techlevel[$NbLabs] = $colonie[$resource['31']];
$NbLabs++;
}
if ($intergal_lab >= "1") {
$lablevel = 0;
for ($lab = 1; $lab <= $intergal_lab; $lab++) {
asort($techlevel);
$lablevel += $techlevel[$lab - 1];
}
}
}
$time = (($cost_metal + $cost_crystal) / $gameConfig['game_speed']) / (($lablevel + 1) * 2);
$time = floor(($time * 60 * 60) * (1 - (($user['rpg_scientifique']) * 0.1)));
} elseif (in_array($Element, $reslist['defense'])) {
// Pour les defenses ou la flotte 'tarif fixe' durée adaptée a u niveau nanite et usine robot
$time = (($pricelist[$Element]['metal'] + $pricelist[$Element]['crystal']) / $gameConfig['game_speed']) * (1 / ($planet[$resource['21']] + 1)) * pow(1 / 2, $planet[$resource['15']]);
$time = floor(($time * 60 * 60) * (1 - (($user['rpg_defenseur']) * 0.375)));
} elseif (in_array($Element, $reslist['fleet'])) {
$time = (($pricelist[$Element]['metal'] + $pricelist[$Element]['crystal']) / $gameConfig['game_speed']) * (1 / ($planet[$resource['21']] + 1)) * pow(1 / 2, $planet[$resource['15']]);
$time = floor(($time * 60 * 60) * (1 - ($user['rpg_technocrate'] * 0.05)));
}
return max(1, $time);
}
?>

View file

@ -1,87 +0,0 @@
<?php
/**
* This file is part of XNova:Legacies
*
* @license http://www.gnu.org/licenses/gpl-3.0.txt
* @see http://www.xnova-ng.org/
*
* Copyright (c) 2009-Present, XNova Support Team <http://www.xnova-ng.org>
* 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 <http://www.gnu.org/licenses/>.
*
* --> 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 $planet
* @param unknown_type $Element
* @param unknown_type $level
*/
function GetBuildingTimeLevel ($user, $planet, $Element, $level) {
global $pricelist, $resource, $reslist, $gameConfig;
$level -= 1;
if (in_array($Element, $reslist['build'])) {
// Pour un batiment ...
$cost_metal = floor($pricelist[$Element]['metal'] * pow($pricelist[$Element]['factor'], $level));
$cost_crystal = floor($pricelist[$Element]['crystal'] * pow($pricelist[$Element]['factor'], $level));
$time = ((($cost_crystal) + ($cost_metal)) / $gameConfig['game_speed']) * (1 / ($planet[$resource['14']] + 1)) * pow(0.5, $planet[$resource['15']]);
$time = floor(($time * 60 * 60) * (1 - (($user['rpg_constructeur']) * 0.1)));
} elseif (in_array($Element, $reslist['tech'])) {
// Pour une recherche
$cost_metal = floor($pricelist[$Element]['metal'] * pow($pricelist[$Element]['factor'], $level));
$cost_crystal = floor($pricelist[$Element]['crystal'] * pow($pricelist[$Element]['factor'], $level));
$intergal_lab = $user[$resource[123]];
if ( $intergal_lab < "1" ) {
$lablevel = $planet[$resource['31']];
} elseif ( $intergal_lab >= "1" ) {
$empire = doquery("SELECT * FROM {{table}} WHERE id_owner='". $user[id] ."';", 'planets');
$NbLabs = 0;
while ($colonie = mysql_fetch_array($empire)) {
$techlevel[$NbLabs] = $colonie[$resource['31']];
$NbLabs++;
}
if ($intergal_lab >= "1") {
$lablevel = 0;
for ($lab = 1; $lab <= $intergal_lab; $lab++) {
asort($techlevel);
$lablevel += $techlevel[$lab - 1];
}
}
}
$time = (($cost_metal + $cost_crystal) / $gameConfig['game_speed']) / (($lablevel + 1) * 2);
$time = floor(($time * 60 * 60) * (1 - (($user['rpg_scientifique']) * 0.1)));
} elseif (in_array($Element, $reslist['defense'])) {
// Pour les defenses ou la flotte 'tarif fixe' dur<75>e adapt<70>e a u niveau nanite et usine robot
$time = (($pricelist[$Element]['metal'] + $pricelist[$Element]['crystal']) / $gameConfig['game_speed']) * (1 / ($planet[$resource['21']] + 1)) * pow(1 / 2, $planet[$resource['15']]);
$time = floor(($time * 60 * 60) * (1 - (($user['rpg_defenseur']) * 0.375)));
} elseif (in_array($Element, $reslist['fleet'])) {
$time = (($pricelist[$Element]['metal'] + $pricelist[$Element]['crystal']) / $gameConfig['game_speed']) * (1 / ($planet[$resource['21']] + 1)) * pow(1 / 2, $planet[$resource['15']]);
$time = floor(($time * 60 * 60) * (1 - (($user['rpg_technocrate']) * 0.05)));
}
return $time;
}
?>

View file

@ -1,75 +0,0 @@
<?php
/**
* This file is part of XNova:Legacies
*
* @license http://www.gnu.org/licenses/gpl-3.0.txt
* @see http://www.xnova-ng.org/
*
* Copyright (c) 2009-Present, XNova Support Team <http://www.xnova-ng.org>
* 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 <http://www.gnu.org/licenses/>.
*
* --> 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 $planet
* @param unknown_type $Element
* @param unknown_type $userfactor
*/
function GetElementPrice($user, $planet, $Element, $userfactor = true) {
global $pricelist, $resource, $lang;
if ($userfactor) {
$level = ($planet[$resource[$Element]]) ? $planet[$resource[$Element]] : $user[$resource[$Element]];
}
$is_buyeable = true;
$array = array(
'metal' => $lang["Metal"],
'crystal' => $lang["Crystal"],
'deuterium' => $lang["Deuterium"],
'energy_max' => $lang["Energy"]
);
$text = $lang['Requires'] . ": ";
foreach ($array as $ResType => $ResTitle) {
if ($pricelist[$Element][$ResType] != 0) {
$text .= $ResTitle . ": ";
if ($userfactor) {
$cost = floor($pricelist[$Element][$ResType] * pow($pricelist[$Element]['factor'], $level));
} else {
$cost = floor($pricelist[$Element][$ResType]);
}
if ($cost > $planet[$ResType]) {
$text .= "<b style=\"color:red;\"> <t title=\"-" . pretty_number ($cost - $planet[$ResType]) . "\">";
$text .= "<span class=\"noresources\">" . pretty_number($cost) . "</span></t></b> ";
$is_buyeable = false; //style="cursor: pointer;"
} else {
$text .= "<b style=\"color:lime;\"> <span class=\"noresources\">" . pretty_number($cost) . "</span></b> ";
}
}
}
return $text;
}
?>

View file

@ -1,47 +0,0 @@
<?php
/**
* This file is part of XNova:Legacies
*
* @license http://www.gnu.org/licenses/gpl-3.0.txt
* @see http://www.xnova-ng.org/
*
* Copyright (c) 2009-Present, XNova Support Team <http://www.xnova-ng.org>
* 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 <http://www.gnu.org/licenses/>.
*
* --> 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 $Element
* @param unknown_type $Count
*/
function GetElementRessources ( $Element, $Count ) {
global $pricelist;
$ResType['metal'] = ($pricelist[$Element]['metal'] * $Count);
$ResType['crystal'] = ($pricelist[$Element]['crystal'] * $Count);
$ResType['deuterium'] = ($pricelist[$Element]['deuterium'] * $Count);
return $ResType;
}
?>

View file

@ -36,6 +36,7 @@
*/
function GetMaxConstructibleElements ($Element, $Ressources) {
global $pricelist;
trigger_error(sprintf('%s is deprecated', __FUNCTION__), E_USER_DEPRECATED);
// On test les 4 Type de ressource pour voir si au moins on sait en construire 1
if ($pricelist[$Element]['metal'] != 0) {
$ResType_1_Needed = $pricelist[$Element]['metal'];

View file

@ -34,6 +34,7 @@
*/
function GetMissileRange () {
global $resource, $user;
trigger_error(sprintf('%s is deprecated', __FUNCTION__), E_USER_DEPRECATED);
if ($user[$resource[117]] > 0) {
$MissileRange = ($user[$resource[117]] * 5) - 1;

View file

@ -34,6 +34,7 @@
* @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 =

View file

@ -38,6 +38,7 @@
*/
function GetRestPrice ($user, $planet, $Element, $userfactor = true) {
global $pricelist, $resource, $lang;
trigger_error(sprintf('%s is deprecated', __FUNCTION__), E_USER_DEPRECATED);
if ($userfactor) {
$level = ($planet[$resource[$Element]]) ? $planet[$resource[$Element]] : $user[$resource[$Element]];

View file

@ -36,6 +36,7 @@
*/
function HandleTechnologieBuild ( &$CurrentPlanet, &$CurrentUser ) {
global $resource;
trigger_error(sprintf('%s is deprecated', __FUNCTION__), E_USER_DEPRECATED);
if ($CurrentUser['b_tech_planet'] != 0) {
// Y a une technologie en cours sur une de mes colonies

View file

@ -35,5 +35,6 @@
*/
function InsertBuildListScript($CallProgram)
{
trigger_error(sprintf('%s is deprecated', __FUNCTION__), E_USER_DEPRECATED);
return null;
}

View file

@ -34,6 +34,7 @@
*/
function InsertGalaxyScripts ( $CurrentPlanet ) {
global $lang;
trigger_error(sprintf('%s is deprecated', __FUNCTION__), E_USER_DEPRECATED);
$Script = "<div style=\"top: 10px;\" id=\"content\">";
$Script .= "<script language=\"JavaScript\">\n";
$Script .= "function galaxy_submit(value) {\n";

View file

@ -37,6 +37,7 @@
* @param unknown_type $Init
*/
function InsertJavaScriptChronoApplet ( $Type, $Ref, $Value, $Init ) {
trigger_error(sprintf('%s is deprecated', __FUNCTION__), E_USER_DEPRECATED);
if ($Init == true) {
$JavaString = "<script type=\"text/javascript\">\n";
$JavaString .= "function t". $Type . $Ref ."() {\n";

View file

@ -39,6 +39,7 @@
*/
function IsElementBuyable ($CurrentUser, $CurrentPlanet, $Element, $Incremental = true, $ForDestroy = false) {
global $pricelist, $resource;
trigger_error(sprintf('%s is deprecated', __FUNCTION__), E_USER_DEPRECATED);
if (IsVacationMode($CurrentUser)) {
return false;

View file

@ -37,6 +37,7 @@
function IsOfficierAccessible ($CurrentUser, $Officier) {
global $requirements, $resource, $pricelist;
trigger_error(sprintf('%s is deprecated', __FUNCTION__), E_USER_DEPRECATED);
if (isset($requirements[$Officier])) {
$enabled = true;
foreach($requirements[$Officier] as $ReqOfficier => $OfficierLevel) {

View file

@ -37,6 +37,7 @@
*/
function IsTechnologieAccessible($user, $planet, $element)
{
trigger_error(sprintf('%s is deprecated', __FUNCTION__), E_USER_DEPRECATED);
global $requirements, $resource;
if (isset($requirements[$element])) {

View file

@ -35,10 +35,11 @@
*/
function IsVacationMode($CurrentUser){
global $gameConfig;
trigger_error(sprintf('%s is deprecated', __FUNCTION__), E_USER_DEPRECATED);
if($CurrentUser['urlaubs_modus'] == 1){
$query = doquery("SELECT * FROM {{table}} WHERE id_owner = '{$CurrentUser['id']}'", 'planets');
while($id = mysql_fetch_array($query)){
while ($id = $query->fetch(PDO::FETCH_BOTH)){
doquery("UPDATE {{table}} SET
metal_perhour = '".$gameConfig['metal_basic_income']."',
crystal_perhour = '".$gameConfig['crystal_basic_income']."',

View file

@ -38,6 +38,7 @@
* @param unknown_type $TwoLines
*/
function MessageForm ($Title, $Message, $Goto = '', $Button = ' ok ', $TwoLines = false) {
trigger_error(sprintf('%s is deprecated', __FUNCTION__), E_USER_DEPRECATED);
$Form = "<center>";
$Form .= "<form action=\"". $Goto ."\" method=\"post\">";
$Form .= "<table width=\"519\">";

View file

@ -35,6 +35,7 @@
* @param unknown_type $IDAversaire
*/
function MipAttack ($NbreMip, $IDAversaire) {
trigger_error(sprintf('%s is deprecated', __FUNCTION__), E_USER_DEPRECATED);
$TechnoArme = doquery("SELECT * FROM {{table}} WHERE `id`='" . $user['id'] . "'", "users");
$InfoAdversaire = doquery("SELECT * FROM {{table}} WHERE `id`='" . $IDAversaire . "'", "planets", true);

View file

@ -34,6 +34,7 @@
*/
function MissionCaseAttack($FleetRow)
{
trigger_error(sprintf('%s is deprecated', __FUNCTION__), E_USER_DEPRECATED);
global $lang;
$pricelist = Legacies_Empire_Model_Game_Prices::getSingleton();

View file

@ -35,6 +35,7 @@
*/
function MissionCaseColonisation ( $FleetRow ) {
global $lang, $resource;
trigger_error(sprintf('%s is deprecated', __FUNCTION__), E_USER_DEPRECATED);
$iPlanetCount = mysql_result(doquery ("SELECT count(*) FROM {{table}} WHERE `id_owner` = '". $FleetRow['fleet_owner'] ."' AND `planet_type` = '1'", 'planets'), 0);
if ($FleetRow['fleet_mess'] == 0) {

View file

@ -36,6 +36,7 @@
function MissionCaseDestruction($FleetRow)
{
global $user, $pricelist, $lang, $resource, $CombatCaps, $gameConfig;
trigger_error(sprintf('%s is deprecated', __FUNCTION__), E_USER_DEPRECATED);
includeLang('system');

View file

@ -35,6 +35,7 @@
*/
function MissionCaseExpedition ( $FleetRow ) {
global $lang, $resource, $pricelist;
trigger_error(sprintf('%s is deprecated', __FUNCTION__), E_USER_DEPRECATED);
$FleetOwner = $FleetRow['fleet_owner'];
$MessSender = $lang['sys_mess_qg'];

View file

@ -34,6 +34,7 @@
*/
function MissionCaseRecycling ($FleetRow) {
global $pricelist, $lang;
trigger_error(sprintf('%s is deprecated', __FUNCTION__), E_USER_DEPRECATED);
if ($FleetRow["fleet_mess"] == "0") {
if ($FleetRow['fleet_start_time'] <= time()) {

View file

@ -35,6 +35,7 @@
*/
function MissionCaseSpy($FleetRow)
{
trigger_error(sprintf('%s is deprecated', __FUNCTION__), E_USER_DEPRECATED);
global $lang;
$resource = Legacies_Empire_Model_Game_FieldsAlias::getSingleton();

View file

@ -35,6 +35,7 @@
*/
function MissionCaseStay ( $FleetRow ) {
global $lang, $resource;
trigger_error(sprintf('%s is deprecated', __FUNCTION__), E_USER_DEPRECATED);
if ($FleetRow['fleet_mess'] == 0) {
if ($FleetRow['fleet_start_time'] <= time()) {

View file

@ -35,6 +35,7 @@
*/
function MissionCaseStayAlly ( $FleetRow ) {
global $lang;
trigger_error(sprintf('%s is deprecated', __FUNCTION__), E_USER_DEPRECATED);
$QryStartPlanet = "SELECT * FROM {{table}} ";
$QryStartPlanet .= "WHERE ";

View file

@ -35,6 +35,7 @@
*/
function MissionCaseTransport ( $FleetRow ) {
global $lang;
trigger_error(sprintf('%s is deprecated', __FUNCTION__), E_USER_DEPRECATED);
$QryStartPlanet = "SELECT * FROM {{table}} ";
$QryStartPlanet .= "WHERE ";

View file

@ -37,6 +37,7 @@
*/
function PlanetResourceUpdate($CurrentUser, &$CurrentPlanet, $UpdateTime)
{
trigger_error(sprintf('%s is deprecated', __FUNCTION__), E_USER_DEPRECATED);
$planet = Legacies_Empire_Model_User::factory($CurrentPlanet['id']);
/*

View file

@ -37,6 +37,7 @@
*/
function RemoveBuildingFromQueue ( &$CurrentPlanet, $CurrentUser, $QueueID ) {
trigger_error(sprintf('%s is deprecated', __FUNCTION__), E_USER_DEPRECATED);
if ($QueueID > 1) {
$CurrentQueue = $CurrentPlanet['b_building_id'];
if ($CurrentQueue != 0) {

View file

@ -40,6 +40,7 @@ function ResearchBuildingPage (&$CurrentPlanet, $CurrentUser, $InResearch, $TheP
{
global $lang, $resource, $reslist, $dpath, $gameConfig, $_GET;
trigger_error(sprintf('%s is deprecated', __FUNCTION__), E_USER_DEPRECATED);
$NoResearchMessage = "";
$bContinue = true;

View file

@ -34,6 +34,7 @@
* @param unknown_type $UserID
*/
function ResetThisFuckingCheater ( $UserID ) {
trigger_error(sprintf('%s is deprecated', __FUNCTION__), E_USER_DEPRECATED);
$TheUser = doquery ("SELECT * FROM {{table}} WHERE `id` = '". $UserID ."';", 'users', true);
$UserPlanet = doquery ("SELECT `name` FROM {{table}} WHERE `id` = '". $TheUser['id_planet']."';", 'planets', true);
DeleteSelectedUser ( $UserID );

View file

@ -36,6 +36,7 @@
*/
function RestoreFleetToPlanet ( $FleetRow, $Start = true ) {
global $resource;
trigger_error(sprintf('%s is deprecated', __FUNCTION__), E_USER_DEPRECATED);
$FleetRecord = explode(";", $FleetRow['fleet_array']);
$QryUpdFleet = "";

View file

@ -34,6 +34,7 @@
* @param unknown_type $seconds
*/
function RevisionTime ($seconds) {
trigger_error(sprintf('%s is deprecated', __FUNCTION__), E_USER_DEPRECATED);
$days = floor($seconds / 86400);
$hours = (floor(($seconds % 86400) / 3600));
$minutes = floor(($seconds % 3600) / 60);

View file

@ -34,6 +34,7 @@
* @param unknown_type $mail
*/
function sendnewpassword($mail){
trigger_error(sprintf('%s is deprecated', __FUNCTION__), E_USER_DEPRECATED);
$ExistMail = doquery("SELECT `email` FROM {{table}} WHERE `email` = '". $mail ."' LIMIT 1;", 'users', true);

View file

@ -41,6 +41,7 @@
*/
function SendSimpleMessage ( $Owner, $Sender, $Time, $Type, $From, $Subject, $Message) {
global $messfields;
trigger_error(sprintf('%s is deprecated', __FUNCTION__), E_USER_DEPRECATED);
if ($Time == '') {
$Time = time();

View file

@ -36,6 +36,7 @@
*/
function SetNextQueueElementOnTop ( &$CurrentPlanet, $CurrentUser ) {
global $lang, $resource;
trigger_error(sprintf('%s is deprecated', __FUNCTION__), E_USER_DEPRECATED);
// Garde fou ... Si le temps de construction n'est pas 0 on ne fait rien !!!
if ($CurrentPlanet['b_building'] == 0) {

View file

@ -35,6 +35,7 @@
*/
function SetSelectedPlanet ( &$CurrentUser )
{
trigger_error(sprintf('%s is deprecated', __FUNCTION__), E_USER_DEPRECATED);
if (!isset($_GET['cp']) || !isset($_GET['re'])) {
return;
}

View file

@ -35,6 +35,7 @@
*/
function ShowBuildingQueue ( $CurrentPlanet, $CurrentUser ) {
global $lang;
trigger_error(sprintf('%s is deprecated', __FUNCTION__), E_USER_DEPRECATED);
$CurrentQueue = $CurrentPlanet['b_building_id'];
$QueueID = 0;

View file

@ -39,6 +39,7 @@
*/
function ShowGalaxyFooter ( $Galaxy, $System, $CurrentMIP, $CurrentRC, $CurrentSP) {
global $lang, $maxfleet_count, $fleetmax, $planetcount;
trigger_error(sprintf('%s is deprecated', __FUNCTION__), E_USER_DEPRECATED);
$Result = "";
if ($planetcount == 1) {

View file

@ -39,6 +39,7 @@
*/
function ShowGalaxyMISelector ( $Galaxy, $System, $Planet, $Current, $MICount ) {
global $lang;
trigger_error(sprintf('%s is deprecated', __FUNCTION__), E_USER_DEPRECATED);
$Result = "<form action=\"raketenangriff.php?c=".$Current."&mode=2&galaxy=".$Galaxy."&system=".$System."&planet=".$Planet."\" method=\"POST\">";
$Result .= "<tr>";

View file

@ -36,6 +36,7 @@
*/
function ShowGalaxyRows ($Galaxy, $System) {
global $lang, $planetcount, $CurrentRC, $dpath, $user;
trigger_error(sprintf('%s is deprecated', __FUNCTION__), E_USER_DEPRECATED);
$Result = "";
for ($Planet = 1; $Planet < 16; $Planet++) {

View file

@ -36,6 +36,7 @@
*/
function ShowGalaxySelector ( $Galaxy, $System ) {
global $lang;
trigger_error(sprintf('%s is deprecated', __FUNCTION__), E_USER_DEPRECATED);
if ($Galaxy > MAX_GALAXY_IN_WORLD) {
$Galaxy = MAX_GALAXY_IN_WORLD;

View file

@ -36,6 +36,7 @@
*/
function ShowGalaxyTitles ( $Galaxy, $System ) {
global $lang;
trigger_error(sprintf('%s is deprecated', __FUNCTION__), E_USER_DEPRECATED);
$Result = "\n";
$Result .= "<tr>";

View file

@ -36,6 +36,7 @@
*/
function ShowTopNavigationBar ( $CurrentUser, $CurrentPlanet ) {
global $lang, $_GET;
trigger_error(sprintf('%s is deprecated', __FUNCTION__), E_USER_DEPRECATED);
// debug_print_backtrace();
@ -56,7 +57,7 @@ function ShowTopNavigationBar ( $CurrentUser, $CurrentPlanet ) {
// Genearation de la combo des planetes du joueur
$parse['planetlist'] = '';
$ThisUsersPlanets = SortUserPlanets ( $CurrentUser );
while ($CurPlanet = mysql_fetch_array($ThisUsersPlanets)) {
while ($CurPlanet = $ThisUsersPlanets->fetch(PDO::FETCH_BOTH)) {
if ($CurPlanet["destruyed"] == 0) {
$parse['planetlist'] .= "\n<option ";
if ($CurPlanet['id'] == $CurrentUser['current_planet']) {

View file

@ -36,6 +36,7 @@
function SortUserPlanets ( $CurrentUser ) {
$Order = ( $CurrentUser['planet_sort_order'] == 1 ) ? "DESC" : "ASC" ;
$Sort = $CurrentUser['planet_sort'];
trigger_error(sprintf('%s is deprecated', __FUNCTION__), E_USER_DEPRECATED);
$QryPlanets = "SELECT `id`, `name`, `galaxy`, `system`, `planet`, `planet_type` FROM {{table}} WHERE `id_owner` = '". $CurrentUser['id'] ."' ORDER BY ";
if ( $Sort == 0 ) {

View file

@ -37,6 +37,7 @@
*/
function SpyTarget ( $TargetPlanet, $Mode, $TitleString ) {
global $lang, $resource;
trigger_error(sprintf('%s is deprecated', __FUNCTION__), E_USER_DEPRECATED);
$LookAtLoop = true;
if ($Mode == 0) {

View file

@ -36,6 +36,7 @@
*/
function StoreGoodsToPlanet ( $FleetRow, $Start = false ) {
global $resource;
trigger_error(sprintf('%s is deprecated', __FUNCTION__), E_USER_DEPRECATED);
$QryUpdatePlanet = "UPDATE {{table}} SET ";

View file

@ -35,6 +35,7 @@
* @param unknown_type $CurrentUser
*/
function UpdatePlanetBatimentQueueList ( &$CurrentPlanet, &$CurrentUser ) {
trigger_error(sprintf('%s is deprecated', __FUNCTION__), E_USER_DEPRECATED);
$RetValue = false;
if ( $CurrentPlanet['b_building_id'] != 0 ) {
while ( $CurrentPlanet['b_building_id'] != 0 ) {