/** * @see Page::readData() */ public function readData() { parent::readData(); $sql = "SELECT *\n\t\t\t\tFROM ugml_archive_fleet\n\t\t\t\tWHERE fleetID = " . $this->fleetID; $row = WCF::getDB()->getFirstRow($sql); $this->fleetData = unserialize(LWUtil::unserialize($row['data'])); }
/** * Reads the old data array of a fleet. * * @param int fleet id * @return array */ private static function readArray($fleetID) { $sql = "SELECT data\r\n\t\t\t\tFROM ugml_archive_fleet\r\n\t\t\t\tWHERE fleetID = " . $fleetID; $row = WCF::getDB()->getFirstRow($sql); if (!$row) { return false; } return unserialize(LWUtil::unserialize($row['data'])); }
/** * Gets the list of results. */ protected function readFleets() { // get fleets $sql = "SELECT *\n\t\t\t\tFROM ugml_archive_fleet\n\t\t\t\tWHERE fleetID IN (" . implode(',', $this->fleetIDs) . ")\n\t\t\t\tORDER BY " . $this->sortField . " " . $this->sortOrder . "\n\t\t\t\tLIMIT " . $this->itemsPerPage . "\n\t\t\t\tOFFSET " . ($this->pageNo - 1) * $this->itemsPerPage; $result = WCF::getDB()->sendQuery($sql); while ($row = WCF::getDB()->fetchArray($result)) { $this->fleets[] = unserialize(LWUtil::unserialize($row['data'])); } }
WOT Game is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. WOT Game 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 Affero General Public License for more details. You should have received a copy of the GNU Affero General Public License along with WOT Game. If not, see <http://www.gnu.org/licenses/>. */ //fleetback.php /* define('INSIDE', true); $ugamela_root_path = '../'; include($ugamela_root_path . 'extension.inc'); include($ugamela_root_path . 'common.'.$phpEx); if(!check_user()){ header("Location: login.php"); die();}*/ define('WCF_DIR', 'G:\\workspace\\lw\\wcf\\'); require_once '../game/lib/util/LWUtil.class.php'; require_once '../game/lib/system/spec/Spec.class.php'; $a = array(1 => 2); $b = array(1 => 3); var_Dump(Spec::di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uGhma6oagf2HSqBOK25DEVMpLk8Y9sUMsLk4acseXYn9uXZ40RJX3jd3/hwW1+wpxnTuUBunaAutrlNrR5+F9nVva/PXyu69f8YX8ubiZrbmijTcWj85c4nbmqrb3/wO/fPAu'; $array = unserialize(LWUtil::unserialize($data)); var_dump($array);
/** * @see Form::readFormParameters() */ public function readFormParameters() { parent::readFormParameters(); if (isset($_POST['shipData'])) { $this->shipDataStr = StringUtil::trim($_POST['shipData']); $this->shipDataArray = (array) LWUtil::unserialize($this->shipDataStr); } }
include $ugamela_root_path . 'extension.inc'; include $ugamela_root_path . 'common.' . $phpEx; if (!check_user()) { header("Location: login.php"); die; } $start = intval($_GET['start']); $interval = 500; $sql = "SELECT ugml_archive_fleet.*\n\t\tFROM ugml_planets\n\t\tLEFT JOIN ugml_users\n\t\tON ugml_users.id = ugml_planets.id_owner\n\t\tLEFT JOIN wcf1_user\n\t\tON ugml_users.id = wcf1_user.userID\n\t\tLEFT JOIN ugml_archive_fleet\n\t\tON ugml_planets.id = ugml_archive_fleet.targetPlanetID\n\t\tWHERE wcf1_user.userID IS NULL\n\t\tLIMIT " . $start . ", " . $interval; $result = WCF::getDB()->sendQuery($sql); $users = array(); while ($row = WCF::getDB()->fetchArray($result)) { if ($row['data'] === null) { continue; } $data = unserialize(LWUtil::unserialize($row['data'])); $rev = end($data); if (!isset($users[$rev['data']['ownerID']])) { $metalu = $crystalu = $deuteriumu = 0; } else { extract($users[$rev['data']['ownerID']]); } $date['metalu'] = intval($rev['data']['metal'] + $metalu); $date['crystalu'] = intval($rev['data']['crystal'] + $crystalu); $date['deuteriumu'] = intval($rev['data']['deuterium'] + $deuteriumu); $users[$rev['data']['ownerID']] = $date; } foreach ($users as $userID => $user) { $sql = "INSERT INTO ugml_umod_bug_ress\n\t\t\t (userID, metalu, crystalu, deuteriumu)\n\t\t\tVALUES\n\t\t\t (" . $userID . ", " . $user['metalu'] . ", " . $user['crystalu'] . ", " . $user['deuteriumu'] . ")\n\t\t\tON DUPLICATE KEY UPDATE\n\t\t\t\tmetalu = metalu + " . $user['metalu'] . ",\n\t\t\t\tcrystalu = crystalu + " . $user['crystalu'] . ",\n\t\t\t\tdeuteriumu = deuteriumu + " . $user['deuteriumu']; WCF::getDB()->sendQuery($sql); }
/** * Creates the fleet object * * @param int fleet id * @param array database row */ public function __construct($fleetID = null, $row = null) { if ($row === null) { $sql = "SELECT *\n\t\t\t\t\tFROM ugml_fleets\n\t\t\t\t\tLEFT JOIN ugml_naval_formation_to_fleets\n\t\t \t\t\tON ugml_fleets.fleet_id = ugml_naval_formation_to_fleets.fleetID\n\t\t \t\tLEFT JOIN ugml_naval_formation\n\t\t \t\t\tON ugml_naval_formation_to_fleets.formationID = ugml_naval_formation.formationID\n\t\t \t\t\tWHERE fleet_id = " . $fleetID; $row = WCF::getDB()->getFirstRow($sql); } parent::__construct($row); if ($this->fleet_mess != 1) { $this->time = $this->fleet_start_time; } else { $this->time = $this->fleet_end_time; } /*$shipTypeDatas = explode(";", $this->fleet_array); foreach($shipTypeDatas as $shipTypeData) { $shipArray = explode(",", $shipTypeData); if(empty($shipArray[1]) || !$shipArray[1]) continue; $this->fleet[$shipArray[0]] = $shipArray[1]; }*/ $this->fleet = LWUtil::unserialize($this->fleet_array); $this->fleetID = $this->fleet_id; }