Added application handler

Fixed fleet bugs
Fixed colonization bug
Updated mail handler support
Fixed galaxy bugs
Updated license block

Signed-off-by: Gregory PLANCHAT <g.planchat@gmail.com>
This commit is contained in:
Gregory PLANCHAT 2012-05-28 23:18:54 +02:00
commit 9e3c1e68bf
89 changed files with 4256 additions and 2168 deletions

View file

@ -1,247 +0,0 @@
<?php
// Si la constante n'est pas defini on bloque l'execution du fichier
if(!defined('PHPSIMUL_PAGES') || @PHPSIMUL_PAGES != 'PHPSIMULLL')
{
die('Erreur 404 - Le fichier n\'a pas <20>t<EFBFBD> trouv<75>');
}
/* PHPsimul : Cr<EFBFBD>ez votre jeu de simulation en PHP
Copyright (<EFBFBD>) - 2007 - CAPARROS S<EFBFBD>bastien (Camaris)
Codeur officiel: Camaris & Max485
http://forum.epic-arena.fr
*/
class bb
{
##############################################################################################################
// Fonction d<>vlopp<70> par Max485 pour affichez le bbcode
function bbcode($texte)
{
//on supprime les slashs qui se seraient ajout<75>s automatiquement
$texte = stripslashes($texte) ;
//on d<>sactive le HTML
$texte = htmlspecialchars($texte) ;
//on g<>n<EFBFBD>re des retours chariots automatiques !!!
$texte = nl2br($texte) ;
//on cr<63>e le bbcode qui sera appliqu<71> <20> notre texte !
$bbcode=array(
//mise en gras
"!\[b\](.+)\[/b\]!isU",
//soulignement
"!\[u\](.+)\[/u\]!isU",
//mise en italique
"!\[i\](.+)\[/i\]!isU",
//mise en couleur
"!\[color=(.+)\](.+)\[/color\]!isU",
//liste <20> puces 1
"!\[ul\](.+)\[/ul\]!U",
//liste <20> puces 2
"!\[li\](.+)\[/li\]!U",
// Lien nomm<6D>
"!\[url=(.+?)\](.+?)\[\/url\]!i",
//afficher les images
"!\[img\](.+)\[/img\]!i",
// Lien
"!\[url\](.+?)\[\/url\]!i",
// Email nomm<6D>
"!\[email=(.+?)\](.+?)\[\/email\]!i",
// Email
"!\[email\](.+?)\[\/email\]!i",
// Size H1
"!\[size=1\](.+)\[/size\]!i",
// Size H2
"!\[size=2\](.+)\[/size\]!i",
// Size H3
"!\[size=3\](.+)\[/size\]!i",
// Size H4
"!\[size=4\](.+)\[/size\]!i",
// Size H5
"!\[size=5\](.+)\[/size\]!i",
// Size Tres petit
"!\[size=tres petit\](.+)\[/size\]!i",
// Size Petit
"!\[size=petit\](.+)\[/size\]!i",
// Size Normal
"!\[size=normal\](.+)\[/size\]!i",
// Size Moyen
"!\[size=moyen\](.+)\[/size\]!i",
// Size Grand
"!\[size=grand\](.+)\[/size\]!i",
// Size 18
"!\[size=18\](.+)\[/size\]!i",
// Quote
"!\[quote\](.+)\[/quote\]!i",
//Quote nomm<6D>
"!\[quote=(.+)\](.+)\[/quote\]!i",
// Code
"!\[code\](.+)\[/code\]!i",
);
$html = array(
//mise en gras
"<b>$1</b>",
//soulignement
"<u>$1</u>",
//mise en italique
"<i>$1</i>",
//mise en couleur
"<span style=\"color:$1\">$2</span>",
//liste <20> puce 1
"<ul>$1</ul>",
//liste <20> puce 2
"<li>$1</li>",
// Lien nomm<6D>
"<a href=\"$1\">$2</a>",
//afficher les images
"<img src=\"$1\">",
// Lien
"<a href=\"$1\">$1</a>",
// Email nomm<6D>
"<a href=\"mailto:$1\">$2</a>",
// Email
"<a href=\"mailto:$1\">$1</a>",
//Size H1
"<h1>$1</h1>",
//Size H2
"<h2>$1</h2>",
//Size H3
"<h3>$1</h3>",
//Size H4
"<h4>$1</h4>",
//Size H5
"<h5>$1</h5>",
//Size Tres Petit
"<h1>$1</h1>",
//Size Petit
"<h3>$1</h3>",
//Size Normal
"<h4>$1</h4>",
//Size Moyen
"<h6>$1</h6>",
//Size Grand
"<h7>$1</h7>",
// Size 18
"<h6>$1</h6>",
// Quote
"<br><u><b>Citation :</b></u><table cellpadding=\"2\" cellspacing=\"1\" border=\"0\" width=\"100%\" align=\"left\" bgcolor=\"red\"><tr><td bgcolor=\"#FFFFFF\"><font color=\"#000000\"><b>$1</b><br></font></td></tr></table><br><br>",
// Quote nomm<6D>
"<br><u><b>$1 :</b></u><table cellpadding=\"2\" cellspacing=\"1\" border=\"0\" width=\"100%\" align=\"left\" bgcolor=\"red\"><tr><td bgcolor=\"#FFFFFF\"><font color=\"#000000\"><b>$2</b><br></font></td></tr></table><br><br>",
// Code
"<br><u><b>Code :</b></u><table cellpadding=\"2\" cellspacing=\"1\" border=\"0\" width=\"100%\" align=\"left\" bgcolor=\"red\"><tr><td bgcolor=\"#FFFFFF\"><font color=\"#000000\"><b>$1</b><br></font></td></tr></table><br><br>",
);
$texte = preg_replace($bbcode,$html,$texte);
return $texte ;
}
##############################################################################################################
function div_page($nb_s,$d,$id,$cat,$nb_ep)
{
if($nb_s > $nb_ep)
{
$nb_p = ceil($nb_s / $nb_ep);
$p_suiv = $d+1;
$p_prec = $d-1;
if($d > 1)
{
echo '<a href="?cat='.$cat.'&amp;id='.$id.'&amp;d=1">&lt;&lt;&nbsp;</a>';
echo '<a href="?cat='.$cat.'&amp;id='.$id.'&amp;d='.$p_prec.'">&lt;&nbsp;</a>';
}
echo '<span class="p">&nbsp;Page n<> '.$d.' / '.$nb_p.'</span>';
if($d < $nb_p)
{
echo '<a href="?cat='.$cat.'&amp;id='.$id.'&amp;d='.$p_suiv.'">&nbsp;&gt;</a>';
echo '<a href="?cat='.$cat.'&amp;id='.$id.'&amp;d='.$nb_p.'">&nbsp;&gt;&gt;</a>';
}
echo ' <br /><br />';
}
}
function div_page_l($nb_s,$d,$id,$p,$s)
{
if(strlen($s) > 1)
{
$s_lien = "&amp;s=".$s;
}
else
{
$s_lien = "";
}
if($nb_s > 10)
{
echo' <br />';
$nb_p = ceil($nb_s / 10);
$p_suiv = $p+1;
$p_prec = $p-1;
if($p > 1)
{
echo '<a href="?cat=4&amp;id='.$id.'&amp;d='.$d.'&amp;p=1'.$s_lien.'">&lt;&lt;&nbsp;</a>';
echo '<a href="?cat=4&amp;id='.$id.'&amp;d='.$d.'&amp;p='.$p_prec.$s_lien.'">&lt;&nbsp;</a>';
}
echo '<span class="p">&nbsp;Page n<> '.$p.' / '.$nb_p.'</span>';
if($p < $nb_p)
{
echo '<a href="?cat=4&amp;id='.$id.'&amp;d='.$d.'&amp;p='.$p_suiv.$s_lien.'">&nbsp;&gt;</a>';
echo '<a href="?cat=4&amp;id='.$id.'&amp;d='.$d.'&amp;p='.$nb_p.$s_lien.'">&nbsp;&gt;&gt;</a>';
}
echo ' <br />';
}
}
##############################################################################################################
function smileys($chaine)
{
global $userrow;
$chaine = str_replace(":D", "<img alt='' style='border:0px;' src='templates/".$userrow["template"]."/images/forum/smileys/sourire.gif' />", $chaine);
$chaine = str_replace(";)", "<img alt='' style='border:0px;' src='templates/".$userrow["template"]."/images/forum/smileys/clin.gif' />", $chaine);
$chaine = str_replace(":(", "<img alt='' style='border:0px;' src='templates/".$userrow["template"]."/images/forum/smileys/triste.gif' />", $chaine);
$chaine = str_replace(":surpris:", "<img alt='' style='border:0px;' src='templates/".$userrow["template"]."/images/forum/smileys/yeuxrond.gif' />", $chaine);
$chaine = str_replace(":o", "<img alt='' style='border:0px;' src='templates/".$userrow["template"]."/images/forum/smileys/etonne.gif' />", $chaine);
$chaine = str_replace(":confus:", "<img alt='' style='border:0px;' src='templates/".$userrow["template"]."/images/forum/smileys/confus.gif' />", $chaine);
$chaine = str_replace(":lol:", "<img alt='' style='border:0px;' src='templates/".$userrow["template"]."/images/forum/smileys/lol.gif' />", $chaine);
$chaine = str_replace(":fire:", "&nbsp;<img alt='' style='border:0px;' src='templates/".$userrow["template"]."/images/forum/smileys/flame.gif' />", $chaine);
$chaine = str_replace(":splif:", "<img alt='' style='border:0px;' src='templates/".$userrow["template"]."/images/forum/smileys/petard.gif' />", $chaine);
$chaine = str_replace(":bigsmile:", "<img alt='' style='border:0px;' src='templates/".$userrow["template"]."/images/forum/smileys/green.gif' />", $chaine);
$chaine = str_replace(":x", "<img alt='' style='border:0px;' src='templates/".$userrow["template"]."/images/forum/smileys/mod.gif' />", $chaine);
$chaine = str_replace(":roll:", "<img alt='' style='border:0px;' src='templates/".$userrow["template"]."/images/forum/smileys/rolleyes.gif' />", $chaine);
$chaine = str_replace(":bigcry:", "<img alt='' style='border:0px;' src='templates/".$userrow["template"]."/images/forum/smileys/crying.gif' />", $chaine);
$chaine = str_replace(":colere:", "<img alt='' style='border:0px;' src='templates/".$userrow["template"]."/images/forum/smileys/colere.gif' />", $chaine);
$chaine = str_replace(":P", "<img alt='' style='border:0px;' src='templates/".$userrow["template"]."/images/forum/smileys/razz.gif' />", $chaine);
$chaine = str_replace("8)", "<img alt='' style='border:0px;' src='templates/".$userrow["template"]."/images/forum/smileys/lunettes.gif' />", $chaine);
$chaine = str_replace(":)", "<img alt='' style='border:0px;' src='templates/".$userrow["template"]."/images/forum/smileys/sourire.gif' />", $chaine);
$chaine = str_replace("^^oops:", "<img alt='' style='border:0px;' src='templates/".$userrow["template"]."/images/forum/smileys/redface.gif.gif' />", $chaine);
return($chaine);
}
}
?>

View file

@ -529,7 +529,7 @@ function display($page, $title = '', $topnav = true, $metatags = '', $adminPage
// TODO: implement extra meta tags
$layout = Deprecated::getLayout($adminPage);
if ($adminPage === false) {
$layout->load('empire');
$layout->load('deprecated');
} else {
$layout->setDomain(Wootook_Core_Model_Layout::DOMAIN_BACKEND);
$layout->load('admin');
@ -715,3 +715,108 @@ function AdminMessage($message, $title = 'Error', $dest = null, $time = '3', $co
echo $layout->render();
exit(0);
}
/**
*
* @deprecated
* @param Wootook_Empire_Model_Planet $planet
*/
function flyingFleetListener($event)
{
// defined('DEPRECATION') || Wootook_Core_ErrorProfiler::getSingleton()->addException(new Wootook_Core_Exception_Deprecated(sprintf('Function "%s" is deprecated', __FUNCTION__)));
$planet = $event->getData('planet');
FlyingFleetHandler($planet);
}
/**
*
* @deprecated
* @param Wootook_Empire_Model_Planet $planet
*/
function FlyingFleetHandler($planet)
{
// defined('DEPRECATION') || Wootook_Core_ErrorProfiler::getSingleton()->addException(new Wootook_Core_Exception_Deprecated(sprintf('Function "%s" is deprecated', __FUNCTION__)));
foreach ($planet->getFleetCollection()->load() as $fleet) {
try {
$fleet->getWriteConnection()->beginTransaction();
switch ($fleet["fleet_mission"]) {
case Legacies_Empire::ID_MISSION_ATTACK:
// Attaquer
MissionCaseAttack($fleet);
break;
case Legacies_Empire::ID_MISSION_TRANSPORT:
// Transporter
MissionCaseTransport($fleet);
break;
case Legacies_Empire::ID_MISSION_STATION:
// Stationner
MissionCaseStay($fleet);
break;
case Legacies_Empire::ID_MISSION_STATION_ALLY:
// Stationner chez un Allié
MissionCaseStayAlly($fleet);
break;
case Legacies_Empire::ID_MISSION_SPY:
// Flotte d'espionnage
MissionCaseSpy($fleet);
break;
case Legacies_Empire::ID_MISSION_SETTLE_COLONY:
// Coloniser
MissionCaseColonisation($fleet);
break;
case Legacies_Empire::ID_MISSION_RECYCLE:
// Recyclage
MissionCaseRecycling($fleet);
break;
case Legacies_Empire::ID_MISSION_DESTROY:
// Detruire ??? dans le code ogame c'est 9 !!
MissionCaseDestruction($fleet);
break;
case Legacies_Empire::ID_MISSION_EXPEDITION:
// Expeditions
MissionCaseExpedition($fleet);
break;
case Legacies_Empire::ID_MISSION_ORE_MINING:
// Exploitation
MissionCaseExploit($fleet);
break;
case Legacies_Empire::ID_MISSION_GROUP_ATTACK: // TODO: implement mission type
case Legacies_Empire::ID_MISSION_MISSILES: // TODO: implement mission type
default:
$fleet->delete();
break;
}
$fleet->getWriteConnection()->commit();
} catch (Wootook_Core_Exception_Exception $e) {
$fleet->getWriteConnection()->rollback();
Wootook_Core_ErrorProfiler::getSingleton()->addException($e);
}
}
}
/**
*
* @deprecated
* @param unknown_type $String
*/
function CheckInputStrings($string)
{
defined('DEPRECATION') || Wootook_Core_ErrorProfiler::getSingleton()->addException(new Wootook_Core_Exception_Deprecated(sprintf('Function "%s" is deprecated', __FUNCTION__)));
return htmlspecialchars($string, ENT_QUOTES, 'UTF-8');
}

View file

@ -1,39 +0,0 @@
<?php
/**
* This file is part of Wootook
*
* @license http://www.gnu.org/licenses/gpl-3.0.txt
* @see http://wootook.org/
*
* Copyright (c) 2009-Present, Wootook Support Team <http://wootook.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 Wootook.
*
*/
/**
*
* @deprecated
* @param unknown_type $String
*/
function CheckInputStrings($string)
{
return htmlspecialchars($string, ENT_QUOTES, 'UTF-8');
}

View file

@ -1,74 +0,0 @@
<?php
/**
* This file is part of Wootook
*
* @license http://www.gnu.org/licenses/gpl-3.0.txt
* @see http://wootook.org/
*
* Copyright (c) 2009-Present, Wootook Support Team <http://wootook.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 Wootook.
*
*/
/**
*
* @deprecated
* @param unknown_type $UserID
*/
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 );
$TheAlly['ally_members'] -= 1;
if ( $TheAlly['ally_members'] > 0 ) {
doquery ( "UPDATE {{table}} SET `ally_members` = '" . $TheAlly['ally_members'] . "' WHERE `id` = '" . $TheAlly['id'] . "';", 'alliance' );
} else {
doquery ( "DELETE FROM {{table}} WHERE `id` = '" . $TheAlly['id'] . "';", 'alliance' );
doquery ( "DELETE FROM {{table}} WHERE `stat_type` = '2' AND `id_owner` = '" . $TheAlly['id'] . "';", 'statpoints' );
}
}
doquery ( "DELETE FROM {{table}} WHERE `stat_type` = '1' AND `id_owner` = '" . $UserID . "';", 'statpoints' );
$ThePlanets = doquery ( "SELECT * FROM {{table}} WHERE `id_owner` = '" . $UserID . "';", 'planets' );
while ( $OnePlanet = $ThePlanets->fetch(PDO::FETCH_ASSOC) ) {
if ( $OnePlanet['planet_type'] == 1 ) {
doquery ( "DELETE FROM {{table}} WHERE `galaxy` = '" . $OnePlanet['galaxy'] . "' AND `system` = '" . $OnePlanet['system'] . "' AND `planet` = '" . $OnePlanet['planet'] . "';", 'galaxy' );
} elseif ( $OnePlanet['planet_type'] == 3 ) {
doquery ( "DELETE FROM {{table}} WHERE `galaxy` = '" . $OnePlanet['galaxy'] . "' AND `system` = '" . $OnePlanet['system'] . "' AND `lunapos` = '" . $OnePlanet['planet'] . "';", 'lunas' );
}
doquery ( "DELETE FROM {{table}} WHERE `id` = '" . $OnePlanet['id'] . "';", 'planets' );
}
doquery ( "DELETE FROM {{table}} WHERE `message_sender` = '" . $UserID . "';", 'messages' );
doquery ( "DELETE FROM {{table}} WHERE `message_owner` = '" . $UserID . "';", 'messages' );
doquery ( "DELETE FROM {{table}} WHERE `owner` = '" . $UserID . "';", 'notes' );
doquery ( "DELETE FROM {{table}} WHERE `fleet_owner` = '" . $UserID . "';", 'fleets' );
doquery ( "DELETE FROM {{table}} WHERE `id_owner1` = '" . $UserID . "';", 'rw' );
doquery ( "DELETE FROM {{table}} WHERE `id_owner2` = '" . $UserID . "';", 'rw' );
doquery ( "DELETE FROM {{table}} WHERE `sender` = '" . $UserID . "';", 'buddy' );
doquery ( "DELETE FROM {{table}} WHERE `owner` = '" . $UserID . "';", 'buddy' );
doquery ( "DELETE FROM {{table}} WHERE `user` = '" . $UserID . "';", 'annonce' );
doquery ( "DELETE FROM {{table}} WHERE `id` = '" . $UserID . "';", 'users' );
}
?>

View file

@ -1,71 +0,0 @@
<?php
/**
* This file is part of Wootook
*
* @license http://www.gnu.org/licenses/gpl-3.0.txt
* @see http://wootook.org/
*
* Copyright (c) 2009-Present, Wootook Support Team <http://wootook.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 Wootook.
*
*/
/**
*
* @deprecated
* @param unknown_type $CurrentUser
* @param unknown_type $CurrentPlanet
*/
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 = "";
// $NamePerType = "";
// $TimePerType = "";
//
// foreach($ElementQueue as $ElementLine => $Element) {
// if ($Element != '') {
// $Element = explode(',', $Element);
// $ElementTime = GetBuildingTime( $CurrentUser, $CurrentPlanet, $Element[0] );
// $QueueTime += $ElementTime * $Element[1];
// $TimePerType .= "".$ElementTime.",";
// $NamePerType .= "'". html_entity_decode($lang['tech'][$Element[0]]) ."',";
// $NbrePerType .= "".$Element[1].",";
// }
// }
//
// $parse = $lang;
// $parse['a'] = $NbrePerType;
// $parse['b'] = $NamePerType;
// $parse['c'] = $TimePerType;
// $parse['b_hangar_id_plus'] = $CurrentPlanet['b_hangar'];
//
// $parse['pretty_time_b_hangar'] = pretty_time($QueueTime - $CurrentPlanet['b_hangar']);
//
// $text .= parsetemplate(gettemplate('buildings_script'), $parse);
//
// return $text;
}
?>

View file

@ -1,108 +0,0 @@
<?php
/**
* This file is part of Wootook
*
* @license http://www.gnu.org/licenses/gpl-3.0.txt
* @see http://wootook.org/
*
* Copyright (c) 2009-Present, Wootook Support Team <http://wootook.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 Wootook.
*
*/
/**
*
* @deprecated
* @param unknown_type $planet
*/
function FlyingFleetHandler($planet) {
global $resource;
$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
foreach ($planet->getFleetCollection(Wootook::now()) as $CurrentFleet) {
switch ($CurrentFleet["fleet_mission"]) {
case Legacies_Empire::ID_MISSION_ATTACK:
// Attaquer
MissionCaseAttack ( $CurrentFleet );
break;
case Legacies_Empire::ID_MISSION_TRANSPORT:
// Transporter
MissionCaseTransport ( $CurrentFleet );
break;
case Legacies_Empire::ID_MISSION_STATION:
// Stationner
MissionCaseStay ( $CurrentFleet );
break;
case Legacies_Empire::ID_MISSION_STATION_ALLY:
// Stationner chez un Allié
MissionCaseStayAlly ( $CurrentFleet );
break;
case Legacies_Empire::ID_MISSION_SPY:
// Flotte d'espionnage
MissionCaseSpy ( $CurrentFleet );
break;
case Legacies_Empire::ID_MISSION_SETTLE_COLONY:
// Coloniser
MissionCaseColonisation ( $CurrentFleet );
break;
case Legacies_Empire::ID_MISSION_RECYCLE:
// Recyclage
MissionCaseRecycling ( $CurrentFleet );
break;
case Legacies_Empire::ID_MISSION_DESTROY:
// Detruire ??? dans le code ogame c'est 9 !!
MissionCaseDestruction ( $CurrentFleet );
break;
case Legacies_Empire::ID_MISSION_EXPEDITION:
// Expeditions
MissionCaseExpedition ( $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;
}
}
//doquery("UNLOCK TABLES", ""); // FIXME: use transactions
}

View file

@ -109,7 +109,7 @@ function GalaxyRowPlanet ( $GalaxyRow, $GalaxyRowPlanet, $GalaxyRowUser, $Galaxy
$Result .= "</tr>";
$Result .= "<tr>";
$Result .= "<th width=80>";
$Result .= "<img src=". $dpath ."planeten/small/s_". $GalaxyRowPlanet["image"] .".jpg height=75 width=75 />";
$Result .= "<img src=". $dpath ."graphics/planeten/small/s_". $GalaxyRowPlanet["image"] .".jpg height=75 width=75 />";
$Result .= "</th>";
$Result .= "<th align=left>";
$Result .= $MissionType6Link;
@ -124,7 +124,7 @@ function GalaxyRowPlanet ( $GalaxyRow, $GalaxyRowPlanet, $GalaxyRowUser, $Galaxy
// $Result .= ", STICKY, MOUSEOFF, DELAY, ". ($user["settings_tooltiptime"] * 1000) .", CENTER, OFFSETX, -40, OFFSETY, -40 );'";
$Result .= ", STICKY, MOUSEOFF, DELAY, 750, CENTER, OFFSETX, -40, OFFSETY, -40 );'";
$Result .= " onmouseout='return nd();'>";
$Result .= "<img src=". $dpath ."planeten/small/s_". $GalaxyRowPlanet["image"] .".jpg height=30 width=30>";
$Result .= "<img src=". $dpath ."graphics/planeten/small/s_". $GalaxyRowPlanet["image"] .".jpg height=30 width=30>";
// $Result .= $GalaxyRowPlanet["name"];
$Result .= "</a>";
}
@ -133,4 +133,4 @@ function GalaxyRowPlanet ( $GalaxyRow, $GalaxyRowPlanet, $GalaxyRowUser, $Galaxy
return $Result;
}
?>
?>

View file

@ -62,9 +62,14 @@ function GalaxyRowPlanetName ( $GalaxyRow, $GalaxyRowPlanet, $GalaxyRowUser, $Ga
$EndColor = "";
}
if ($GalaxyRowPlanet['last_update'] > (time()-59 * 60) AND
$GalaxyRowUser['id'] != $user['id']) {
$Inactivity = pretty_time_hour(time() - $GalaxyRowPlanet['last_update']);
$updateTimeLimit = new Wootook_Core_DateTime();
$updateTimeLimit->sub(3600);
if ($updateTimeLimit->isLater($GalaxyRowPlanet['last_update']) && $GalaxyRowUser['id'] != $user['id']) {
if ($GalaxyRowPlanet['last_update'] instanceof Wootook_Core_DateTime) {
$Inactivity = pretty_time_hour(time() - $GalaxyRowPlanet['last_update']->getTimestamp());
} else {
$Inactivity = pretty_time_hour(0);
}
}
if ($GalaxyRow && $GalaxyRowPlanet["destruyed"] == 0) {
if ($HavePhalanx <> 0) {
@ -85,22 +90,25 @@ function GalaxyRowPlanetName ( $GalaxyRow, $GalaxyRowPlanet, $GalaxyRowUser, $Ga
$Result .= $TextColor . $PhalanxTypeLink . $EndColor;
if ($GalaxyRowPlanet['last_update'] > (time()-59 * 60) AND
$GalaxyRowUser['id'] != $user['id']) {
if ($GalaxyRowPlanet['last_update'] > (time()-10 * 60) AND
$GalaxyRowUser['id'] != $user['id']) {
$Result .= "(*)";
} else {
$Result .= " (".$Inactivity.")";
}
}
} elseif ($GalaxyRowPlanet["destruyed"] != 0) {
$Result .= $lang['gl_destroyedplanet'];
}
if ($GalaxyRowUser->getId() && $updateTimeLimit->isLater($GalaxyRowPlanet['last_update']) &&
$GalaxyRowUser['id'] != $user['id']) {
$updateTimeLimit = new Wootook_Core_DateTime();
$updateTimeLimit->sub(600);
if ($GalaxyRowUser->getId() && $updateTimeLimit->isLater($GalaxyRowPlanet['last_update']) &&
$GalaxyRowUser['id'] != $user['id']) {
$Result .= "(*)";
} else {
$Result .= " (".$Inactivity.")";
}
}
} elseif ($GalaxyRowPlanet["destruyed"] != 0) {
$Result .= $lang['gl_destroyedplanet'];
}
$Result .= "</th>";
return $Result;
}
?>
?>

View file

@ -31,111 +31,106 @@
/**
*
* @deprecated
* @param unknown_type $GalaxyRow
* @param unknown_type $GalaxyRowPlanet
* @param unknown_type $GalaxyRowUser
* @param unknown_type $Galaxy
* @param unknown_type $System
* @param unknown_type $Planet
* @param unknown_type $PlanetType
* @param Wootook_Empire_Model_Planet $currentPlanet
* @param Wootook_Player_Model_Entity $currentPlayer
*/
function GalaxyRowUser ( $GalaxyRow, $GalaxyRowPlanet, $GalaxyRowUser, $Galaxy, $System, $Planet, $PlanetType ) {
global $lang, $user;
function GalaxyRowUser($currentPlanet, $currentPlayer) {
global $user;
// Joueur
$Result = "<th width=150>";
if ($GalaxyRowUser && $GalaxyRowPlanet["destruyed"] == 0) {
$NoobProt = doquery("SELECT * FROM {{table}} WHERE `config_name` = 'noobprotection';", 'config', true);
$NoobTime = doquery("SELECT * FROM {{table}} WHERE `config_name` = 'noobprotectiontime';", 'config', true);
$NoobMulti = doquery("SELECT * FROM {{table}} WHERE `config_name` = 'noobprotectionmulti';", 'config', true);
$UserPoints = doquery("SELECT * FROM {{table}} WHERE `stat_type` = '1' AND `stat_code` = '1' AND `id_owner` = '". $user['id'] ."';", 'statpoints', true);
$User2Points = doquery("SELECT * FROM {{table}} WHERE `stat_type` = '1' AND `stat_code` = '1' AND `id_owner` = '". $GalaxyRowUser['id'] ."';", 'statpoints', true);
$CurrentPoints = $UserPoints['total_points'];
$RowUserPoints = $User2Points['total_points'];
$CurrentLevel = $CurrentPoints * $NoobMulti['config_value'];
$RowUserLevel = $RowUserPoints * $NoobMulti['config_value'];
if ($GalaxyRowUser['bana'] == 1 AND
$GalaxyRowUser['urlaubs_modus'] == 1) {
$Systemtatus2 = $lang['vacation_shortcut']." <a href=\"banned.php\"><span class=\"banned\">".$lang['banned_shortcut']."</span></a>";
$Systemtatus = "<span class=\"vacation\">";
} elseif ($GalaxyRowUser['bana'] == 1) {
$Systemtatus2 = "<a href=\"banned.php\"><span class=\"banned\">".$lang['banned_shortcut']."</span></a>";
$Systemtatus = "";
} elseif ($GalaxyRowUser['urlaubs_modus'] == 1) {
$Systemtatus2 = "<span class=\"vacation\">".$lang['vacation_shortcut']."</span>";
$Systemtatus = "<span class=\"vacation\">";
} elseif ($GalaxyRowUser['onlinetime'] < (time()-60 * 60 * 24 * 7) AND
$GalaxyRowUser['onlinetime'] > (time()-60 * 60 * 24 * 28)) {
$Systemtatus2 = "<span class=\"inactive\">".$lang['inactif_7_shortcut']."</span>";
$Systemtatus = "<span class=\"inactive\">";
} elseif ($GalaxyRowUser['onlinetime'] < (time()-60 * 60 * 24 * 28)) {
$Systemtatus2 = "<span class=\"inactive\">".$lang['inactif_7_shortcut']."</span><span class=\"longinactive\"> ".$lang['inactif_28_shortcut']."</span>";
$Systemtatus = "<span class=\"longinactive\">";
} elseif ($RowUserLevel < $CurrentPoints AND
$NoobProt['config_value'] == 1 AND
$NoobTime['config_value'] * 1000 > $RowUserPoints) {
$Systemtatus2 = "<span class=\"noob\">".$lang['weak_player_shortcut']."</span>";
$Systemtatus = "<span class=\"noob\">";
} elseif ($RowUserPoints > $CurrentLevel AND
$NoobProt['config_value'] == 1 AND
$NoobTime['config_value'] * 1000 > $CurrentPoints) {
$Systemtatus2 = $lang['strong_player_shortcut'];
$Systemtatus = "<span class=\"strong\">";
} else {
$Systemtatus2 = "";
$Systemtatus = "";
}
$Systemtatus4 = $User2Points['total_rank'];
if ($Systemtatus2 != '') {
$Systemtatus6 = "<font color=\"white\">(</font>";
$Systemtatus7 = "<font color=\"white\">)</font>";
}
if ($Systemtatus2 == '') {
$Systemtatus6 = "";
$Systemtatus7 = "";
}
$admin = "";
if ($GalaxyRowUser['authlevel'] == LEVEL_ADMIN) {
$admin = "<font color=\"red\"><blink>A</blink></font>";
} else if ($GalaxyRowUser['authlevel'] == LEVEL_OPERATOR) {
$admin = "<font color=\"lime\"><blink>O</blink></font>";
} else if ($GalaxyRowUser['authlevel'] == LEVEL_MODERATOR) {
$admin = "<font color=\"skyblue\"><blink>M</blink></font>";
}
$Systemtart = $User2Points['total_rank'];
if (strlen($Systemtart) < 3) {
$Systemtart = 1;
} else {
$Systemtart = (floor( $User2Points['total_rank'] / 100 ) * 100) + 1;
}
$Result .= "<a style=\"cursor: pointer;\"";
$Result .= " onmouseover='return overlib(\"";
$Result .= "<table width=190>";
$Result .= "<tr>";
$Result .= "<td class=c colspan=2>".$lang['Player']." ".$GalaxyRowUser['username']." ".$lang['Place']." ".$Systemtatus4."</td>";
$Result .= "</tr><tr>";
if ($GalaxyRowUser['id'] != $user['id']) {
$Result .= "<td><a href=messages.php?mode=write&id=".$GalaxyRowUser['id'].">".$lang['gl_sendmess']."</a></td>";
$Result .= "</tr><tr>";
$Result .= "<td><a href=buddy.php?a=2&u=".$GalaxyRowUser['id'].">".$lang['gl_buddyreq']."</a></td>";
$Result .= "</tr><tr>";
}
$Result .= "<td><a href=stat.php?who=player&start=".$Systemtart.">".$lang['gl_stats']."</a></td>";
$Result .= "</tr>";
$Result .= "</table>\"";
$Result .= ", STICKY, MOUSEOFF, DELAY, 750, CENTER, OFFSETX, -40, OFFSETY, -40 );'";
$Result .= " onmouseout='return nd();'>";
$Result .= $Systemtatus;
$Result .= $GalaxyRowUser["username"]."</span>";
$Result .= $Systemtatus6;
$Result .= $Systemtatus;
$Result .= $Systemtatus2;
$Result .= $Systemtatus7." ".$admin;
$Result .= "</span></a>";
}
$Result .= "</th>";
if (is_array($currentPlayer)) {
$currentPlayer = new Wootook_Player_Model_Entity($currentPlayer);
}
if (is_array($currentPlanet)) {
$currentPlanet = new Wootook_Empire_Model_Planet($currentPlanet);
$currentPlanet->setData('last_update', new Wootook_Core_DateTime($currentPlanet->getData('last_update')));
}
if (!$currentPlayer || !$currentPlayer->getId() || !$currentPlanet || $currentPlanet->isDestroyed()) {
return '<td width="150"></td>';
}
return $Result;
$activeNoobProtection = Wootook::getGameConfig('game/noob-protection/active');
$noobProtectionMultiplier = Wootook::getGameConfig('game/noob-protection/multiplier');
$noobProtectionPointsLimit = Wootook::getGameConfig('game/noob-protection/points-cap');
$readAdapter = Wootook_Core_Database_ConnectionManager::getSingleton()->getConnection('core_read');
$statement = $readAdapter->select()
->column('total_points')
->column('total_rank')
->from(array('stats' => $readAdapter->getTable('statpoints')))
->where('id_owner', new Wootook_Core_Database_Sql_Placeholder_Variable('player_id'))
->where('stat_code', 1)
->where('stat_type', 1)
->prepare()
;
$statement->execute(array('player_id' => $user->getId()));
$playerPoints = $statement->fetchColumn(0);
$statement->execute(array('player_id' => $currentPlayer->getId()));
$currentPlayerPoints = $statement->fetchColumn(0);
$currentPlayerRank = $statement->fetchColumn(1);
$classes = array();
if ($currentPlayer->isBanned()) {
$classes['banned'] = 'B';
}
if ($currentPlayer->isVacation()) {
$classes['vacation'] = 'V';
}
$pastDate = new Wootook_Core_DateTime();
$pastDate->sub(8, Wootook_Core_DateTime::DAY);
if ($pastDate->isLater($currentPlayer->getLastLoginDate())) {
$classes['inactive'] = 'i';
}
$pastDate->sub(22, Wootook_Core_DateTime::DAY);
if ($pastDate->isLater($currentPlayer->getLastLoginDate())) {
$classes['long-inactive'] = 'I';
}
if ($currentPlayer->isAuthorized(LEVEL_ADMIN)) {
$classes['admin'] = 'A';
} else if ($currentPlayer->isAuthorized(LEVEL_OPERATOR)) {
$classes['operator'] = 'O';
} else if ($currentPlayer->isAuthorized(LEVEL_MODERATOR)) {
$classes['moderator'] = 'M';
}
if ($activeNoobProtection) {
if ($playerPoints <= $noobProtectionPointsLimit && ($playerPoints * $noobProtectionMultiplier) < $currentPlayerPoints) {
$classes['strong'] = 'F';
} else if ($currentPlayerPoints <= $noobProtectionPointsLimit && ($currentPlayerPoints * $noobProtectionMultiplier) < $playerPoints) {
$classes['strong'] = 'F';
}
}
$output = '<td width="150">';
if (count($classes) > 0) {
$output .= '<span class="' . implode(' ', array_keys($classes)) . '">' . $currentPlayer->getUsername() . '</span>';
foreach ($classes as $class => $identifier) {
$output .= '<span class="' . $class . '">' . $identifier . '</span>';
}
} else {
$output .= '<span class="active">' . $currentPlayer->getUsername() . '</span>';
}
if (true || $currentPlayer->getId() !== $user->getId()) {
$translator = Wootook::getTranslator();
$messageUrl = Wootook::getStaticUrl('messages.php', array('mode' => 'write', 'id' => $currentPlayer->getId()));
$buddyUrl = Wootook::getStaticUrl('buddy.php', array('a' => '2', 'u' => $currentPlayer->getId()));
$statsUrl = Wootook::getStaticUrl('stat.php', array('who' => 'player', 'start' => 100 * floor($currentPlayerRank / 100)));
$output .=<<<HTML_EOF
<div class="details player">
<p class="username">{$translator->translate('Player: %s', $currentPlayer->getUsername())}</p>
<p class="stats">{$translator->translate('Rank: %d', $currentPlayerRank)}</p>
<p class="send-message"><a href="{$messageUrl}">{$translator->translate('Send a message')}</a></p>
<p class="buddy"><a href="{$buddyUrl}">{$translator->translate('Add to buddy list')}</a></p>
<p class="stats"><a href="{$statsUrl}">{$translator->translate('Statistics')}</a></p>
</div>
HTML_EOF;
}
$output .= '</td>';
return $output;
}
?>

View file

@ -1,80 +0,0 @@
<?php
/**
* This file is part of Wootook
*
* @license http://www.gnu.org/licenses/gpl-3.0.txt
* @see http://wootook.org/
*
* Copyright (c) 2009-Present, Wootook Support Team <http://wootook.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 Wootook.
*
*/
/**
*
* @deprecated
* @param unknown_type $Element
* @param unknown_type $Ressources
*/
function GetMaxConstructibleElements ($Element, $Ressources) {
global $pricelist;
// 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'];
$Buildable = floor($Ressources["metal"] / $ResType_1_Needed);
$MaxElements = $Buildable;
}
if ($pricelist[$Element]['crystal'] != 0) {
$ResType_2_Needed = $pricelist[$Element]['crystal'];
$Buildable = floor($Ressources["crystal"] / $ResType_2_Needed);
}
if (!isset($MaxElements)) {
$MaxElements = $Buildable;
} elseif ($MaxElements > $Buildable) {
$MaxElements = $Buildable;
}
if ($pricelist[$Element]['deuterium'] != 0) {
$ResType_3_Needed = $pricelist[$Element]['deuterium'];
$Buildable = floor($Ressources["deuterium"] / $ResType_3_Needed);
}
if (!isset($MaxElements)) {
$MaxElements = $Buildable;
} elseif ($MaxElements > $Buildable) {
$MaxElements = $Buildable;
}
if ($pricelist[$Element]['energy'] != 0) {
$ResType_4_Needed = $pricelist[$Element]['energy'];
$Buildable = floor($Ressources["energy_max"] / $ResType_4_Needed);
}
if ($Buildable < 1) {
$MaxElements = 0;
}
return $MaxElements;
}
// Verion History
// - 1.0 Version initiale (creation)
// - 1.1 Correction bug ressources n<>gatives ...
// - 1.2 Correction bug quand pas de m<>tal
?>

View file

@ -1,75 +0,0 @@
<?php
/**
* This file is part of Wootook
*
* @license http://www.gnu.org/licenses/gpl-3.0.txt
* @see http://wootook.org/
*
* Copyright (c) 2009-Present, Wootook Support Team <http://wootook.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 Wootook.
*
*/
/**
*
* @deprecated
* @param unknown_type $user
* @param unknown_type $planet
* @param unknown_type $Element
* @param unknown_type $userfactor
*/
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]];
}
$array = array(
'metal' => $lang["Metal"],
'crystal' => $lang["Crystal"],
'deuterium' => $lang["Deuterium"],
'energy_max' => $lang["Energy"]
);
$text = "<br><font color=\"#7f7f7f\">". $lang['Rest_ress'] .": ";
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: rgb(127, 95, 96);\">". pretty_number($planet[$ResType] - $cost) ."</b> ";
} else {
$text .= "<b style=\"color: rgb(95, 127, 108);\">". pretty_number($planet[$ResType] - $cost) ."</b> ";
}
}
}
$text .= "</font>";
return $text;
}
?>

View file

@ -1,58 +0,0 @@
<?php
/**
* This file is part of Wootook
*
* @license http://www.gnu.org/licenses/gpl-3.0.txt
* @see http://wootook.org/
*
* Copyright (c) 2009-Present, Wootook Support Team <http://wootook.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 Wootook.
*
*/
/**
*
* @deprecated
* @param unknown_type $CurrentUser
* @param unknown_type $Officier
*/
function IsOfficierAccessible ($CurrentUser, $Officier) {
global $requirements, $resource, $pricelist;
if (isset($requirements[$Officier])) {
$enabled = true;
foreach($requirements[$Officier] as $ReqOfficier => $OfficierLevel) {
if ($CurrentUser[$resource[$ReqOfficier]] &&
$CurrentUser[$resource[$ReqOfficier]] >= $OfficierLevel) {
$enabled = 1;
} else {
return 0;
}
}
}
if ($CurrentUser[$resource[$Officier]] < $pricelist[$Officier]['max'] ) {
return 1;
} else {
return -1;
}
}
?>

View file

@ -1,58 +0,0 @@
<?php
/**
* This file is part of Wootook
*
* @license http://www.gnu.org/licenses/gpl-3.0.txt
* @see http://wootook.org/
*
* Copyright (c) 2009-Present, Wootook Support Team <http://wootook.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 Wootook.
*
*/
/**
*
* @deprecated
* @param unknown_type $user
* @param unknown_type $planet
* @param unknown_type $element
*/
function IsTechnologieAccessible($user, $planet, $element)
{
trigger_error(sprintf('%s is deprecated', __FUNCTION__), E_USER_DEPRECATED);
global $requirements, $resource;
if (isset($requirements[$element])) {
$enabled = true;
foreach($requirements[$element] as $ReqElement => $EleLevel) {
if (@$user[$resource[$ReqElement]] && $user[$resource[$ReqElement]] >= $EleLevel) {
// break;
} elseif ($planet[$resource[$ReqElement]] && $planet[$resource[$ReqElement]] >= $EleLevel) {
$enabled = true;
} else {
return false;
}
}
return $enabled;
} else {
return true;
}
}

View file

@ -31,85 +31,108 @@
/**
*
* @deprecated
* @param unknown_type $FleetRow
* @param Wootook_Empire_Model_Fleet|array $fleet
*/
function MissionCaseColonisation ( $FleetRow ) {
global $lang, $resource;
function MissionCaseColonisation($fleet)
{
$readConnection = Wootook_Core_Database_ConnectionManager::getSingleton()->getConnection('core_read');
$statement = doquery ("SELECT count(*) FROM {{table}} WHERE `id_owner` = '". $FleetRow['fleet_owner'] ."' AND `planet_type` = '1'", 'planets');
$iPlanetCount = $statement->fetch(PDO::FETCH_ASSOC);
if ($FleetRow['fleet_mess'] == 0) {
// Déjà, sommes nous a l'aller ??
$statement2 = doquery ("SELECT count(*) FROM {{table}} WHERE `galaxy` = '". $FleetRow['fleet_end_galaxy']."' AND `system` = '". $FleetRow['fleet_end_system']."' AND `planet` = '". $FleetRow['fleet_end_planet']."';", 'galaxy');
$iGalaxyPlace = $statement2->fetch(PDO::FETCH_ASSOC);
$TargetAdress = sprintf ($lang['sys_adress_planet'], $FleetRow['fleet_end_galaxy'], $FleetRow['fleet_end_system'], $FleetRow['fleet_end_planet']);
if ($iGalaxyPlace == 0) {
// Y a personne qui s'y est mis avant que je ne debarque !
if ($iPlanetCount >= MAX_PLAYER_PLANETS && $user['authlevel'] != LEVEL_ADMIN) {
$TheMessage = $lang['sys_colo_arrival'] . $TargetAdress . $lang['sys_colo_maxcolo'] . MAX_PLAYER_PLANETS . $lang['sys_colo_planet'];
SendSimpleMessage ( $FleetRow['fleet_owner'], '', $FleetRow['fleet_start_time'], 0, $lang['sys_colo_mess_from'], $lang['sys_colo_mess_report'], $TheMessage);
doquery("UPDATE {{table}} SET `fleet_mess` = '1' WHERE `fleet_id` = ". $FleetRow["fleet_id"], 'fleets');
} else {
$user = Wootook_Player_Model_Entity::factory($FleetRow['fleet_owner']);
$user->createNewPlanet(
intval($FleetRow['fleet_end_galaxy']),
intval($FleetRow['fleet_end_system']),
intval($FleetRow['fleet_end_planet']),
Wootook_Empire_Model_Planet::TYPE_PLANET,
Wootook::__('Colony')
);
$player = new Wootook_Player_Model_Entity();
$player->load($fleet->getData('fleet_owner'));
if (!$player->getId()) {
$fleet->delete();
return;
}
if ( $NewOwnerPlanet == true ) {
$TheMessage = $lang['sys_colo_arrival'] . $TargetAdress . $lang['sys_colo_allisok'];
SendSimpleMessage ( $FleetRow['fleet_owner'], '', $FleetRow['fleet_start_time'], 0, $lang['sys_colo_mess_from'], $lang['sys_colo_mess_report'], $TheMessage);
// Verifier ce que contient fleet_array (et le cas et cheant retirer un element '208'
if ($FleetRow['fleet_amount'] == 1) {
doquery("DELETE FROM {{table}} WHERE fleet_id=" . $FleetRow["fleet_id"], 'fleets');
} else {
$CurrentFleet = explode(";", $FleetRow['fleet_array']);
$NewFleet = "";
foreach ($CurrentFleet as $Item => $Group) {
if ($Group != '') {
$Class = explode (",", $Group);
if ($Class[0] == 208) {
if ($Class[1] > 1) {
$NewFleet .= $Class[0].",".($Class[1] - 1).";";
}
} else {
if ($Class[1] <> 0) {
$NewFleet .= $Class[0].",".$Class[1].";";
}
}
}
}
$QryUpdateFleet = "UPDATE {{table}} SET ";
$QryUpdateFleet .= "`fleet_array` = '". $NewFleet ."', ";
$QryUpdateFleet .= "`fleet_amount` = `fleet_amount` - 1, ";
$QryUpdateFleet .= "`fleet_mess` = '1' ";
$QryUpdateFleet .= "WHERE `fleet_id` = '". $FleetRow["fleet_id"] ."';";
doquery( $QryUpdateFleet, 'fleets');
}
} else {
$TheMessage = $lang['sys_colo_arrival'] . $TargetAdress . $lang['sys_colo_badpos'];
SendSimpleMessage ( $FleetRow['fleet_owner'], '', $FleetRow['fleet_start_time'], 0, $lang['sys_colo_mess_from'], $lang['sys_colo_mess_report'], $TheMessage);
doquery("UPDATE {{table}} SET `fleet_mess` = '1' WHERE `fleet_id` = ". $FleetRow["fleet_id"], 'fleets');
}
}
} else {
// Pas de bol coiffé sur le poteau !
$TheMessage = $lang['sys_colo_arrival'] . $TargetAdress . $lang['sys_colo_notfree'];
SendSimpleMessage ( $FleetRow['fleet_owner'], '', $FleetRow['fleet_end_time'], 0, $lang['sys_colo_mess_from'], $lang['sys_colo_mess_report'], $TheMessage);
// Mettre a jour la flotte pour qu'effectivement elle revienne !
doquery("UPDATE {{table}} SET `fleet_mess` = '1' WHERE `fleet_id` = ". $FleetRow["fleet_id"], 'fleets');
$event = Wootook::dispatchEvent('fleet.mission.colonize.max-allowed-planets', array(
'base_count' => MAX_PLAYER_PLANETS,
'count' => MAX_PLAYER_PLANETS,
'player' => $player,
'fleet' => $fleet
));
}
} else {
if ($FleetRow['fleet_end_time'] <= time()) {
// Retour de flotte
RestoreFleetToPlanet ( $FleetRow, true );
doquery("DELETE FROM {{table}} WHERE fleet_id=" . $FleetRow["fleet_id"], 'fleets');
}
}
}
$maxAllowedPlanetCount = $event->getData('count');
?>
/* first trip */
if ($fleet->getData('fleet_mess') == 0) {
if ($fleet->getActionTime()->isEarlier()) {
return;
}
if ($player->getPlanetCollection()->getSize() >= $maxAllowedPlanetCount && !$player->isAuthorized(array(LEVEL_ADMIN))) {
/* no more planets to colonize */
$coords = sprintf('%d:%d:%d', $fleet->getData('fleet_end_galaxy'), $fleet->getData('fleet_end_system'), $fleet->getData('fleet_end_planet'));
SendSimpleMessage($player->getId(), null, $fleet['fleet_end_time'], 0,
Wootook::__('Colonization'), Wootook::__('Colonization report'),
Wootook::__("The fleet has arrived at the coordinates [%1\$s], but unfortunatly colonization cannot happen : you can't have more than %2\$d colonies.", $coords, $maxAllowedPlanetCount));
$fleet->goBack();
return;
}
$statement = $readConnection->select()
->column(new Wootook_Core_Database_Sql_Placeholder_Expression('COUNT(*)'))
->from($readConnection->getTable('planets'))
->where('galaxy', $fleet->getData('fleet_end_galaxy'))
->where('system', $fleet->getData('fleet_end_system'))
->where('planet', $fleet->getData('fleet_end_planet'))
->prepare()
;
$statement->execute();
if ($statement->fetchColumn() > 0) {
$coords = sprintf('%d:%d:%d', $fleet->getData('fleet_end_galaxy'), $fleet->getData('fleet_end_system'), $fleet->getData('fleet_end_planet'));
SendSimpleMessage($player->getId(), null, $fleet['fleet_end_time'], 0,
Wootook::__('Colonization'), Wootook::__('Colonization report'),
Wootook::__("The fleet has arrived at the coordinates [%1\$s], but unfortunatly colonization cannot happen : the planet is already colonized.", $coords));
$fleet->goBack();
return;
}
if (mt_rand(0, 100) >= 75) {
$baseSize = Wootook::getGameConfig('planet/initial/fields');
$factor = 2 * $position / (1 + log($position));
$fuzz = 2 * $factor * pow(sin($factor), 2) / 2 + $factor / 4;
$size = ($baseSize * mt_rand(floor($factor / 10), ceil($factor * 5 / 4))) + mt_rand(0, $fuzz);
$player->createNewPlanet(
$fleet->getData('fleet_end_galaxy'),
$fleet->getData('fleet_end_system'),
$fleet->getData('fleet_end_planet'),
Wootook_Empire_Model_Planet::TYPE_PLANET,
Wootook::__('Colony'),
$size
);
$coords = sprintf('%d:%d:%d', $fleet->getData('fleet_end_galaxy'), $fleet->getData('fleet_end_system'), $fleet->getData('fleet_end_planet'));
SendSimpleMessage($player->getId(), null, $fleet['fleet_end_time'], 0,
Wootook::__('Colonization'), Wootook::__('Colonization report'),
Wootook::__("The fleet has arrived at the coordinates [%1\$s], the settlers succeeded creating your new colony.", $coords));
$fleet->delete();
return;
} else {
$coords = sprintf('%d:%d:%d', $fleet->getData('fleet_end_galaxy'), $fleet->getData('fleet_end_system'), $fleet->getData('fleet_end_planet'));
SendSimpleMessage($player->getId(), null, $fleet['fleet_end_time'], 0,
Wootook::__('Colonization'), Wootook::__('Colonization report'),
Wootook::__("The fleet has arrived at the coordinates [%1\$s], the settlers failed creating your new colony, no planet was there.", $coords));
$fleet->goBack();
return;
}
}
/* back trip */
if ($fleet->getArrivalTime()->isEarlier()) {
return;
}
$fleet->dock($fleet->getOriginPlanet());
$coords = sprintf('%d:%d:%d', $fleet->getData('fleet_end_galaxy'), $fleet->getData('fleet_end_system'), $fleet->getData('fleet_end_planet'));
SendSimpleMessage($player->getId(), null, $fleet['fleet_end_time'], 0,
Wootook::__('Colonization'), Wootook::__('Colonization report'),
Wootook::__("The fleet went back from the coordinates [%1\$s], the settlers failed creating your new colony.", $coords));
return;
}

View file

@ -1,51 +0,0 @@
<?php
/**
* This file is part of Wootook
*
* @license http://www.gnu.org/licenses/gpl-3.0.txt
* @see http://wootook.org/
*
* Copyright (c) 2009-Present, Wootook Support Team <http://wootook.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 Wootook.
*
*/
/**
*
* @deprecated
* @param array $CurrentUser
* @param array $CurrentPlanet
* @param int $UpdateTime
*/
function PlanetResourceUpdate($CurrentUser, &$CurrentPlanet, $UpdateTime)
{
trigger_error(sprintf('%s is deprecated', __FUNCTION__), E_USER_DEPRECATED);
$planet = Legacies_Empire_Model_User::factory($CurrentPlanet['id']);
/*
* Update planet resources and constructions
*/
Wootook::dispatchEvent('planet.update', array(
'planet' => $planet,
'time' => $UpdateTime
));
$planet->save();
}

View file

@ -1,92 +0,0 @@
<?php
/**
* This file is part of Wootook
*
* @license http://www.gnu.org/licenses/gpl-3.0.txt
* @see http://wootook.org/
*
* Copyright (c) 2009-Present, Wootook Support Team <http://wootook.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 Wootook.
*
*/
/**
*
* @deprecated
* @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);
if (empty($ExistMail['email'])) {
message('L\'adresse n\'existe pas !','Erreur');
}
else{
//Caractere qui seront contenus dans le nouveau mot de passe
$Caracters="aazertyuiopqsdfghjklmwxcvbnAZERTYUIOPQSDFGHJKLMWXCVBN1234567890";
$Count=strlen($Caracters);
$NewPass="";
$Taille=6;
srand((double)microtime()*1000000);
for($i=0;$i<$Taille;$i++){
$CaracterBoucle=rand(0,$Count-1);
$NewPass=$NewPass.substr($Caracters,$CaracterBoucle,1);
}
//Et un nouveau mot de passe tout chaud ^^
//On va maintenant l'envoyer au destinataire
$Title = "Wootook : Nouveau mot de passe";
$Body = "Voici votre nouveau mot de passe : ";
$Body .= $NewPass;
mail($mail,$Title,$Body);
//Email envoy<6F>, maintenant place au changement dans la BDD
$NewPassSql = md5($NewPass);
$QryPassChange = "UPDATE {{table}} SET ";
$QryPassChange .= "`password` ='". $NewPassSql ."' ";
$QryPassChange .= "WHERE `email`='". $mail ."' LIMIT 1;";
doquery( $QryPassChange, 'users');
}
}
?>

View file

@ -31,73 +31,91 @@
/**
*
* @deprecated
* @param unknown_type $Galaxy
* @param unknown_type $System
* @param int $Galaxy
* @param int $System
*/
function ShowGalaxyRows ($Galaxy, $System) {
global $lang, $planetcount, $CurrentRC, $dpath, $user;
function ShowGalaxyRows($Galaxy, $System)
{
global $planetcount;
$readAdapter = Wootook_Core_Database_ConnectionManager::getSingleton()->getConnection('core_read');
$Result = "";
for ($Planet = 1; $Planet <= Wootook::getGameConfig('engine/universe/positions'); $Planet++) {
$galaxyStatement = $readAdapter->select()
->column('*')
->from($readAdapter->getTable('galaxy'))
->where('galaxy', $Galaxy)
->where('system', $System)
->where('planet', new Wootook_Core_Database_Sql_Placeholder_Variable('planet'))
->limit(1)
->prepare()
;
$GalaxyRowPlanet = array();
$GalaxyRowMoon = array();
$GalaxyRowPlayer = array();
$GalaxyRowAlly = array();
$planetStatement = $readAdapter->select()
->column('*')
->from($readAdapter->getTable('planets'))
->where('id', new Wootook_Core_Database_Sql_Placeholder_Variable('planet_id'))
->limit(1)
->prepare()
;
$GalaxyRow = doquery("SELECT * FROM {{table}} WHERE `galaxy` = '".$Galaxy."' AND `system` = '".$System."' AND `planet` = '".$Planet."';", 'galaxy', true);
$output = "";
for ($Planet = 1; $Planet <= Wootook::getGameConfig('engine/universe/positions'); $Planet++) {
if ($galaxyStatement->execute(array('planet' => $Planet))) {
/** @var Wootook_Empire_Model_Galaxy_Position $galaxyPosition */
$galaxyPosition = $galaxyStatement->fetchEntity('Wootook_Empire_Model_Galaxy_Position');
} else {
$output .= '<tr></tr>';
continue;
}
$Result .= "\n";
$Result .= "<tr>"; // Depart de ligne
if ($GalaxyRow) {
// Il existe des choses sur cette ligne de planete
if ($GalaxyRow["id_planet"] != 0) {
$GalaxyRowPlanet = doquery("SELECT * FROM {{table}} WHERE `id` = '". $GalaxyRow["id_planet"] ."';", 'planets', true);
$output .= "<tr>";
if ($galaxyPosition->getData('galaxy') && $galaxyPosition["id_planet"] != 0) {
if ($planetStatement->execute(array('planet_id' => $galaxyPosition["id_planet"]))) {
/** @var Wootook_Empire_Model_Planet $currentPlanet */
$currentPlanet = $planetStatement->fetchEntity('Wootook_Empire_Model_Planet');
} else {
$currentPlanet = new Wootook_Empire_Model_Planet();
}
if ($GalaxyRowPlanet['destruyed'] != 0 AND
$GalaxyRowPlanet['id_owner'] != '' AND
$GalaxyRow["id_planet"] != '') {
CheckAbandonPlanetState ($GalaxyRowPlanet);
} else {
$planetcount++;
$GalaxyRowPlayer = doquery("SELECT * FROM {{table}} WHERE `id` = '". $GalaxyRowPlanet["id_owner"] ."';", 'users', true);
}
if ($currentPlanet->getId() && !$currentPlanet->isDestroyed()) {
$planetcount++;
$currentPlayer = $currentPlanet->getPlayer();
} else {
CheckAbandonPlanetState($currentPlanet);
$currentPlayer = new Wootook_Player_Model_Entity();
}
if ($GalaxyRow["id_luna"] != 0) {
$GalaxyRowMoon = doquery("SELECT * FROM {{table}} WHERE `id` = '". $GalaxyRow["id_luna"] ."';", 'lunas', true);
if ($GalaxyRowMoon["destruyed"] != 0) {
CheckAbandonMoonState ($GalaxyRowMoon);
}
}
$GalaxyRowPlanet = doquery("SELECT * FROM {{table}} WHERE `id` = '". $GalaxyRow["id_planet"] ."';", 'planets', true);
if ($GalaxyRowPlanet['id_owner'] <> 0) {
$GalaxyRowUser = doquery("SELECT * FROM {{table}} WHERE `id` = '". $GalaxyRowPlanet['id_owner'] ."';", 'users', true);
} else {
$GalaxyRowUser = array();
}
}
}
$Result .= "\n";
$Result .= GalaxyRowPos ( $Planet, $GalaxyRow );
$Result .= "\n";
$Result .= GalaxyRowPlanet ( $GalaxyRow, $GalaxyRowPlanet, $GalaxyRowPlayer, $Galaxy, $System, $Planet, 1 );
$Result .= "\n";
$Result .= GalaxyRowPlanetName ( $GalaxyRow, $GalaxyRowPlanet, $GalaxyRowPlayer, $Galaxy, $System, $Planet, 1 );
$Result .= "\n";
$Result .= GalaxyRowMoon ( $GalaxyRow, $GalaxyRowMoon , $GalaxyRowPlayer, $Galaxy, $System, $Planet, 3 );
$Result .= "\n";
$Result .= GalaxyRowDebris ( $GalaxyRow, $GalaxyRowPlanet, $GalaxyRowPlayer, $Galaxy, $System, $Planet, 2 );
$Result .= "\n";
$Result .= GalaxyRowUser ( $GalaxyRow, $GalaxyRowPlanet, $GalaxyRowPlayer, $Galaxy, $System, $Planet, 0 );
$Result .= "\n";
$Result .= GalaxyRowAlly ( $GalaxyRow, $GalaxyRowPlanet, $GalaxyRowPlayer, $Galaxy, $System, $Planet, 0 );
$Result .= "\n";
$Result .= GalaxyRowActions ( $GalaxyRow, $GalaxyRowPlanet, $GalaxyRowPlayer, $Galaxy, $System, $Planet, 0 );
$Result .= "\n";
$Result .= "</tr>";
}
if ($galaxyPosition["id_luna"] != 0) {
if ($planetStatement->execute(array('planet_id' => $galaxyPosition["id_luna"]))) {
/** @var Wootook_Empire_Model_Planet $currentMoon */
$currentMoon = $planetStatement->fetchEntity('Wootook_Empire_Model_Planet');
} else {
$currentMoon = new Wootook_Empire_Model_Planet();
}
return $Result;
if ($currentMoon->isDestroyed()) {
CheckAbandonMoonState($currentMoon);
}
} else {
$currentMoon = new Wootook_Empire_Model_Planet();
}
} else {
$currentPlanet = new Wootook_Empire_Model_Planet();
$currentPlayer = new Wootook_Player_Model_Entity();
$currentMoon = new Wootook_Empire_Model_Planet();
}
$output .= GalaxyRowPos($Planet, $galaxyPosition);
$output .= GalaxyRowPlanet($galaxyPosition, $currentPlanet, $currentPlayer, $Galaxy, $System, $Planet, 1);
$output .= GalaxyRowPlanetName($galaxyPosition, $currentPlanet, $currentPlayer, $Galaxy, $System, $Planet, 1);
$output .= GalaxyRowMoon($galaxyPosition, $currentMoon , $currentPlayer, $Galaxy, $System, $Planet, 3);
$output .= GalaxyRowDebris($galaxyPosition, $currentPlanet, $currentPlayer, $Galaxy, $System, $Planet, 2);
$output .= GalaxyRowUser($currentPlanet, $currentPlayer);
$output .= GalaxyRowAlly($galaxyPosition, $currentPlanet, $currentPlayer, $Galaxy, $System, $Planet, 0);
$output .= GalaxyRowActions($galaxyPosition, $currentPlanet, $currentPlayer, $Galaxy, $System, $Planet, 0);
$output .= "</tr>";
}
return $output;
}
?>

View file

@ -1,52 +0,0 @@
<?php
/**
* This file is part of Wootook
*
* @license http://www.gnu.org/licenses/gpl-3.0.txt
* @see http://wootook.org/
*
* Copyright (c) 2009-Present, Wootook Support Team <http://wootook.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 Wootook.
*
*/
/**
*
* @deprecated
* @param unknown_type $CurrentUser
*/
function SortUserPlanets ( $CurrentUser ) {
$Order = ( $CurrentUser['planet_sort_order'] == 1 ) ? "DESC" : "ASC" ;
$Sort = $CurrentUser['planet_sort'];
$QryPlanets = "SELECT `id`, `name`, `galaxy`, `system`, `planet`, `planet_type` FROM {{table}} WHERE `id_owner` = '". $CurrentUser['id'] ."' ORDER BY ";
if ( $Sort == 0 ) {
$QryPlanets .= "`id` ". $Order;
} elseif ( $Sort == 1 ) {
$QryPlanets .= "`galaxy`, `system`, `planet`, `planet_type` ". $Order;
} elseif ( $Sort == 2 ) {
$QryPlanets .= "`name` ". $Order;
}
$Planets = doquery ( $QryPlanets, 'planets');
return $Planets;
}
?>

View file

@ -1,62 +0,0 @@
<?php
/**
* This file is part of Wootook
*
* @license http://www.gnu.org/licenses/gpl-3.0.txt
* @see http://wootook.org/
*
* Copyright (c) 2009-Present, Wootook Support Team <http://wootook.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 Wootook.
*
*/
/**
*
* @deprecated
* @param unknown_type $CurrentPlanet
* @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 ) {
if ( $CurrentPlanet['b_building'] <= time() ) {
PlanetResourceUpdate ( $CurrentUser, $CurrentPlanet, $CurrentPlanet['b_building'], false );
$IsDone = CheckPlanetBuildingQueue( $CurrentPlanet, $CurrentUser );
if ( $IsDone == true ) {
SetNextQueueElementOnTop ( $CurrentPlanet, $CurrentUser );
}
} else {
$RetValue = true;
break;
}
}
}
return $RetValue;
}
// Revision History
// - 1.0 Mise en module initiale
// - 1.1 Mise a jour des ressources sur la planete verifi<66>e (pour prendre en compte les ressources produites
// pendant la construction et avant l'evolution evantuel d'une mine ou d'en batiment
?>

View file

@ -34,7 +34,6 @@ require_once ROOT_PATH . 'includes/deprecated.php';
* @deprecated
* {{{
*/
include(ROOT_PATH . 'includes/functions/FlyingFleetHandler.'.PHPEXT);
include(ROOT_PATH . 'includes/functions/MissionCaseAttack.'.PHPEXT);
include(ROOT_PATH . 'includes/functions/MissionCaseStay.'.PHPEXT);
include(ROOT_PATH . 'includes/functions/MissionCaseStayAlly.'.PHPEXT);
@ -47,36 +46,29 @@ include(ROOT_PATH . 'includes/functions/MissionCaseExpedition.'.PHPEXT);
include(ROOT_PATH . 'includes/functions/SendSimpleMessage.'.PHPEXT);
include(ROOT_PATH . 'includes/functions/SpyTarget.'.PHPEXT);
include(ROOT_PATH . 'includes/functions/RestoreFleetToPlanet.'.PHPEXT);
include(ROOT_PATH . 'includes/functions/StoreGoodsToPlanet.'.PHPEXT);
include(ROOT_PATH . 'includes/functions/InsertJavaScriptChronoApplet.'.PHPEXT);
include(ROOT_PATH . 'includes/functions/IsTechnologieAccessible.'.PHPEXT); // <- TODO: delete
include(ROOT_PATH . 'includes/functions/GetRestPrice.'.PHPEXT); // <- TODO: delete
include(ROOT_PATH . 'includes/functions/InsertGalaxyScripts.'.PHPEXT);
include(ROOT_PATH . 'includes/functions/GalaxyCheckFunctions.'.PHPEXT);
include(ROOT_PATH . 'includes/functions/ShowGalaxyRows.'.PHPEXT);
include(ROOT_PATH . 'includes/functions/GetPhalanxRange.'.PHPEXT); // <- TODO: delete
include(ROOT_PATH . 'includes/functions/GetMissileRange.'.PHPEXT); // <- TODO: delete
include(ROOT_PATH . 'includes/functions/GalaxyRowPos.'.PHPEXT);
include(ROOT_PATH . 'includes/functions/GalaxyRowPlanet.'.PHPEXT);
include(ROOT_PATH . 'includes/functions/GalaxyRowPlanetName.'.PHPEXT);
include(ROOT_PATH . 'includes/functions/GalaxyRowMoon.'.PHPEXT);
include(ROOT_PATH . 'includes/functions/GalaxyRowDebris.'.PHPEXT);
include(ROOT_PATH . 'includes/functions/GalaxyRowUser.'.PHPEXT);
include(ROOT_PATH . 'includes/functions/GalaxyRowAlly.'.PHPEXT);
include(ROOT_PATH . 'includes/functions/GalaxyRowActions.'.PHPEXT);
include(ROOT_PATH . 'includes/functions/ShowGalaxySelector.'.PHPEXT);
include(ROOT_PATH . 'includes/functions/ShowGalaxyMISelector.'.PHPEXT);
include(ROOT_PATH . 'includes/functions/ShowGalaxyTitles.'.PHPEXT);
include(ROOT_PATH . 'includes/functions/GalaxyLegendPopup.'.PHPEXT);
include(ROOT_PATH . 'includes/functions/ShowGalaxyFooter.'.PHPEXT);
include(ROOT_PATH . 'includes/functions/MessageForm.'.PHPEXT);
include(ROOT_PATH . 'includes/functions/SendNewPassword.'.PHPEXT);
include(ROOT_PATH . 'includes/functions/IsOfficierAccessible.'.PHPEXT);
include(ROOT_PATH . 'includes/functions/CheckInputStrings.'.PHPEXT);
include(ROOT_PATH . 'includes/functions/MipCombatEngine.'.PHPEXT);
include(ROOT_PATH . 'includes/functions/DeleteSelectedUser.'.PHPEXT);
include(ROOT_PATH . 'includes/functions/SortUserPlanets.'.PHPEXT);
include(ROOT_PATH . 'includes/functions/BuildFleetEventTable.'.PHPEXT);
include(ROOT_PATH . 'includes/functions/StoreGoodsToPlanet.'.PHPEXT); // includes/functions/StoreGoodsToPlanet.php
include(ROOT_PATH . 'includes/functions/InsertJavaScriptChronoApplet.'.PHPEXT); // infos.php, includes/functions/BuildFleetEventTable.php
include(ROOT_PATH . 'includes/functions/InsertGalaxyScripts.'.PHPEXT); // galaxy.php
include(ROOT_PATH . 'includes/functions/GalaxyCheckFunctions.'.PHPEXT); // galaxy.php
include(ROOT_PATH . 'includes/functions/ShowGalaxyRows.'.PHPEXT); // galaxy.php
include(ROOT_PATH . 'includes/functions/GetPhalanxRange.'.PHPEXT); // <- TODO: delete
include(ROOT_PATH . 'includes/functions/GetMissileRange.'.PHPEXT); // <- TODO: delete
include(ROOT_PATH . 'includes/functions/GalaxyRowPos.'.PHPEXT); // galaxy.php
include(ROOT_PATH . 'includes/functions/GalaxyRowPlanet.'.PHPEXT); // galaxy.php
include(ROOT_PATH . 'includes/functions/GalaxyRowPlanetName.'.PHPEXT); // galaxy.php
include(ROOT_PATH . 'includes/functions/GalaxyRowMoon.'.PHPEXT); // galaxy.php
include(ROOT_PATH . 'includes/functions/GalaxyRowDebris.'.PHPEXT); // galaxy.php
include(ROOT_PATH . 'includes/functions/GalaxyRowUser.'.PHPEXT); // galaxy.php
include(ROOT_PATH . 'includes/functions/GalaxyRowAlly.'.PHPEXT); // galaxy.php
include(ROOT_PATH . 'includes/functions/GalaxyRowActions.'.PHPEXT); // galaxy.php
include(ROOT_PATH . 'includes/functions/ShowGalaxySelector.'.PHPEXT); // galaxy.php
include(ROOT_PATH . 'includes/functions/ShowGalaxyMISelector.'.PHPEXT); // galaxy.php
include(ROOT_PATH . 'includes/functions/ShowGalaxyTitles.'.PHPEXT); // galaxy.php
include(ROOT_PATH . 'includes/functions/GalaxyLegendPopup.'.PHPEXT); // galaxy.php
include(ROOT_PATH . 'includes/functions/ShowGalaxyFooter.'.PHPEXT); // galaxy.php
include(ROOT_PATH . 'includes/functions/MessageForm.'.PHPEXT); // alliance.php
include(ROOT_PATH . 'includes/functions/MipCombatEngine.'.PHPEXT); // mipattack.php
include(ROOT_PATH . 'includes/functions/BuildFleetEventTable.'.PHPEXT); // phalanx.php
/**
* }}}
*/
*/