From 3fd8832b4510f85d6d3c78d3d6c701382ff5060a Mon Sep 17 00:00:00 2001 From: Gregory PLANCHAT Date: Tue, 28 Jun 2011 13:02:55 +0200 Subject: [PATCH] Signed-off-by: Gregory PLANCHAT --- admin/activeplanet.php | 2 +- admin/chat.php | 2 +- admin/errors.php | 2 +- admin/messagelist.php | 2 +- admin/messall.php | 2 +- admin/moonlist.php | 2 +- admin/multi.php | 2 +- admin/planetlist.php | 2 +- admin/statbuilder.php | 4 +- alliance.php | 12 +- annonce.php | 4 +- banned.php | 2 +- common.php | 34 +- db/mysql.php | 59 +- fleet.php | 2 +- floten1.php | 2 +- floten2.php | 2 +- includes/CombatEngine.php | 29 +- .../community/Legacies/Core/Collection.php | 42 +- .../code/community/Legacies/Core/Entity.php | 37 +- .../Legacies/Core/Entity/SubTable.php | 2 + .../code/community/Legacies/Core/Error.php | 163 ++++ .../Core/Setup/Updater/ScriptQueue.php | 444 ++++++++++ .../Core/install/mysql5/install-2011.1.0.php | 792 ++++++++++++++++++ .../install/mysql5/uninstall-2011.1.0.php | 163 ++++ .../code/community/Legacies/Database.php | 4 +- .../code/community/Legacies/Empire.php | 29 +- .../Legacies/Empire/Model/BuilderAbstract.php | 2 +- .../Legacies/Empire/Model/Game/Types.php | 3 + .../Legacies/Empire/Model/Planet.php | 100 ++- .../Legacies/Empire/Model/Planet/Builder.php | 6 +- .../Empire/Model/Planet/Building/Shipyard.php | 6 +- .../Model/Planet/Ship/LightTransport.php | 27 + .../Model/Planet/Ship/SolarSatellite.php | 10 + .../Empire/Model/Planet/Ship/Supernova.php | 26 + .../Empire/Model/Planet/ShipInterface.php | 2 + .../community/Legacies/Empire/Model/User.php | 44 +- includes/constants.php | 2 + includes/data/prices.php | 2 +- includes/data/types.php | 50 ++ includes/db.php | 33 - includes/deprecated.php | 428 ++++++++++ includes/functions.php | 12 - includes/functions/AbandonColony.php | 3 +- includes/functions/AddBuildingToQueue.php | 114 --- includes/functions/BBcodeFunction.php | 6 + includes/functions/BatimentBuildingPage.php | 1 + includes/functions/BuildFleetEventTable.php | 1 + includes/functions/BuildFlyingFleetTable.php | 1 + .../functions/BuildingSavePlanetRecord.php | 49 -- includes/functions/BuildingSaveUserRecord.php | 47 -- .../functions/CancelBuildingFromQueue.php | 1 + includes/functions/CheckCookies.php | 97 --- includes/functions/CheckInputStrings.php | 15 +- .../functions/CheckLabSettingsInQueue.php | 1 + .../functions/CheckPlanetBuildingQueue.php | 156 ---- includes/functions/CheckPlanetUsedFields.php | 58 -- includes/functions/ChekUser.php | 1 + includes/functions/CreateOneMoonRecord.php | 1 + includes/functions/CreateOnePlanetRecord.php | 1 + includes/functions/DefensesBuildingPage.php | 1 + includes/functions/DeleteSelectedUser.php | 1 + includes/functions/ElementBuildListBox.php | 1 + includes/functions/ElementBuildListQueue.php | 1 + includes/functions/FleetBuildingPage.php | 1 + includes/functions/FlyingFleetHandler.php | 139 ++- includes/functions/GalaxyCheckFunctions.php | 2 + includes/functions/GalaxyLegendPopup.php | 1 + includes/functions/GalaxyRowActions.php | 1 + includes/functions/GalaxyRowAlly.php | 1 + includes/functions/GalaxyRowDebris.php | 1 + includes/functions/GalaxyRowMoon.php | 1 + includes/functions/GalaxyRowPlanet.php | 1 + includes/functions/GalaxyRowPlanetName.php | 1 + includes/functions/GalaxyRowPos.php | 1 + includes/functions/GalaxyRowUser.php | 1 + includes/functions/GetBuildingPrice.php | 64 -- includes/functions/GetBuildingTime.php | 86 -- includes/functions/GetBuildingTimeLevel.php | 87 -- includes/functions/GetElementPrice.php | 75 -- includes/functions/GetElementRessources.php | 47 -- .../functions/GetMaxConstructibleElements.php | 1 + includes/functions/GetMissileRange.php | 1 + includes/functions/GetPhalanxRange.php | 1 + includes/functions/GetRestPrice.php | 1 + includes/functions/HandleTechnologieBuild.php | 1 + includes/functions/InsertBuildListScript.php | 1 + includes/functions/InsertGalaxyScripts.php | 1 + .../InsertJavaScriptChronoApplet.php | 1 + includes/functions/IsElementBuyable.php | 1 + includes/functions/IsOfficierAccessible.php | 1 + .../functions/IsTechnologieAccessible.php | 1 + includes/functions/IsVacationMode.php | 3 +- includes/functions/MessageForm.php | 1 + includes/functions/MipCombatEngine.php | 1 + includes/functions/MissionCaseAttack.php | 1 + .../functions/MissionCaseColonisation.php | 1 + includes/functions/MissionCaseDestruction.php | 1 + includes/functions/MissionCaseExpedition.php | 1 + includes/functions/MissionCaseRecycling.php | 1 + includes/functions/MissionCaseSpy.php | 1 + includes/functions/MissionCaseStay.php | 1 + includes/functions/MissionCaseStayAlly.php | 1 + includes/functions/MissionCaseTransport.php | 1 + includes/functions/PlanetResourceUpdate.php | 1 + .../functions/RemoveBuildingFromQueue.php | 1 + includes/functions/ResearchBuildingPage.php | 1 + .../functions/ResetThisFuckingCheater.php | 1 + includes/functions/RestoreFleetToPlanet.php | 1 + includes/functions/RevisionTime.php | 1 + includes/functions/SendNewPassword.php | 1 + includes/functions/SendSimpleMessage.php | 1 + .../functions/SetNextQueueElementOnTop.php | 1 + includes/functions/SetSelectedPlanet.php | 1 + includes/functions/ShowBuildingQueue.php | 1 + includes/functions/ShowGalaxyFooter.php | 1 + includes/functions/ShowGalaxyMISelector.php | 1 + includes/functions/ShowGalaxyRows.php | 1 + includes/functions/ShowGalaxySelector.php | 1 + includes/functions/ShowGalaxyTitles.php | 1 + includes/functions/ShowTopNavigationBar.php | 3 +- includes/functions/SortUserPlanets.php | 1 + includes/functions/SpyTarget.php | 1 + includes/functions/StoreGoodsToPlanet.php | 1 + .../UpdatePlanetBatimentQueueList.php | 1 + includes/todofleetcontrol.php | 30 +- language/en/reg.mo | 4 - language/fr/reg.mo | 5 - language/it/install/reg.mo | 4 - language/it/reg.mo | 4 - messages.php | 6 +- notes.php | 2 +- options.php | 4 +- overview.php | 49 +- phalanx.php | 2 +- rak.php | 6 +- stat.php | 4 +- verband.php | 2 +- 138 files changed, 2588 insertions(+), 1244 deletions(-) create mode 100644 includes/application/code/community/Legacies/Core/Error.php create mode 100644 includes/application/code/community/Legacies/Core/Setup/Updater/ScriptQueue.php create mode 100644 includes/application/code/community/Legacies/Core/install/mysql5/install-2011.1.0.php create mode 100644 includes/application/code/community/Legacies/Core/install/mysql5/uninstall-2011.1.0.php create mode 100644 includes/application/code/community/Legacies/Empire/Model/Planet/Ship/LightTransport.php delete mode 100644 includes/db.php create mode 100644 includes/deprecated.php delete mode 100644 includes/functions/AddBuildingToQueue.php delete mode 100644 includes/functions/BuildingSavePlanetRecord.php delete mode 100644 includes/functions/BuildingSaveUserRecord.php delete mode 100644 includes/functions/CheckCookies.php delete mode 100644 includes/functions/CheckPlanetBuildingQueue.php delete mode 100644 includes/functions/CheckPlanetUsedFields.php delete mode 100644 includes/functions/GetBuildingPrice.php delete mode 100644 includes/functions/GetBuildingTime.php delete mode 100644 includes/functions/GetBuildingTimeLevel.php delete mode 100644 includes/functions/GetElementPrice.php delete mode 100644 includes/functions/GetElementRessources.php diff --git a/admin/activeplanet.php b/admin/activeplanet.php index ec28086..9cd3871 100644 --- a/admin/activeplanet.php +++ b/admin/activeplanet.php @@ -44,7 +44,7 @@ require_once dirname(dirname(__FILE__)) .'/common.php'; $AllActivPlanet = doquery("SELECT * FROM {{table}} WHERE `last_update` >= '". (time()-15 * 60) ."' ORDER BY `id` ASC", 'planets'); $Count = 0; - while ($ActivPlanet = mysql_fetch_array($AllActivPlanet)) { + while ($ActivPlanet = $AllActivPlanet->fetch(PDO::FETCH_BOTH)) { $parse['online_list'] .= ""; $parse['online_list'] .= "
". $ActivPlanet['name'] ."
"; $parse['online_list'] .= "
[". $ActivPlanet['galaxy'] .":". $ActivPlanet['system'] .":". $ActivPlanet['planet'] ."]
"; diff --git a/admin/chat.php b/admin/chat.php index fd85732..860ae00 100644 --- a/admin/chat.php +++ b/admin/chat.php @@ -48,7 +48,7 @@ $parse = $lang; // Affichage des messages $query = doquery("SELECT * FROM {{table}} ORDER BY messageid DESC LIMIT 25", 'chat'); $i = 0; - while ($e = mysql_fetch_array($query)) { + while ($e = $query->fetch(PDO::FETCH_BOTH)) { $i++; $parse['msg_list'] .= stripslashes("" . date('h:i:s', $e['timestamp']) . "". "". $e['user'] . "". diff --git a/admin/errors.php b/admin/errors.php index 6309e5b..a99f1e0 100644 --- a/admin/errors.php +++ b/admin/errors.php @@ -49,7 +49,7 @@ $parse = $lang; // Afficher les erreurs $query = doquery("SELECT * FROM {{table}}", 'errors'); $i = 0; - while ($u = mysql_fetch_array($query)) { + while ($u = $query->fetch(PDO::FETCH_BOTH)) { $i++; $parse['errors_list'] .= " ". $u['error_id'] ." diff --git a/admin/messagelist.php b/admin/messagelist.php index 56dfd6a..c6d31d0 100644 --- a/admin/messagelist.php +++ b/admin/messagelist.php @@ -123,7 +123,7 @@ require_once dirname(dirname(__FILE__)) .'/common.php'; $StartRec = 1 + (($ViewPage - 1) * 25); $Messages = doquery("SELECT * FROM {{table}} WHERE `message_type` = '". $Selected ."' ORDER BY `message_time` DESC LIMIT ". $StartRec .",25;", 'messages'); - while ($row = mysql_fetch_assoc($Messages)) { + while ($row = $Messages->fetch(PDO::FETCH_ASSOC)) { $OwnerData = doquery ("SELECT `username` FROM {{table}} WHERE `id` = '". $row['message_owner'] ."';", 'users',true); $bloc['mlst_id'] = $row['message_id']; $bloc['mlst_from'] = $row['message_from']; diff --git a/admin/messall.php b/admin/messall.php index 3522792..a05bb0d 100644 --- a/admin/messall.php +++ b/admin/messall.php @@ -57,7 +57,7 @@ require_once dirname(dirname(__FILE__)) .'/common.php'; $From = "". $ranga ." ".$user['username'].""; $Subject = "". $gameConfig['temat'] .""; $Message = "". $gameConfig['tresc'] .""; - while ($u = mysql_fetch_array($sq)) { + while ($u = $sq->fetch(PDO::FETCH_BOTH)) { SendSimpleMessage ( $u['id'], $user['id'], $Time, 97, $From, $Subject, $Message); } message("Wys�a�e� wiadomo�� do wszystkich graczy", "Complete", "../overview." . PHPEXT, 3); diff --git a/admin/moonlist.php b/admin/moonlist.php index 510af57..02b64b6 100644 --- a/admin/moonlist.php +++ b/admin/moonlist.php @@ -38,7 +38,7 @@ require_once dirname(dirname(__FILE__)) .'/common.php'; $parse = $lang; $query = doquery("SELECT * FROM {{table}} WHERE planet_type='3'", "planets"); $i = 0; - while ($u = mysql_fetch_array($query)) { + while ($u = $query->fetch(PDO::FETCH_BOTH)) { $parse['moon'] .= "" . "
" . $u[0] . "
" . "
" . $u[1] . "
" diff --git a/admin/multi.php b/admin/multi.php index b7d01e1..46af676 100644 --- a/admin/multi.php +++ b/admin/multi.php @@ -45,7 +45,7 @@ require_once dirname(dirname(__FILE__)) .'/common.php'; $RowsTPL = gettemplate('admin/multi_rows'); $PageTPL = gettemplate('admin/multi_body'); - while ($infos = mysql_fetch_assoc($query)) { + while ($infos = $query->fetch(PDO::FETCH_ASSOC)) { $Bloc['player'] = $infos['player']; $Bloc['text'] = $infos['text']; diff --git a/admin/planetlist.php b/admin/planetlist.php index 99e9d49..954600c 100644 --- a/admin/planetlist.php +++ b/admin/planetlist.php @@ -38,7 +38,7 @@ require_once dirname(dirname(__FILE__)) .'/common.php'; $parse = $lang; $query = doquery("SELECT * FROM {{table}} WHERE planet_type='1'", "planets"); $i = 0; - while ($u = mysql_fetch_array($query)) { + while ($u = $query->fetch(PDO::FETCH_BOTH)) { $parse['planetes'] .= "" . "
" . $u[0] . "
" . "
" . $u[1] . "
" diff --git a/admin/statbuilder.php b/admin/statbuilder.php index 6c3a0ca..4784fee 100644 --- a/admin/statbuilder.php +++ b/admin/statbuilder.php @@ -47,7 +47,7 @@ if (strtolower(substr(PHP_SAPI, 0, 3)) == 'cli' || in_array($user['authlevel'], $GameUsers = doquery("SELECT * FROM {{table}} WHERE authlevel<3", 'users'); - while ($CurUser = mysql_fetch_assoc($GameUsers)) { + while ($CurUser = $GameUsers->fetch(PDO::FETCH_ASSOC)) { // Recuperation des anciennes statistiques $OldStatRecord = doquery ("SELECT * FROM {{table}} WHERE `stat_type` = '1' AND `id_owner` = '".$CurUser['id']."';",'statpoints'); if ($OldStatRecord) { @@ -190,7 +190,7 @@ if (strtolower(substr(PHP_SAPI, 0, 3)) == 'cli' || in_array($user['authlevel'], // Statistiques des alliances ... $GameAllys = doquery("SELECT * FROM {{table}}", 'alliance'); - while ($CurAlly = mysql_fetch_assoc($GameAllys)) { + while ($CurAlly = $GameAllys->fetch(PDO::FETCH_ASSOC)) { // Recuperation des anciennes statistiques $OldStatRecord = doquery ("SELECT * FROM {{table}} WHERE `stat_type` = '2' AND `id_owner` = '".$CurAlly['id']."';",'statpoints'); if ($OldStatRecord) { diff --git a/alliance.php b/alliance.php index 861d312..688b354 100644 --- a/alliance.php +++ b/alliance.php @@ -222,7 +222,7 @@ if ($user['ally_id'] == 0) { // Sin alianza if (mysql_num_rows($search) != 0) { $template = gettemplate('alliance_searchresult_row'); - while ($s = mysql_fetch_array($search)) { + while ($s = $search->fetch(PDO::FETCH_BOTH)) { $entry = array(); $entry['ally_tag'] = "[{$s['ally_tag']}]"; $entry['ally_name'] = $s['ally_name']; @@ -428,7 +428,7 @@ elseif ($user['ally_id'] != 0 && $user['ally_request'] == 0) { // Con alianza // Como es costumbre. un row template $template = gettemplate('alliance_memberslist_row'); $page_list = ''; - while ($u = mysql_fetch_array($listuser)) { + while ($u = $listuser->fetch(PDO::FETCH_BOTH)) { $UserPoints = doquery("SELECT * FROM {{table}} WHERE `stat_type` = '1' AND `stat_code` = '1' AND `id_owner` = '" . $u['id'] . "';", 'statpoints', true); $i++; @@ -506,7 +506,7 @@ elseif ($user['ally_id'] != 0 && $user['ally_request'] == 0) { // Con alianza } // looooooop $list = ''; - while ($u = mysql_fetch_array($sq)) { + while ($u = $sq->fetch(PDO::FETCH_BOTH)) { doquery("INSERT INTO {{table}} SET `message_owner`='{$u['id']}', `message_sender`='{$user['id']}' , @@ -802,7 +802,7 @@ elseif ($user['ally_id'] != 0 && $user['ally_request'] == 0) { // Con alianza } else { $selection=doquery("SELECT * FROM {{table}} where ally_id='".$user['ally_id']."'",'users'); $select=''; -while($data=mysql_fetch_array($selection)){ +while ($data = $selection->fetch(PDO::FETCH_BOTH)){ $select.='