本文整理汇总了PHP中IsVacationMode函数的典型用法代码示例。如果您正苦于以下问题:PHP IsVacationMode函数的具体用法?PHP IsVacationMode怎么用?PHP IsVacationMode使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了IsVacationMode函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: IsElementBuyable
function IsElementBuyable($CurrentUser, $CurrentPlanet, $Element, $Incremental = true, $ForDestroy = false)
{
global $pricelist, $resource, $xgp_root, $phpEx;
include_once $xgp_root . 'includes/functions/IsVacationMode.' . $phpEx;
if (IsVacationMode($CurrentUser)) {
return false;
}
if ($Incremental) {
$level = $CurrentPlanet[$resource[$Element]] ? $CurrentPlanet[$resource[$Element]] : $CurrentUser[$resource[$Element]];
}
$RetValue = true;
$array = array('metal', 'crystal', 'deuterium', 'energy_max');
foreach ($array as $ResType) {
if ($pricelist[$Element][$ResType] != 0) {
if ($Incremental) {
$cost[$ResType] = floor($pricelist[$Element][$ResType] * pow($pricelist[$Element]['factor'], $level));
} else {
$cost[$ResType] = floor($pricelist[$Element][$ResType]);
}
if ($ForDestroy) {
$cost[$ResType] = floor($cost[$ResType] / 2);
}
if ($cost[$ResType] > $CurrentPlanet[$ResType]) {
$RetValue = false;
}
}
}
return $RetValue;
}
示例2: IsElementBuyable
function IsElementBuyable($USER, $PLANET, $Element, $Incremental = true, $ForDestroy = false)
{
global $pricelist, $resource;
include_once ROOT_PATH . 'includes/functions/IsVacationMode.' . PHP_EXT;
if (IsVacationMode($USER)) {
return false;
}
if ($Incremental) {
$level = isset($PLANET[$resource[$Element]]) ? $PLANET[$resource[$Element]] : $USER[$resource[$Element]];
}
$array = array('metal', 'crystal', 'deuterium', 'energy_max', 'darkmatter');
foreach ($array as $ResType) {
if (empty($pricelist[$Element][$ResType])) {
continue;
}
if ($Incremental) {
$cost[$ResType] = floor($pricelist[$Element][$ResType] * pow($pricelist[$Element]['factor'], $level));
} else {
$cost[$ResType] = floor($pricelist[$Element][$ResType]);
}
if ($ForDestroy) {
$cost[$ResType] = floor($cost[$ResType] / 2);
}
if (isset($PLANET[$ResType]) && $cost[$ResType] > $PLANET[$ResType] || isset($USER[$ResType]) && $cost[$ResType] > $USER[$ResType]) {
return false;
}
}
return true;
}
示例3: show
public function show()
{
global $USER, $PLANET, $resource, $LNG;
if (IsVacationMode($USER)) {
FleetFunctions::GotoFleetPage(0);
}
$targetMission = HTTP::_GP('mission', 3);
$TransportMetal = max(0, round(HTTP::_GP('metal', 0.0)));
$TransportCrystal = max(0, round(HTTP::_GP('crystal', 0.0)));
$TransportDeuterium = max(0, round(HTTP::_GP('deuterium', 0.0)));
$stayTime = HTTP::_GP('staytime', 0);
$token = HTTP::_GP('token', '');
$config = Config::get();
if (!isset($_SESSION['fleet'][$token])) {
FleetFunctions::GotoFleetPage(1);
}
if ($_SESSION['fleet'][$token]['time'] < TIMESTAMP - 600) {
unset($_SESSION['fleet'][$token]);
FleetFunctions::GotoFleetPage(0);
}
$formData = $_SESSION['fleet'][$token];
unset($_SESSION['fleet'][$token]);
$distance = $formData['distance'];
$targetGalaxy = $formData['targetGalaxy'];
$targetSystem = $formData['targetSystem'];
$targetPlanet = $formData['targetPlanet'];
$targetType = $formData['targetType'];
$fleetGroup = $formData['fleetGroup'];
$fleetArray = $formData['fleet'];
$fleetStorage = $formData['fleetRoom'];
$fleetSpeed = $formData['fleetSpeed'];
if ($targetMission != 2) {
$fleetGroup = 0;
}
if ($PLANET['galaxy'] == $targetGalaxy && $PLANET['system'] == $targetSystem && $PLANET['planet'] == $targetPlanet && $PLANET['planet_type'] == $targetType) {
$this->printMessage($LNG['fl_error_same_planet'], array(array('label' => $LNG['sys_back'], 'url' => 'game.php?page=fleet1')));
}
if ($targetGalaxy < 1 || $targetGalaxy > $config->max_galaxy || $targetSystem < 1 || $targetSystem > $config->max_system || $targetPlanet < 1 || $targetPlanet > $config->max_planets + 1 || $targetType !== 1 && $targetType !== 2 && $targetType !== 3) {
$this->printMessage($LNG['fl_invalid_target'], array(array('label' => $LNG['sys_back'], 'url' => 'game.php?page=fleet1')));
}
if ($targetMission == 3 && $TransportMetal + $TransportCrystal + $TransportDeuterium < 1) {
$this->printMessage($LNG['fl_no_noresource'], array(array('label' => $LNG['sys_back'], 'url' => 'game.php?page=fleet2')));
}
$ActualFleets = FleetFunctions::GetCurrentFleets($USER['id']);
if (FleetFunctions::GetMaxFleetSlots($USER) <= $ActualFleets) {
$this->printMessage($LNG['fl_no_slots'], array(array('label' => $LNG['sys_back'], 'url' => 'game.php?page=fleetTable')));
}
$ACSTime = 0;
$db = Database::get();
if (!empty($fleetGroup)) {
$sql = "SELECT ankunft FROM %%USERS_ACS%% INNER JOIN %%AKS%% ON id = acsID\n\t\t\tWHERE acsID = :acsID AND :maxFleets > (SELECT COUNT(*) FROM %%FLEETS%% WHERE fleet_group = :acsID);";
$ACSTime = $db->selectSingle($sql, array(':acsID' => $fleetGroup, ':maxFleets' => $config->max_fleets_per_acs), 'ankunft');
if (empty($ACSTime)) {
$fleetGroup = 0;
$targetMission = 1;
}
}
$sql = "SELECT id, id_owner, der_metal, der_crystal, destruyed, ally_deposit FROM %%PLANETS%% WHERE universe = :universe AND galaxy = :targetGalaxy AND system = :targetSystem AND planet = :targetPlanet AND planet_type = :targetType;";
$targetPlanetData = $db->selectSingle($sql, array(':universe' => Universe::current(), ':targetGalaxy' => $targetGalaxy, ':targetSystem' => $targetSystem, ':targetPlanet' => $targetPlanet, ':targetType' => $targetType == 2 ? 1 : $targetType));
if ($targetMission == 7) {
if (!empty($targetPlanetData)) {
$this->printMessage($LNG['fl_target_exists'], array(array('label' => $LNG['sys_back'], 'url' => 'game.php?page=fleet1')));
}
if ($targetType != 1) {
$this->printMessage($LNG['fl_only_planets_colonizable'], array(array('label' => $LNG['sys_back'], 'url' => 'game.php?page=fleet1')));
}
}
if ($targetMission == 7 || $targetMission == 15) {
$targetPlanetData = array('id' => 0, 'id_owner' => 0, 'planettype' => 1);
} else {
if ($targetPlanetData["destruyed"] != 0) {
$this->printMessage($LNG['fl_no_target'], array(array('label' => $LNG['sys_back'], 'url' => 'game.php?page=fleet1')));
}
if (empty($targetPlanetData)) {
$this->printMessage($LNG['fl_no_target'], array(array('label' => $LNG['sys_back'], 'url' => 'game.php?page=fleet1')));
}
}
foreach ($fleetArray as $Ship => $Count) {
if ($Count > $PLANET[$resource[$Ship]]) {
$this->printMessage($LNG['fl_not_all_ship_avalible'], array(array('label' => $LNG['sys_back'], 'url' => 'game.php?page=fleetTable')));
}
}
if ($targetMission == 11) {
$activeExpedition = FleetFunctions::GetCurrentFleets($USER['id'], 11, true);
$maxExpedition = FleetFunctions::getDMMissionLimit($USER);
if ($activeExpedition >= $maxExpedition) {
$this->printMessage($LNG['fl_no_expedition_slot'], array(array('label' => $LNG['sys_back'], 'url' => 'game.php?page=fleetTable')));
}
} elseif ($targetMission == 15) {
$activeExpedition = FleetFunctions::GetCurrentFleets($USER['id'], 15, true);
$maxExpedition = FleetFunctions::getExpeditionLimit($USER);
if ($activeExpedition >= $maxExpedition) {
$this->printMessage($LNG['fl_no_expedition_slot'], array(array('label' => $LNG['sys_back'], 'url' => 'game.php?page=fleetTable')));
}
}
$usedPlanet = isset($targetPlanetData['id_owner']);
$myPlanet = $usedPlanet && $targetPlanetData['id_owner'] == $USER['id'];
$targetPlayerData = array();
if ($targetMission == 7 || $targetMission == 15) {
$targetPlayerData = array('id' => 0, 'onlinetime' => TIMESTAMP, 'ally_id' => 0, 'urlaubs_modus' => 0, 'authattack' => 0, 'total_points' => 0);
//.........这里部分代码省略.........
示例4: show
public function show()
{
global $USER, $PLANET, $resource, $LNG, $pricelist;
$UserDeuterium = $PLANET['deuterium'];
$planetID = HTTP::_GP('planetID', 0);
$targetMission = HTTP::_GP('mission', 0);
$activeSlots = FleetFunctions::GetCurrentFleets($USER['id']);
$maxSlots = FleetFunctions::GetMaxFleetSlots($USER);
$this->returnData['slots'] = $activeSlots;
if (IsVacationMode($USER)) {
$this->sendData(620, $LNG['fa_vacation_mode_current']);
}
if (empty($planetID)) {
$this->sendData(601, $LNG['fa_planet_not_exist']);
}
if ($maxSlots <= $activeSlots) {
$this->sendData(612, $LNG['fa_no_more_slots']);
}
$fleetArray = array();
$db = Database::get();
switch ($targetMission) {
case 6:
if (!isModuleAvailable(MODULE_MISSION_SPY)) {
$this->sendData(699, $LNG['sys_module_inactive']);
}
$ships = min($USER['spio_anz'], $PLANET[$resource[210]]);
if (empty($ships)) {
$this->sendData(611, $LNG['fa_no_spios']);
}
$fleetArray = array(210 => $ships);
$this->returnData['ships'][210] = $PLANET[$resource[210]] - $ships;
break;
case 8:
if (!isModuleAvailable(MODULE_MISSION_RECYCLE)) {
$this->sendData(699, $LNG['sys_module_inactive']);
}
$sql = "SELECT (der_metal + der_crystal) as sum FROM %%PLANETS%% WHERE id = :planetID;";
$totalDebris = $db->selectSingle($sql, array(':planetID' => $planetID), 'sum');
$recElementIDs = array(219, 209);
$fleetArray = array();
foreach ($recElementIDs as $elementID) {
$shipsNeed = min(ceil($totalDebris / $pricelist[$elementID]['capacity']), $PLANET[$resource[$elementID]]);
$totalDebris -= $shipsNeed * $pricelist[$elementID]['capacity'];
$fleetArray[$elementID] = $shipsNeed;
$this->returnData['ships'][$elementID] = $PLANET[$resource[$elementID]] - $shipsNeed;
if ($totalDebris <= 0) {
break;
}
}
if (empty($fleetArray)) {
$this->sendData(611, $LNG['fa_no_recyclers']);
}
break;
default:
$this->sendData(610, $LNG['fa_not_enough_probes']);
break;
}
$fleetArray = array_filter($fleetArray);
if (empty($fleetArray)) {
$this->sendData(610, $LNG['fa_not_enough_probes']);
}
$sql = "SELECT planet.id_owner as id_owner,\n\t\tplanet.galaxy as galaxy,\n\t\tplanet.system as system,\n\t\tplanet.planet as planet,\n\t\tplanet.planet_type as planet_type,\n\t\ttotal_points, onlinetime, urlaubs_modus, banaday, authattack\n\t\tFROM %%PLANETS%% planet\n\t\tINNER JOIN %%USERS%% user ON planet.id_owner = user.id\n\t\tLEFT JOIN %%STATPOINTS%% as stat ON stat.id_owner = user.id AND stat.stat_type = '1'\n\t\tWHERE planet.id = :planetID;";
$targetData = $db->selectSingle($sql, array(':planetID' => $planetID));
if (empty($targetData)) {
$this->sendData(601, $LNG['fa_planet_not_exist']);
}
if ($targetMission == 6) {
if (Config::get()->adm_attack == 1 && $targetData['authattack'] > $USER['authlevel']) {
$this->sendData(619, $LNG['fa_action_not_allowed']);
}
if (IsVacationMode($targetData)) {
$this->sendData(605, $LNG['fa_vacation_mode']);
}
$sql = 'SELECT total_points
FROM %%STATPOINTS%%
WHERE id_owner = :userId AND stat_type = :statType';
$USER += Database::get()->selectSingle($sql, array(':userId' => $USER['id'], ':statType' => 1));
$IsNoobProtec = CheckNoobProtec($USER, $targetData, $targetData);
if ($IsNoobProtec['NoobPlayer']) {
$this->sendData(603, $LNG['fa_week_player']);
}
if ($IsNoobProtec['StrongPlayer']) {
$this->sendData(604, $LNG['fa_strong_player']);
}
if ($USER['id'] == $targetData['id_owner']) {
$this->sendData(618, $LNG['fa_not_spy_yourself']);
}
}
$SpeedFactor = FleetFunctions::GetGameSpeedFactor();
$Distance = FleetFunctions::GetTargetDistance(array($PLANET['galaxy'], $PLANET['system'], $PLANET['planet']), array($targetData['galaxy'], $targetData['system'], $targetData['planet']));
$SpeedAllMin = FleetFunctions::GetFleetMaxSpeed($fleetArray, $USER);
$Duration = FleetFunctions::GetMissionDuration(10, $SpeedAllMin, $Distance, $SpeedFactor, $USER);
$consumption = FleetFunctions::GetFleetConsumption($fleetArray, $Duration, $Distance, $USER, $SpeedFactor);
$UserDeuterium -= $consumption;
if ($UserDeuterium < 0) {
$this->sendData(613, $LNG['fa_not_enough_fuel']);
}
if ($consumption > FleetFunctions::GetFleetRoom($fleetArray)) {
$this->sendData(613, $LNG['fa_no_fleetroom']);
}
//.........这里部分代码省略.........
示例5: show
public function show()
{
global $USER, $PLANET, $reslist, $resource, $LNG;
$acsData = array();
$FleetID = HTTP::_GP('fleetID', 0);
$GetAction = HTTP::_GP('action', "");
$db = Database::get();
$this->tplObj->loadscript('flotten.js');
if (!empty($FleetID) && !IsVacationMode($USER)) {
switch ($GetAction) {
case "sendfleetback":
FleetFunctions::SendFleetBack($USER, $FleetID);
break;
case "acs":
$acsData = $this->getACSPageData($FleetID);
break;
}
}
$techExpedition = $USER[$resource[124]];
if ($techExpedition >= 1) {
$activeExpedition = FleetFunctions::GetCurrentFleets($USER['id'], 15, true);
$maxExpedition = floor(sqrt($techExpedition));
} else {
$activeExpedition = 0;
$maxExpedition = 0;
}
$maxFleetSlots = FleetFunctions::GetMaxFleetSlots($USER);
$targetGalaxy = HTTP::_GP('galaxy', (int) $PLANET['galaxy']);
$targetSystem = HTTP::_GP('system', (int) $PLANET['system']);
$targetPlanet = HTTP::_GP('planet', (int) $PLANET['planet']);
$targetType = HTTP::_GP('planettype', (int) $PLANET['planet_type']);
$targetMission = HTTP::_GP('target_mission', 0);
$sql = "SELECT * FROM %%FLEETS%% WHERE fleet_owner = :userID AND fleet_mission <> 10 ORDER BY fleet_end_time ASC;";
$fleetResult = $db->select($sql, array(':userID' => $USER['id']));
$activeFleetSlots = $db->rowCount();
$FlyingFleetList = array();
foreach ($fleetResult as $fleetsRow) {
$FleetList[$fleetsRow['fleet_id']] = FleetFunctions::unserialize($fleetsRow['fleet_array']);
if ($fleetsRow['fleet_mission'] == 4 && $fleetsRow['fleet_mess'] == FLEET_OUTWARD) {
$returnTime = $fleetsRow['fleet_start_time'];
} else {
$returnTime = $fleetsRow['fleet_end_time'];
}
$FlyingFleetList[] = array('id' => $fleetsRow['fleet_id'], 'mission' => $fleetsRow['fleet_mission'], 'state' => $fleetsRow['fleet_mess'], 'startGalaxy' => $fleetsRow['fleet_start_galaxy'], 'startSystem' => $fleetsRow['fleet_start_system'], 'startPlanet' => $fleetsRow['fleet_start_planet'], 'startTime' => _date($LNG['php_tdformat'], $fleetsRow['fleet_start_time'], $USER['timezone']), 'endGalaxy' => $fleetsRow['fleet_end_galaxy'], 'endSystem' => $fleetsRow['fleet_end_system'], 'endPlanet' => $fleetsRow['fleet_end_planet'], 'endTime' => _date($LNG['php_tdformat'], $fleetsRow['fleet_end_time'], $USER['timezone']), 'amount' => pretty_number($fleetsRow['fleet_amount']), 'returntime' => $returnTime, 'resttime' => $returnTime - TIMESTAMP, 'FleetList' => $FleetList[$fleetsRow['fleet_id']]);
}
$FleetsOnPlanet = array();
foreach ($reslist['fleet'] as $FleetID) {
if ($PLANET[$resource[$FleetID]] == 0) {
continue;
}
$FleetsOnPlanet[] = array('id' => $FleetID, 'speed' => FleetFunctions::GetFleetMaxSpeed($FleetID, $USER), 'count' => $PLANET[$resource[$FleetID]]);
}
$this->assign(array('FleetsOnPlanet' => $FleetsOnPlanet, 'FlyingFleetList' => $FlyingFleetList, 'activeExpedition' => $activeExpedition, 'maxExpedition' => $maxExpedition, 'activeFleetSlots' => $activeFleetSlots, 'maxFleetSlots' => $maxFleetSlots, 'targetGalaxy' => $targetGalaxy, 'targetSystem' => $targetSystem, 'targetPlanet' => $targetPlanet, 'targetType' => $targetType, 'targetMission' => $targetMission, 'acsData' => $acsData, 'isVacation' => IsVacationMode($USER), 'bonusAttack' => $USER[$resource[109]] * 10 + (1 + abs($USER['factor']['Attack'])) * 100, 'bonusDefensive' => $USER[$resource[110]] * 10 + (1 + abs($USER['factor']['Defensive'])) * 100, 'bonusShield' => $USER[$resource[111]] * 10 + (1 + abs($USER['factor']['Shield'])) * 100, 'bonusCombustion' => $USER[$resource[115]] * 10, 'bonusImpulse' => $USER[$resource[117]] * 20, 'bonusHyperspace' => $USER[$resource[118]] * 30));
$this->display('page.fleetTable.default.tpl');
}
示例6: ShowFleet3Page
function ShowFleet3Page($CurrentUser, $CurrentPlanet)
{
global $resource, $pricelist, $reslist, $phpEx, $lang, $xgp_root, $game_config;
include_once $xgp_root . 'includes/functions/IsVacationMode.' . $phpEx;
$parse = $lang;
if (IsVacationMode($CurrentUser)) {
die(message($lang['fl_vacation_mode_active'], "game.php?page=overview", 2));
}
$fleet_group_mr = 0;
if ($_POST['fleet_group'] > 0) {
if ($_POST['mission'] == 2) {
$target = "g" . intval($_POST["galaxy"]) . "s" . intval($_POST["system"]) . "p" . intval($_POST["planet"]) . "t" . intval($_POST["planettype"]);
if ($_POST['acs_target_mr'] == $target) {
$aks_count_mr = doquery("SELECT * FROM {{table}} WHERE id = '" . intval($_POST['fleet_group']) . "'", 'aks');
if (mysql_num_rows($aks_count_mr) > 0) {
$fleet_group_mr = $_POST['fleet_group'];
}
}
}
}
if ($_POST['fleet_group'] == 0 && $_POST['mission'] == 2) {
$_POST['mission'] = 1;
}
$TargetPlanet = doquery("SELECT `id_owner`,`id_level`,`destruyed`,`ally_deposit` FROM {{table}} WHERE `galaxy` = '" . intval($_POST['galaxy']) . "' AND `system` = '" . intval($_POST['system']) . "' AND `planet` = '" . intval($_POST['planet']) . "' AND `planet_type` = '" . intval($_POST['planettype']) . "';", 'planets', true);
$MyDBRec = doquery("SELECT `id`,`onlinetime`,`ally_id`,`urlaubs_modus` FROM {{table}} WHERE `id` = '" . intval($CurrentUser['id']) . "';", 'users', true);
$IsHereWormHole = doquery("SELECT * FROM {{table}} WHERE (`start_galaxy` = '" . $_POST['galaxy'] . "' AND `start_system` = '" . $_POST['system'] . "' AND `start_planet` = '" . $_POST['planet'] . "') OR (`end_galaxy` = '" . $_POST['galaxy'] . "' AND `end_system` = '" . $_POST['system'] . "' AND `end_planet` = '" . $_POST['planet'] . "');", 'wormholes', true);
$protection = $game_config['noobprotection'];
$protectiontime = $game_config['noobprotectiontime'];
$protectionmulti = $game_config['noobprotectionmulti'];
if ($protectiontime < 1) {
$protectiontime = 9999999999999999;
}
$fleetarray = unserialize(base64_decode(str_rot13($_POST["usedfleet"])));
if ($TargetPlanet["destruyed"] != 0) {
die(header("Location: game.php?page=fleet"));
}
if (!is_array($fleetarray)) {
die(header("Location: game.php?page=fleet"));
}
foreach ($fleetarray as $Ship => $Count) {
if ($Count > $CurrentPlanet[$resource[$Ship]]) {
die(header("Location: game." . $phpEx . "?page=fleet"));
}
}
$error = 0;
$galaxy = intval($_POST['galaxy']);
$system = intval($_POST['system']);
$planet = intval($_POST['planet']);
$planettype = intval($_POST['planettype']);
$fleetmission = intval($_POST['mission']);
if ($planettype != 1 && $planettype != 2 && $planettype != 3) {
exit(header("Location: game." . $phpEx . "?page=fleet"));
}
if ($fleetmission == 8) {
$YourPlanet = false;
$UsedPlanet = false;
$select = doquery("SELECT * FROM {{table}} WHERE galaxy = '" . $galaxy . "' AND system = '" . $system . "' AND planet = '" . $planet . "'", "planets");
} else {
$YourPlanet = false;
$UsedPlanet = false;
$select = doquery("SELECT * FROM {{table}} WHERE galaxy = '" . $galaxy . "' AND system = '" . $system . "' AND planet = '" . $planet . "' AND planet_type = '" . $planettype . "'", "planets");
}
if ($CurrentPlanet['galaxy'] == $galaxy && $CurrentPlanet['system'] == $system && $CurrentPlanet['planet'] == $planet && $CurrentPlanet['planet_type'] == $planettype) {
exit(header("Location: game." . $phpEx . "?page=fleet"));
}
if ($_POST['mission'] != 15) {
if (mysql_num_rows($select) < 1 && $fleetmission != 7) {
exit(header("Location: game." . $phpEx . "?page=fleet"));
} elseif ($fleetmission == 9 && mysql_num_rows($select) < 1) {
exit(header("Location: game." . $phpEx . "?page=fleet"));
}
} else {
$MaxExpedition = $CurrentUser[$resource[124]];
if ($MaxExpedition >= 1) {
$maxexpde = doquery("SELECT COUNT(fleet_owner) AS `expedi` FROM {{table}} WHERE `fleet_owner` = '" . intval($CurrentUser['id']) . "' AND `fleet_mission` = '15';", 'fleets', true);
$ExpeditionEnCours = $maxexpde['expedi'];
$EnvoiMaxExpedition = 1 + floor($MaxExpedition / 3);
} else {
$ExpeditionEnCours = 0;
$EnvoiMaxExpedition = 0;
}
if ($EnvoiMaxExpedition == 0) {
message("<font color=\"red\"><b>" . $lang['fl_expedition_tech_required'] . "</b></font>", "game." . $phpEx . "?page=fleet", 2);
} elseif ($ExpeditionEnCours >= $EnvoiMaxExpedition) {
message("<font color=\"red\"><b>" . $lang['fl_expedition_fleets_limit'] . "</b></font>", "game." . $phpEx . "?page=fleet", 2);
}
}
$select = mysql_fetch_array($select);
if ($select['id_owner'] == $CurrentUser['id']) {
$YourPlanet = true;
$UsedPlanet = true;
} elseif (!empty($select['id_owner'])) {
$YourPlanet = false;
$UsedPlanet = true;
} else {
$YourPlanet = false;
$UsedPlanet = false;
}
if (empty($fleetmission)) {
exit(header("Location: game." . $phpEx . "?page=fleet"));
//.........这里部分代码省略.........
示例7: show
public function show()
{
global $USER, $PLANET, $resource, $pricelist, $reslist, $CONF, $LNG, $UNI;
if (IsVacationMode($USER)) {
FleetFunctions::GotoFleetPage(0);
}
$targetMission = HTTP::_GP('mission', 3);
$TransportMetal = max(0, round(HTTP::_GP('metal', 0.0)));
$TransportCrystal = max(0, round(HTTP::_GP('crystal', 0.0)));
$TransportDeuterium = max(0, round(HTTP::_GP('deuterium', 0.0)));
$TransportElyrium = max(0, round(HTTP::_GP('elyrium', 0.0)));
$TransportPopulation301 = max(0, round(HTTP::_GP('population301', 0.0)));
$TransportPopulation302 = max(0, round(HTTP::_GP('population302', 0.0)));
$TransportPopulation303 = max(0, round(HTTP::_GP('population303', 0.0)));
$TransportPopulation304 = max(0, round(HTTP::_GP('population304', 0.0)));
$TransportPopulation305 = max(0, round(HTTP::_GP('population305', 0.0)));
$TransportPopulation306 = max(0, round(HTTP::_GP('population306', 0.0)));
$TransportPopulation307 = max(0, round(HTTP::_GP('population307', 0.0)));
$TransportPopulation309 = max(0, round(HTTP::_GP('population309', 0.0)));
$stayTime = HTTP::_GP('staytime', 0);
$speed = HTTP::_GP('speed', 10);
$token = HTTP::_GP('tokens', '');
if (!isset($_SESSION['fleet'][$token])) {
FleetFunctions::GotoFleetPage(1);
}
if ($_SESSION['fleet'][$token]['time'] < TIMESTAMP - 600) {
unset($_SESSION['fleet'][$token]);
FleetFunctions::GotoFleetPage(0);
}
$maxFleetSpeed = $_SESSION['fleet'][$token]['speed'];
$distance = $_SESSION['fleet'][$token]['distance'];
$targetGalaxy = $_SESSION['fleet'][$token]['targetGalaxy'];
$targetSystem = $_SESSION['fleet'][$token]['targetSystem'];
$targetPlanet = $_SESSION['fleet'][$token]['targetPlanet'];
$targetType = $_SESSION['fleet'][$token]['targetType'];
$fleetGroup = $_SESSION['fleet'][$token]['fleetGroup'];
$fleetArray = $_SESSION['fleet'][$token]['fleet'];
$fleetStorage = $_SESSION['fleet'][$token]['fleetRoom'];
$fleetSpeed = $speed;
unset($_SESSION['fleet'][$token]);
if ($targetMission != 2) {
$fleetGroup = 0;
}
if ($PLANET['galaxy'] == $targetGalaxy && $PLANET['system'] == $targetSystem && $PLANET['planet'] == $targetPlanet && $PLANET['planet_type'] == $targetType) {
$this->printMessage('<span class="rouge">' . $LNG['fl_error_same_planet'] . '</span>');
}
if ($targetGalaxy < 1 || $targetGalaxy > Config::get('max_galaxy') || $targetSystem < 1 || $targetSystem > Config::get('max_system') || $targetPlanet < 1 || $targetPlanet > Config::get('max_planets') + 1 || $targetType !== 1 && $targetType !== 2 && $targetType !== 3) {
$this->printMessage('<span class="rouge">' . $LNG['fl_invalid_target'] . '</span>');
}
if ($targetMission == 3 && $TransportMetal + $TransportCrystal + $TransportDeuterium + $TransportElyrium < 1) {
$this->printMessage('<span class="rouge">' . $LNG['fl_no_noresource'] . '</span>');
}
$ActualFleets = FleetFunctions::GetCurrentFleets($USER['id']);
if (FleetFunctions::GetMaxFleetSlots($USER) <= $ActualFleets) {
$this->printMessage('<span class="rouge">' . $LNG['fl_no_slots'] . '</span>');
}
$ACSTime = 0;
if (!empty($fleetGroup)) {
$ACSTime = $GLOBALS['DATABASE']->getFirstCell("SELECT ankunft\n\t\t\tFROM " . USERS_ACS . " \n\t\t\tINNER JOIN " . AKS . " ON id = acsID\n\t\t\tWHERE acsID = " . $fleetGroup . "\n\t\t\tAND " . Config::get('max_fleets_per_acs') . " > (SELECT COUNT(*) FROM " . FLEETS . " WHERE fleet_group = " . $fleetGroup . ");");
if (empty($ACSTime)) {
$fleetGroup = 0;
$targetMission = 1;
}
}
$ActualFleets = FleetFunctions::GetCurrentFleets($USER['id']);
$targetPlanetData = $GLOBALS['DATABASE']->getFirstRow("SELECT id, id_owner, der_metal, der_crystal, destruyed, ally_deposit FROM " . PLANETS . " WHERE universe = " . $UNI . " AND galaxy = " . $targetGalaxy . " AND system = " . $targetSystem . " AND planet = " . $targetPlanet . " AND planet_type = '" . ($targetType == 2 ? 1 : $targetType) . "';");
if ($targetMission == 1 || $targetMission == 6 || $targetMission == 3 || $targetMission == 14) {
$ipCheck = $GLOBALS['DATABASE']->query("SELECT userID, secondID FROM uni1_ipblock WHERE userID = " . $USER['id'] . " OR secondID = '" . $USER['id'] . "';");
if ($GLOBALS['DATABASE']->numRows($ipCheck) > 0) {
while ($xb = $GLOBALS['DATABASE']->fetch_array($ipCheck)) {
if ($targetPlanetData['id_owner'] == $xb['userID'] || $targetPlanetData['id_owner'] == $xb['secondID']) {
$this->printMessage(sprintf($LNG['fleet_multi_block'], $this->getUsername($targetPlanetData['id_owner'])));
}
}
}
}
if ($targetMission == 7) {
if (isset($targetPlanetData)) {
$this->printMessage('<span class="rouge">' . $LNG['fl_target_exists'] . '</span>');
}
if ($targetType != 1) {
$this->printMessage('<span class="rouge">' . $LNG['fl_only_planets_colonizable'] . '</span>');
}
}
if ($targetMission == 7 || $targetMission == 15) {
$targetPlanetData = array('id' => 0, 'id_owner' => 0, 'planettype' => 1);
} else {
if ($targetPlanetData["destruyed"] != 0) {
$this->printMessage('<span class="rouge">' . $LNG['fl_no_target'] . '</span>');
}
if (!isset($targetPlanetData)) {
$this->printMessage('<span class="rouge">' . $LNG['fl_no_target'] . '</span>');
}
}
foreach ($fleetArray as $Ship => $Count) {
if ($Count > $PLANET[$resource[$Ship]]) {
$this->printMessage('<span class="rouge">' . $LNG['fl_not_all_ship_avalible'] . '</span>');
}
}
if ($targetMission == 11) {
//.........这里部分代码省略.........
示例8: show
public function show()
{
global $USER, $PLANET, $resource, $LNG, $CONF, $pricelist;
$UserDeuterium = $PLANET['elyrium'];
$planetID = HTTP::_GP('planetID', 0);
$targetMission = HTTP::_GP('mission', 0);
$select = HTTP::_GP('select', 0);
if (IsVacationMode($USER)) {
$this->sendData(620, $LNG['fa_vacation_mode_current']);
}
$fleetArray = array();
switch ($targetMission) {
case 13:
if (!isModulAvalible(MODULE_MISSION_ATTACK)) {
$this->sendData('rouge', $LNG['sys_module_inactive']);
}
$GetuserComp = $GLOBALS['DATABASE']->query("SELECT * FROM `uni1_fleets_manage` WHERE userID = " . $USER['id'] . " AND manageID = " . $select . ";");
$num_rows = $GLOBALS['DATABASE']->numRows($GetuserComp);
if ($num_rows == 0) {
$this->sendData('rouge', 'You need to create a fleet shortcut first');
} else {
while ($xb = $GLOBALS['DATABASE']->fetch_array($GetuserComp)) {
$ship202 = min($xb['ship202'], $PLANET[$resource[202]]);
$ship203 = min($xb['ship203'], $PLANET[$resource[203]]);
$ship204 = min($xb['ship204'], $PLANET[$resource[204]]);
$ship205 = min($xb['ship205'], $PLANET[$resource[205]]);
$ship206 = min($xb['ship206'], $PLANET[$resource[206]]);
$ship207 = min($xb['ship207'], $PLANET[$resource[207]]);
$ship211 = min($xb['ship211'], $PLANET[$resource[211]]);
$ship214 = min($xb['ship214'], $PLANET[$resource[214]]);
$ship215 = min($xb['ship215'], $PLANET[$resource[215]]);
$ship216 = min($xb['ship216'], $PLANET[$resource[216]]);
if (empty($ship202) && $xb['ship202'] > 0) {
$this->sendData(611, sprintf($LNG['fleet_ajax_15'], $LNG['tech'][202]));
} elseif (empty($ship203) && $xb['ship203'] > 0) {
$this->sendData(611, sprintf($LNG['fleet_ajax_15'], $LNG['tech'][202]));
} elseif (empty($ship204) && $xb['ship204'] > 0) {
$this->sendData(611, sprintf($LNG['fleet_ajax_15'], $LNG['tech'][202]));
} elseif (empty($ship205) && $xb['ship205'] > 0) {
$this->sendData(611, sprintf($LNG['fleet_ajax_15'], $LNG['tech'][202]));
} elseif (empty($ship206) && $xb['ship206'] > 0) {
$this->sendData(611, sprintf($LNG['fleet_ajax_15'], $LNG['tech'][202]));
} elseif (empty($ship207) && $xb['ship207'] > 0) {
$this->sendData(611, sprintf($LNG['fleet_ajax_15'], $LNG['tech'][202]));
} elseif (empty($ship211) && $xb['ship211'] > 0) {
$this->sendData(611, sprintf($LNG['fleet_ajax_15'], $LNG['tech'][202]));
} elseif (empty($ship214) && $xb['ship214'] > 0) {
$this->sendData(611, sprintf($LNG['fleet_ajax_15'], $LNG['tech'][202]));
} elseif (empty($ship215) && $xb['ship215'] > 0) {
$this->sendData(611, sprintf($LNG['fleet_ajax_15'], $LNG['tech'][202]));
} elseif (empty($ship216) && $xb['ship216'] > 0) {
$this->sendData(611, sprintf($LNG['fleet_ajax_15'], $LNG['tech'][202]));
}
$fleetArray = array(202 => $ship202, 203 => $ship203, 204 => $ship204, 205 => $ship205, 206 => $ship206, 207 => $ship207, 211 => $ship211, 214 => $ship214, 215 => $ship215, 216 => $ship216);
$this->returnData['ships'][202] = $PLANET[$resource[202]] - $ship202;
$this->returnData['ships'][203] = $PLANET[$resource[203]] - $ship203;
$this->returnData['ships'][204] = $PLANET[$resource[204]] - $ship204;
$this->returnData['ships'][205] = $PLANET[$resource[205]] - $ship205;
$this->returnData['ships'][206] = $PLANET[$resource[206]] - $ship206;
$this->returnData['ships'][207] = $PLANET[$resource[207]] - $ship207;
$this->returnData['ships'][211] = $PLANET[$resource[211]] - $ship211;
$this->returnData['ships'][214] = $PLANET[$resource[214]] - $ship214;
$this->returnData['ships'][215] = $PLANET[$resource[215]] - $ship215;
$this->returnData['ships'][216] = $PLANET[$resource[216]] - $ship216;
}
}
break;
default:
$this->sendData('rouge', $LNG['fleet_ajax_2']);
break;
}
$fleetArray = array_filter($fleetArray);
if (empty($fleetArray)) {
$this->sendData('rouge', $LNG['fleet_ajax_2']);
}
$targetData = $GLOBALS['DATABASE']->getFirstRow("SELECT planet.id_owner as id_owner, \n\t\t\t\t\t\t\t\t\t\tplanet.id as id, \n\t\t\t\t\t\t\t\t\t\tplanet.name as name, \n\t\t\t\t\t\t\t\t\t\tplanet.galaxy as galaxy, \n\t\t\t\t\t\t\t\t\t\tplanet.system as system, \n\t\t\t\t\t\t\t\t\t\tplanet.planet as planet,\n\t\t\t\t\t\t\t\t\t\tplanet.planet_type as planet_type, \n\t\t\t\t\t\t\t\t\t\tplanet.teleport_portal as teleport_portal, \n\t\t\t\t\t\t\t\t\t\tplanet.force_field_timer as force_field_timer, \n\t\t\t\t\t\t\t\t\t\ttotal_points, onlinetime, urlaubs_modus, banaday, forcefield_tech, authattack, user_deleted, username\n\t\t\t\t\t\t\t\t\t\tFROM " . PLANETS . " planet\n\t\t\t\t\t\t\t\t\t\tINNER JOIN " . USERS . " user ON planet.id_owner = user.id\n\t\t\t\t\t\t\t\t\t\tLEFT JOIN " . STATPOINTS . " as stat ON stat.id_owner = user.id AND stat.stat_type = '1' \n\t\t\t\t\t\t\t\t\t\tWHERE planet.id = " . $planetID . ";");
$BuddyCheck = $GLOBALS['DATABASE']->query("SELECT * FROM uni1_buddy WHERE (sender = '" . $USER['id'] . "' AND owner = '" . $targetData['id_owner'] . "' AND state = '1') OR (owner = '" . $USER['id'] . "' AND sender = '" . $targetData['id_owner'] . "' AND state = '1');");
if (empty($targetData)) {
$this->sendData('rouge', $LNG['fa_planet_not_exist']);
}
if ($targetMission == 1 || $targetMission == 6 || $targetMission == 3 || $targetMission == 14 || $targetMission == 13) {
$ipCheck = $GLOBALS['DATABASE']->query("SELECT userID, secondID FROM uni1_ipblock WHERE userID = " . $USER['id'] . " OR secondID = '" . $USER['id'] . "';");
if ($GLOBALS['DATABASE']->numRows($ipCheck) > 0) {
while ($xb = $GLOBALS['DATABASE']->fetch_array($ipCheck)) {
if ($targetData['id_owner'] == $xb['userID'] || $targetData['id_owner'] == $xb['secondID']) {
$this->sendData('rouge', '<span class=rouge>' . sprintf($LNG['fleet_multi_block'], $this->getUsername($targetData['id_owner'])) . '</span>');
}
}
}
if ($GLOBALS['DATABASE']->numRows($BuddyCheck) >= 1) {
$this->sendData('rouge', sprintf($LNG['fleet_pact'], $this->getUsername($targetData['id_owner'])));
}
}
if ($targetMission == 13) {
if ($targetMission == 13) {
if (FleetFunctions::CheckBashPortal($targetData['id_owner'])) {
$this->sendData('rouge', $LNG['fl_bash_protection']);
}
}
if ($targetData['id_owner'] == $USER['id']) {
//.........这里部分代码省略.........
示例9: show
public function show()
{
global $USER, $PLANET, $LNG, $CONF, $reslist, $resource, $UNI;
$iraks = $PLANET['interplanetary_misil'];
$targetGalaxy = HTTP::_GP('galaxy', 0);
$targetSystem = HTTP::_GP('system', 0);
$targetPlanet = HTTP::_GP('planet', 0);
$targetType = HTTP::_GP('type', 0);
$anz = min(HTTP::_GP('SendMI', 0), $iraks);
$pziel = HTTP::_GP('Target', 0);
$target = $GLOBALS['DATABASE']->getFirstRow("SELECT `id`, `id_owner` FROM " . PLANETS . " WHERE `universe` = '" . $UNI . "' AND `galaxy` = '" . $targetGalaxy . "' AND `system` = '" . $targetSystem . "' AND `planet` = '" . $targetPlanet . "' AND `planet_type` = " . $targetType . ";");
$Range = FleetFunctions::GetMissileRange($USER[$resource[117]]);
$systemMin = $PLANET['system'] - $Range;
$systemMax = $PLANET['system'] + $Range;
$error = "";
if (IsVacationMode($USER)) {
$error = $LNG['fl_vacation_mode_active'];
} elseif ($PLANET['silo'] < 4) {
$error = $LNG['ma_silo_level'];
} elseif ($USER['impulse_motor_tech'] == 0) {
$error = $LNG['ma_impulse_drive_required'];
} elseif ($targetGalaxy != $PLANET['galaxy'] || $targetSystem < $systemMin || $targetSystem > $systemMax) {
$error = $LNG['ma_not_send_other_galaxy'];
} elseif (!$target) {
$error = $LNG['ma_planet_doesnt_exists'];
} elseif (!in_array($pziel, $reslist['defense']) && $pziel != 0) {
$error = $LNG['ma_wrong_target'];
} elseif ($iraks == 0) {
$error = $LNG['ma_no_missiles'];
} elseif ($anz <= 0) {
$error = $LNG['ma_add_missile_number'];
}
$targetUser = GetUserByID($target['id_owner'], array('onlinetime', 'banaday', 'urlaubs_modus', 'authattack'));
if (Config::get('adm_attack') == 1 && $targetUser['authattack'] > $USER['authlevel']) {
$error = $LNG['fl_admin_attack'];
} elseif ($targetUser['urlaubs_modus']) {
$error = $LNG['fl_in_vacation_player'];
}
$User2Points = $GLOBALS['DATABASE']->getFirstRow("SELECT `total_points` FROM " . STATPOINTS . " WHERE `stat_type` = '1' AND `id_owner` = '" . $target['id_owner'] . "';");
$IsNoobProtec = CheckNoobProtec($USER, $User2Points, $targetUser);
if ($IsNoobProtec['NoobPlayer']) {
$error = $LNG['fl_week_player'];
} elseif ($IsNoobProtec['StrongPlayer']) {
$error = $LNG['fl_strong_player'];
}
if ($error != "") {
$this->printMessage($error);
}
$Duration = FleetFunctions::GetMIPDuration($PLANET['system'], $targetSystem);
$DefenseLabel = $pziel == 0 ? $LNG['ma_all'] : $LNG['tech'][$pziel];
if (connection_aborted()) {
exit;
}
$fleetArray = array(503 => $anz);
$fleetStartTime = TIMESTAMP + $Duration;
$fleetStayTime = $fleetStartTime;
$fleetEndTime = $fleetStartTime;
$fleetRessource = array(901 => 0, 902 => 0, 903 => 0);
FleetFunctions::sendFleet($fleetArray, 10, $USER['id'], $PLANET['id'], $PLANET['galaxy'], $PLANET['system'], $PLANET['planet'], $PLANET['planet_type'], $target['id_owner'], $target['id'], $targetGalaxy, $targetSystem, $targetPlanet, $targetType, $fleetRessource, $fleetStartTime, $fleetStayTime, $fleetEndTime, 0, $pziel);
$this->printMessage("<b>" . $anz . "</b>" . $LNG['ma_missiles_sended'] . $DefenseLabel);
}
示例10: show
public function show()
{
global $USER, $PLANET, $resource, $LNG, $CONF, $pricelist;
$UserDeuterium = $PLANET['elyrium'];
$planetID = HTTP::_GP('planetID', 0);
$targetMission = HTTP::_GP('mission', 0);
$galaxyC = HTTP::_GP('galaxyC', 0);
$systemC = HTTP::_GP('systemC', 0);
$planetC = HTTP::_GP('planetC', 0);
if (IsVacationMode($USER)) {
$this->sendData(620, $LNG['fa_vacation_mode_current']);
}
$fleetArray = array();
switch ($targetMission) {
case 14:
if (!isModulAvalible(MODULE_MISSION_SPY)) {
$this->sendData('rouge', $LNG['sys_module_inactive']);
}
if ($PLANET['teleport_portal'] == 0) {
$this->sendData('rouge', $LNG['fleet_ajax_11']);
}
$ships = min($USER['spio_anz'], $PLANET[$resource[210]]);
if (empty($ships)) {
$this->sendData('rouge', $LNG['fleet_ajax_22']);
}
$fleetArray = array(210 => $ships);
$this->returnData['ships'][210] = $PLANET[$resource[210]] - $ships;
break;
case 7:
if (!isModulAvalible(MODULE_MISSION_COLONY)) {
$this->sendData('rouge', $LNG['sys_module_inactive']);
}
if ($PLANET['teleport_portal'] == 0) {
$this->sendData('rouge', $LNG['fleet_ajax_11']);
}
if ($PLANET[$resource[303]] < 10 || $PLANET[$resource[306]] < 100) {
$this->sendData('rouge', sprintf($LNG['fleet_ajax_12'], $PLANET[$resource[303]], $PLANET[$resource[306]]));
}
$fleetArray = array(303 => 10, 306 => 100);
break;
default:
$this->sendData('rouge', $LNG['fleet_ajax_22']);
break;
}
$fleetArray = array_filter($fleetArray);
if (empty($fleetArray)) {
$this->sendData('rouge', $LNG['fleet_ajax_22']);
}
$iPlanetCount = $GLOBALS['DATABASE']->getFirstCell("SELECT COUNT(*) FROM " . PLANETS . " WHERE `id_owner` = '" . $USER['id'] . "' AND `planet_type` = '1' AND `destruyed` = '0';");
$MaxPlanets = PlayerUtil::maxPlanetCount($USER);
if ($iPlanetCount >= $MaxPlanets && $targetMission == 7) {
$this->sendData('rouge', $LNG['fleet_ajax_14']);
}
$targetData = $GLOBALS['DATABASE']->getFirstRow("SELECT planet.id_owner as id_owner, \n\t\t\t\t\t\t\t\t\t\tplanet.id as id, \n\t\t\t\t\t\t\t\t\t\tplanet.name as name, \n\t\t\t\t\t\t\t\t\t\tplanet.galaxy as galaxy, \n\t\t\t\t\t\t\t\t\t\tplanet.system as system, \n\t\t\t\t\t\t\t\t\t\tplanet.planet as planet,\n\t\t\t\t\t\t\t\t\t\tplanet.planet_type as planet_type, \n\t\t\t\t\t\t\t\t\t\tplanet.force_field_timer as force_field_timer, \n\t\t\t\t\t\t\t\t\t\tplanet.teleport_portal as teleport_portal, \n\t\t\t\t\t\t\t\t\t\ttotal_points, onlinetime, forcefield_tech, urlaubs_modus, banaday, authattack, user_deleted, username\n\t\t\t\t\t\t\t\t\t\tFROM " . PLANETS . " planet\n\t\t\t\t\t\t\t\t\t\tINNER JOIN " . USERS . " user ON planet.id_owner = user.id\n\t\t\t\t\t\t\t\t\t\tLEFT JOIN " . STATPOINTS . " as stat ON stat.id_owner = user.id AND stat.stat_type = '1' \n\t\t\t\t\t\t\t\t\t\tWHERE planet.galaxy = " . $galaxyC . " AND planet.system = " . $systemC . " AND planet.planet = " . $planetC . ";");
$BuddyCheck = $GLOBALS['DATABASE']->query("SELECT * FROM uni1_buddy WHERE (sender = '" . $USER['id'] . "' AND owner = '" . $targetData['id_owner'] . "' AND state = '1') OR (owner = '" . $USER['id'] . "' AND sender = '" . $targetData['id_owner'] . "' AND state = '1');");
if ($targetMission == 1 || $targetMission == 6 || $targetMission == 3 || $targetMission == 14 || $targetMission == 13) {
$ipCheck = $GLOBALS['DATABASE']->query("SELECT userID, secondID FROM uni1_ipblock WHERE userID = " . $USER['id'] . " OR secondID = '" . $USER['id'] . "';");
if ($GLOBALS['DATABASE']->numRows($ipCheck) > 0) {
while ($xb = $GLOBALS['DATABASE']->fetch_array($ipCheck)) {
if ($targetData['id_owner'] == $xb['userID'] || $targetData['id_owner'] == $xb['secondID']) {
$this->sendData('rouge', '<span class=rouge>' . sprintf($LNG['fleet_multi_block'], $this->getUsername($targetData['id_owner'])) . '</span>');
}
}
}
if ($GLOBALS['DATABASE']->numRows($BuddyCheck) >= 1) {
$this->sendData('rouge', sprintf($LNG['fleet_pact'], $this->getUsername($targetData['id_owner'])));
}
}
if ($targetMission == 14) {
if ($targetData['id_owner'] == $USER['id']) {
$this->sendData('rouge', $LNG['fleet_ajax_19']);
}
if ($targetData['force_field_timer'] > TIMESTAMP && $USER['virus_tech'] < $targetData['forcefield_tech']) {
$this->sendData('rouge', sprintf($LNG['fleet_ajax_21'], $this->getUsername($targetData['id_owner'])));
}
if ($targetData['teleport_portal'] == 0) {
$this->sendData('rouge', sprintf($LNG['fleet_ajax_18'], $targetData['name'], $targetData['system'], $targetData['planet']));
}
if ($targetData['user_deleted'] == 1) {
$this->sendData('rouge', sprintf($LNG['fleet_ajax_3'], $targetData['username']));
}
if ($targetData['banaday'] > TIMESTAMP) {
$this->sendData('rouge', sprintf($LNG['fleet_ajax_4'], $targetData['username']));
}
if (Config::get('adm_attack') == 1 && $targetData['authattack'] > $USER['authlevel']) {
$this->sendData('rouge', $LNG['fa_action_not_allowed']);
}
if (IsVacationMode($targetData)) {
$this->sendData('rouge', sprintf($LNG['fleet_ajax_5'], $targetData['username']));
}
$IsNoobProtec = CheckNoobProtec($USER, $targetData, $targetData);
if ($IsNoobProtec['NoobPlayer']) {
$this->sendData('rouge', sprintf($LNG['fleet_ajax_6'], $targetData['username']));
}
if ($IsNoobProtec['StrongPlayer']) {
$this->sendData('rouge', sprintf($LNG['fleet_ajax_7'], $targetData['username']));
}
if ($USER['id'] == $targetData['id_owner']) {
$this->sendData('rouge', $LNG['fleet_ajax_8']);
}
//.........这里部分代码省略.........
示例11: BuildRessourcePage
function BuildRessourcePage($CurrentUser, $CurrentPlanet)
{
global $pricelist, $lang, $ProdGrid, $resource, $reslist, $game_config, $_POST;
includeLang('resources');
if (IsVacationMode($CurrentUser)) {
message($lang['Vacation_mode'], $lang['Error'], "overview.php", 1);
}
$RessBodyTPL = gettemplate('resources');
$RessRowTPL = gettemplate('resources_row');
// Si c'est une lune ... pas de ressources produites
if ($CurrentPlanet['planet_type'] == 3) {
$game_config['metal_basic_income'] = 0;
$game_config['crystal_basic_income'] = 0;
$game_config['deuterium_basic_income'] = 0;
}
$ValidList['percent'] = array(0, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100);
$SubQry = "";
if ($_POST) {
foreach ($_POST as $Field => $Value) {
$FieldName = $Field . "_porcent";
if (isset($CurrentPlanet[$FieldName])) {
if (!in_array($Value, $ValidList['percent'])) {
header("Location: overview.php");
exit;
}
$Value = $Value / 10;
$CurrentPlanet[$FieldName] = $Value;
$SubQry .= ", `" . $FieldName . "` = '" . $Value . "'";
}
}
}
$parse = $lang;
$parse['production_level'] = 100;
if ($CurrentPlanet['energy_max'] == 0 && $CurrentPlanet['energy_used'] > 0) {
$post_porcent = 0;
} elseif ($CurrentPlanet['energy_max'] > 0 && $CurrentPlanet['energy_used'] + $CurrentPlanet['energy_max'] < 0) {
$post_porcent = floor($CurrentPlanet['energy_max'] / $CurrentPlanet['energy_used'] * 100);
} else {
$post_porcent = 100;
}
if ($post_porcent > 100) {
$post_porcent = 100;
}
// -------------------------------------------------------------------------------------------------------
// Mise a jour de l'espace de stockage
$CurrentPlanet['metal_max'] = floor(BASE_STORAGE_SIZE * pow(1.5, $CurrentPlanet[$resource[22]])) * (1 + $CurrentUser['rpg_stockeur'] * 0.5);
$CurrentPlanet['crystal_max'] = floor(BASE_STORAGE_SIZE * pow(1.5, $CurrentPlanet[$resource[23]])) * (1 + $CurrentUser['rpg_stockeur'] * 0.5);
$CurrentPlanet['deuterium_max'] = floor(BASE_STORAGE_SIZE * pow(1.5, $CurrentPlanet[$resource[24]])) * (1 + $CurrentUser['rpg_stockeur'] * 0.5);
// -------------------------------------------------------------------------------------------------------
$parse['resource_row'] = "";
$CurrentPlanet['metal_perhour'] = 0;
$CurrentPlanet['crystal_perhour'] = 0;
$CurrentPlanet['deuterium_perhour'] = 0;
$CurrentPlanet['energy_max'] = 0;
$CurrentPlanet['energy_used'] = 0;
$BuildTemp = $CurrentPlanet['temp_max'];
foreach ($reslist['prod'] as $ProdID) {
if ($CurrentPlanet[$resource[$ProdID]] > 0 && isset($ProdGrid[$ProdID])) {
$BuildLevelFactor = $CurrentPlanet[$resource[$ProdID] . "_porcent"];
$BuildLevel = $CurrentPlanet[$resource[$ProdID]];
$metal = floor(eval($ProdGrid[$ProdID]['formule']['metal']) * $game_config['resource_multiplier'] * (1 + $CurrentUser['rpg_geologue'] * 0.05));
$crystal = floor(eval($ProdGrid[$ProdID]['formule']['crystal']) * $game_config['resource_multiplier'] * (1 + $CurrentUser['rpg_geologue'] * 0.05));
$deuterium = floor(eval($ProdGrid[$ProdID]['formule']['deuterium']) * $game_config['resource_multiplier'] * (1 + $CurrentUser['rpg_geologue'] * 0.05));
$energy = floor(eval($ProdGrid[$ProdID]['formule']['energy']) * $game_config['resource_multiplier'] * (1 + $CurrentUser['rpg_ingenieur'] * 0.05));
if ($energy > 0) {
$CurrentPlanet['energy_max'] += $energy;
} else {
$CurrentPlanet['energy_used'] += $energy;
}
$CurrentPlanet['metal_perhour'] += $metal;
$CurrentPlanet['crystal_perhour'] += $crystal;
$CurrentPlanet['deuterium_perhour'] += $deuterium;
$metal = $metal * 0.01 * $post_porcent;
$crystal = $crystal * 0.01 * $post_porcent;
$deuterium = $deuterium * 0.01 * $post_porcent;
$energy = $energy * 0.01 * $post_porcent;
$Field = $resource[$ProdID] . "_porcent";
$CurrRow = array();
$CurrRow['name'] = $resource[$ProdID];
$CurrRow['porcent'] = $CurrentPlanet[$Field];
for ($Option = 10; $Option >= 0; $Option--) {
$OptValue = $Option * 10;
if ($Option == $CurrRow['porcent']) {
$OptSelected = " selected=selected";
} else {
$OptSelected = "";
}
$CurrRow['option'] .= "<option value=\"" . $OptValue . "\"" . $OptSelected . ">" . $OptValue . "%</option>";
}
$CurrRow['type'] = $lang['tech'][$ProdID];
$CurrRow['level'] = $ProdID > 200 ? $lang['quantity'] : $lang['level'];
$CurrRow['level_type'] = $CurrentPlanet[$resource[$ProdID]];
$CurrRow['metal_type'] = pretty_number($metal);
$CurrRow['crystal_type'] = pretty_number($crystal);
$CurrRow['deuterium_type'] = pretty_number($deuterium);
$CurrRow['energy_type'] = pretty_number($energy);
$CurrRow['metal_type'] = colorNumber($CurrRow['metal_type']);
$CurrRow['crystal_type'] = colorNumber($CurrRow['crystal_type']);
$CurrRow['deuterium_type'] = colorNumber($CurrRow['deuterium_type']);
$CurrRow['energy_type'] = colorNumber($CurrRow['energy_type']);
//.........这里部分代码省略.........
示例12: ShowFleet3Page
function ShowFleet3Page($CurrentUser, &$CurrentPlanet)
{
global $resource, $pricelist, $reslist, $phpEx, $lang, $svn_root, $db, $displays;
include_once $svn_root . 'includes/functions/IsVacationMode.' . $phpEx;
//$parse = $lang;
if (IsVacationMode($CurrentUser)) {
exit($displays->message($lang['fl_vacation_mode_active'], "game.php?page=overview", 2));
}
$displays->assignContent('fleet/fleet3_table');
$fleet_group_mr = 0;
if ($_POST['fleet_group'] != 0) {
if ($_POST['mission'] == 2) {
$aks_count_mr = $db->query("SELECT * FROM {{table}} WHERE id = '" . $_POST['fleet_group'] . "'", 'sac');
if (mysql_num_rows($aks_count_mr) > 0) {
$fleet_group_mr = $_POST['fleet_group'];
}
}
}
if ($_POST['fleet_group'] == 0 && $_POST['mission'] == 2) {
$_POST['mission'] = 1;
}
$TargetPlanet = $db->query("SELECT `id_owner`,`id_level`,`destruyed`,`ally_deposit` FROM {{table}} WHERE `galaxy` = '" . $_POST['galaxy'] . "' AND `system` = '" . $_POST['system'] . "' AND `planet` = '" . $_POST['planet'] . "' AND `planet_type` = '" . $_POST['planettype'] . "';", 'planets', true);
$MyDBRec = $db->query("SELECT `id`,`onlinetime`,`ally_id`,`urlaubs_modus` FROM {{table}} WHERE `id` = '" . $CurrentUser['id'] . "';", 'users', true);
$protection = $db->game_config['noobprotection'];
$protectiontime = $db->game_config['noobprotectiontime'];
$protectionmulti = $db->game_config['noobprotectionmulti'];
if ($protectiontime < 1) {
$protectiontime = 9999999999999999;
}
$fleetarray = unserialize(base64_decode(str_rot13($_POST["usedfleet"])));
if ($TargetPlanet["destruyed"] != 0) {
exit(header("Location: game." . $phpEx . "?page=fleet"));
}
if (!is_array($fleetarray)) {
exit(header("Location: game." . $phpEx . "?page=fleet"));
}
foreach ($fleetarray as $Ship => $Count) {
if ($Count > $CurrentPlanet[$resource[$Ship]]) {
exit(header("location:game." . $phpEx . "?page=fleet"));
}
}
$error = 0;
$galaxy = intval($_POST['galaxy']);
$system = intval($_POST['system']);
$planet = intval($_POST['planet']);
$planettype = intval($_POST['planettype']);
$fleetmission = $_POST['mission'];
if ($planettype != 1 && $planettype != 2 && $planettype != 3) {
exit(header("location:game." . $phpEx . "?page=fleet"));
}
if ($fleetmission == 8) {
$YourPlanet = false;
$UsedPlanet = false;
$select = $db->query("SELECT * FROM {{table}} WHERE galaxy = '" . $galaxy . "' AND system = '" . $system . "' AND planet = '" . $planet . "'", "planets");
} else {
$YourPlanet = false;
$UsedPlanet = false;
$select = $db->query("SELECT * FROM {{table}} WHERE galaxy = '" . $galaxy . "' AND system = '" . $system . "' AND planet = '" . $planet . "' AND planet_type = '" . $planettype . "'", "planets");
}
if ($CurrentPlanet['galaxy'] == $galaxy && $CurrentPlanet['system'] == $system && $CurrentPlanet['planet'] == $planet && $CurrentPlanet['planet_type'] == $planettype) {
exit(header("location:game." . $phpEx . "?page=fleet"));
}
if ($_POST['mission'] != 15) {
if (mysql_num_rows($select) < 1 && $fleetmission != 7) {
exit(header("location:game." . $phpEx . "?page=fleet"));
} elseif ($fleetmission == 9 && mysql_num_rows($select) < 1) {
exit(header("location:game." . $phpEx . "?page=fleet"));
}
} else {
$MaxExpedition = $CurrentUser[$resource[124]];
if ($MaxExpedition >= 1) {
$maxexpde = $db->query("SELECT COUNT(fleet_owner) AS `expedi` FROM {{table}} WHERE `fleet_owner` = '" . $CurrentUser['id'] . "' AND `fleet_mission` = '15';", 'fleets', true);
$ExpeditionEnCours = $maxexpde['expedi'];
$EnvoiMaxExpedition = 1 + floor($MaxExpedition / 3);
} else {
$ExpeditionEnCours = 0;
$EnvoiMaxExpedition = 0;
}
if ($EnvoiMaxExpedition == 0) {
$displays->message("<font color=\"red\"><b>" . $lang['fl_expedition_tech_required'] . "</b></font>", "game." . $phpEx . "?page=fleet", 2);
} elseif ($ExpeditionEnCours >= $EnvoiMaxExpedition) {
$displays->message("<font color=\"red\"><b>" . $lang['fl_expedition_fleets_limit'] . "</b></font>", "game." . $phpEx . "?page=fleet", 2);
}
}
$select = mysql_fetch_array($select);
if ($select['id_owner'] == $CurrentUser['id']) {
$YourPlanet = true;
$UsedPlanet = true;
} elseif (!empty($select['id_owner'])) {
$YourPlanet = false;
$UsedPlanet = true;
} else {
$YourPlanet = false;
$UsedPlanet = false;
}
if (empty($fleetmission)) {
exit(header("location:game." . $phpEx . "?page=fleet"));
}
if ($TargetPlanet['id_owner'] == '') {
$HeDBRec = $MyDBRec;
//.........这里部分代码省略.........
示例13: show
public function show()
{
global $USER, $PLANET, $reslist, $resource, $LNG;
$acsData = array();
$FleetID = HTTP::_GP('fleetID', 0);
$GetAction = HTTP::_GP('action', "");
$this->tplObj->loadscript('flotten.js');
if (!empty($FleetID) && !IsVacationMode($USER)) {
switch ($GetAction) {
case "sendfleetback":
FleetFunctions::SendFleetBack($USER, $FleetID);
break;
case "acs":
$acsData = $this->getACSPageData($FleetID);
break;
}
}
$techExpedition = $USER[$resource[124]];
if ($techExpedition >= 1) {
$activeExpedition = FleetFunctions::GetCurrentFleets($USER['id'], 15);
$maxExpedition = floor(sqrt($techExpedition));
} else {
$activeExpedition = 0;
$maxExpedition = 0;
}
$maxFleetSlots = FleetFunctions::GetMaxFleetSlots($USER);
$targetGalaxy = HTTP::_GP('galaxy', (int) $PLANET['galaxy']);
$targetSystem = HTTP::_GP('system', (int) $PLANET['system']);
$targetPlanet = HTTP::_GP('planet', (int) $PLANET['planet']);
$targetType = HTTP::_GP('planettype', (int) $PLANET['planet_type']);
$targetMission = HTTP::_GP('target_mission', 0);
$fleetResult = $GLOBALS['DATABASE']->query("SELECT * FROM " . FLEETS . " WHERE fleet_owner = " . $USER['id'] . " AND fleet_mission <> 10 ORDER BY fleet_end_time ASC;");
$activeFleetSlots = $GLOBALS['DATABASE']->numRows($fleetResult);
$FlyingFleetList = array();
while ($fleetsRow = $GLOBALS['DATABASE']->fetch_array($fleetResult)) {
$fleet = explode(";", $fleetsRow['fleet_array']);
$FleetList = array();
foreach ($fleet as $shipDetail) {
if (empty($shipDetail)) {
continue;
}
$ship = explode(",", $shipDetail);
$FleetList[$fleetsRow['fleet_id']][$ship[0]] = $ship[1];
}
if ($fleetsRow['fleet_mission'] == 4 && $fleetsRow['fleet_mess'] == FLEET_OUTWARD) {
$returnTime = $fleetsRow['fleet_start_time'];
} else {
$returnTime = $fleetsRow['fleet_end_time'];
}
$FlyingFleetList[] = array('id' => $fleetsRow['fleet_id'], 'mission' => $fleetsRow['fleet_mission'], 'state' => $fleetsRow['fleet_mess'], 'startGalaxy' => $fleetsRow['fleet_start_galaxy'], 'startSystem' => $fleetsRow['fleet_start_system'], 'startPlanet' => $fleetsRow['fleet_start_planet'], 'startTime' => _date($LNG['php_tdformat'], $fleetsRow['fleet_start_time'], $USER['timezone']), 'endGalaxy' => $fleetsRow['fleet_end_galaxy'], 'endSystem' => $fleetsRow['fleet_end_system'], 'endPlanet' => $fleetsRow['fleet_end_planet'], 'endTime' => _date($LNG['php_tdformat'], $fleetsRow['fleet_end_time'], $USER['timezone']), 'amount' => pretty_number($fleetsRow['fleet_amount']), 'returntime' => $returnTime, 'resttime' => $returnTime - TIMESTAMP, 'FleetList' => $FleetList[$fleetsRow['fleet_id']]);
}
$GLOBALS['DATABASE']->free_result($fleetResult);
$FleetsOnPlanet = array();
$avaible_fleets = array(202, 203, 209, 223, 219, 210, 224, 204, 205, 206, 207, 211, 214, 215, 216);
foreach ($avaible_fleets as $FleetID) {
if ($PLANET[$resource[$FleetID]] == 0) {
continue;
}
$FleetsOnPlanet[] = array('id' => $FleetID, 'speed' => FleetFunctions::GetFleetMaxSpeed($FleetID, $USER), 'count' => $PLANET[$resource[$FleetID]]);
}
$this->tplObj->assign_vars(array('FleetsOnPlanet' => $FleetsOnPlanet, 'FlyingFleetList' => $FlyingFleetList, 'activeExpedition' => $activeExpedition, 'maxExpedition' => $maxExpedition, 'activeFleetSlots' => $activeFleetSlots, 'maxFleetSlots' => $maxFleetSlots, 'targetGalaxy' => $targetGalaxy, 'targetSystem' => $targetSystem, 'targetPlanet' => $targetPlanet, 'targetType' => $targetType, 'targetMission' => $targetMission, 'acsData' => $acsData, 'isVacation' => IsVacationMode($USER), 'bonusAttack' => $USER[$resource[109]] * 10 + (1 + abs($USER['factor']['Attack'])) * 100, 'bonusDefensive' => $USER[$resource[110]] * 10 + (1 + abs($USER['factor']['Defensive'])) * 100, 'bonusShield' => $USER[$resource[111]] * 10 + (1 + abs($USER['factor']['Shield'])) * 100, 'bonusCombustion' => $USER[$resource[115]] * 10, 'bonusImpulse' => $USER[$resource[117]] * 20, 'bonusHyperspace' => $USER[$resource[118]] * 30));
$this->display('page.fleetTable.default.tpl');
}
示例14: show
public function show()
{
global $USER, $PLANET, $reslist, $resource, $LNG;
$acsData = array();
$FleetID = HTTP::_GP('fleetID', 0);
$GetAction = HTTP::_GP('action', "");
$this->tplObj->loadscript('flotten.js');
if (!empty($FleetID) && !IsVacationMode($USER)) {
switch ($GetAction) {
case "sendfleetback":
FleetFunctions::SendFleetBack($USER, $FleetID);
break;
case "acs":
$acsData = $this->getACSPageData($FleetID);
break;
}
}
$techExpedition = $USER[$resource[124]];
if ($techExpedition >= 1) {
$activeExpedition = FleetFunctions::GetCurrentFleets($USER['id'], 15);
$maxExpedition = floor(sqrt($techExpedition));
} else {
$activeExpedition = 0;
$maxExpedition = 0;
}
$maxFleetSlots = FleetFunctions::GetMaxFleetSlots($USER);
$targetGalaxy = HTTP::_GP('galaxy', (int) $PLANET['galaxy']);
$targetSystem = HTTP::_GP('system', (int) $PLANET['system']);
$targetPlanet = HTTP::_GP('planet', (int) $PLANET['planet']);
$targetType = HTTP::_GP('planettype', (int) $PLANET['planet_type']);
$targetMission = HTTP::_GP('target_mission', 0);
$fleetResult = $GLOBALS['DATABASE']->query("SELECT * FROM " . FLEETS . " WHERE fleet_owner = " . $USER['id'] . " AND fleet_mission <> 10 ORDER BY fleet_end_time ASC;");
$activeFleetSlots = $GLOBALS['DATABASE']->numRows($fleetResult);
$FlyingFleetList = array();
while ($fleetsRow = $GLOBALS['DATABASE']->fetch_array($fleetResult)) {
$fleet = explode(";", $fleetsRow['fleet_array']);
$FleetList = array();
foreach ($fleet as $shipDetail) {
if (empty($shipDetail)) {
continue;
}
$ship = explode(",", $shipDetail);
$FleetList[$fleetsRow['fleet_id']][$ship[0]] = $ship[1];
}
if ($fleetsRow['fleet_mission'] == 4 && $fleetsRow['fleet_mess'] == FLEET_OUTWARD) {
$returnTime = $fleetsRow['fleet_start_time'];
} else {
$returnTime = $fleetsRow['fleet_end_time'];
}
$FlyingFleetList[] = array('id' => $fleetsRow['fleet_id'], 'mission' => $fleetsRow['fleet_mission'], 'state' => $fleetsRow['fleet_mess'], 'startGalaxy' => $fleetsRow['fleet_start_galaxy'], 'startSystem' => $fleetsRow['fleet_start_system'], 'startPlanet' => $fleetsRow['fleet_start_planet'], 'startTime' => _date($LNG['php_tdformat'], $fleetsRow['fleet_start_time'], $USER['timezone']), 'endGalaxy' => $fleetsRow['fleet_end_galaxy'], 'endSystem' => $fleetsRow['fleet_end_system'], 'endPlanet' => $fleetsRow['fleet_end_planet'], 'endTime' => _date($LNG['php_tdformat'], $fleetsRow['fleet_end_time'], $USER['timezone']), 'amount' => pretty_number($fleetsRow['fleet_amount']), 'returntime' => $returnTime, 'resttime' => $returnTime - TIMESTAMP, 'FleetList' => $FleetList[$fleetsRow['fleet_id']]);
}
$GLOBALS['DATABASE']->free_result($fleetResult);
$FleetsOnPlanet = array();
$FleetsOnPlanetTransport = array();
$FleetsOnPlanetProccesors = array();
$FleetsOnPlanetSpecial = array();
$elementALL = array(202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230);
$elementPlanet = array(204, 205, 229, 206, 207, 215, 213, 211, 224, 225, 226, 214, 216, 230, 227, 228, 218, 222, 221);
$elementPlanetTransport = array(202, 203, 217);
$elementPlanetProccesors = array(209, 219);
$elementPlanetSpecial = array(208, 210, 220, 223);
$getch3 = $GLOBALS['DATABASE']->query("SELECT SUM(" . $PLANET[$resource[202]] . " + " . $PLANET[$resource[203]] . " + " . $PLANET[$resource[204]] . " + " . $PLANET[$resource[205]] . " + " . $PLANET[$resource[206]] . " + " . $PLANET[$resource[207]] . " + " . $PLANET[$resource[208]] . " + " . $PLANET[$resource[209]] . " + " . $PLANET[$resource[210]] . " + " . $PLANET[$resource[211]] . " + " . $PLANET[$resource[212]] . " + " . $PLANET[$resource[213]] . " + " . $PLANET[$resource[214]] . " + " . $PLANET[$resource[215]] . " + " . $PLANET[$resource[216]] . " + " . $PLANET[$resource[217]] . " + " . $PLANET[$resource[218]] . " + " . $PLANET[$resource[219]] . " + " . $PLANET[$resource[220]] . " + " . $PLANET[$resource[221]] . " + " . $PLANET[$resource[222]] . " + " . $PLANET[$resource[223]] . " + " . $PLANET[$resource[224]] . " + " . $PLANET[$resource[225]] . " + " . $PLANET[$resource[226]] . " + " . $PLANET[$resource[227]] . " + " . $PLANET[$resource[228]] . ") as fleet3 FROM " . PLANETS . " where `id` = '" . $PLANET['id'] . "'");
while ($x3 = $GLOBALS['DATABASE']->fetch_array($getch3)) {
$resp3 = $x3['fleet3'];
}
$getch = $GLOBALS['DATABASE']->query("SELECT SUM(" . $PLANET[$resource[202]] . " + " . $PLANET[$resource[203]] . " + " . $PLANET[$resource[217]] . ") as fleet FROM " . PLANETS . " where `id` = '" . $PLANET['id'] . "'");
while ($x = $GLOBALS['DATABASE']->fetch_array($getch)) {
$resp = $x['fleet'];
}
$getch1 = $GLOBALS['DATABASE']->query("SELECT SUM(" . $PLANET[$resource[209]] . " + " . $PLANET[$resource[219]] . ") as fleet1 FROM " . PLANETS . " where `id` = '" . $PLANET['id'] . "'");
while ($x1 = $GLOBALS['DATABASE']->fetch_array($getch1)) {
$resp1 = $x1['fleet1'];
}
$getch2 = $GLOBALS['DATABASE']->query("SELECT SUM(" . $PLANET[$resource[208]] . " + " . $PLANET[$resource[210]] . " + " . $PLANET[$resource[220]] . " + " . $PLANET[$resource[223]] . ") as fleet2 FROM " . PLANETS . " where `id` = '" . $PLANET['id'] . "'");
while ($x2 = $GLOBALS['DATABASE']->fetch_array($getch2)) {
$resp2 = $x2['fleet2'];
}
$xxx = $resp2;
$ttt = $resp;
if ($targetMission != 12) {
foreach ($elementPlanet as $FleetID) {
if ($PLANET[$resource[$FleetID]] == 0) {
continue;
}
$FleetsOnPlanet[] = array('id' => $FleetID, 'speed' => FleetFunctions::GetFleetMaxSpeed($FleetID, $USER), 'count' => $PLANET[$resource[$FleetID]]);
}
foreach ($elementPlanetTransport as $FleetID) {
if ($PLANET[$resource[$FleetID]] == 0) {
continue;
}
$FleetsOnPlanetTransport[] = array('id' => $FleetID, 'speed' => FleetFunctions::GetFleetMaxSpeed($FleetID, $USER), 'count' => $PLANET[$resource[$FleetID]]);
}
}
foreach ($elementPlanetProccesors as $FleetID) {
if ($PLANET[$resource[$FleetID]] == 0) {
continue;
}
$FleetsOnPlanetProccesors[] = array('id' => $FleetID, 'speed' => FleetFunctions::GetFleetMaxSpeed($FleetID, $USER), 'count' => $PLANET[$resource[$FleetID]]);
}
foreach ($elementPlanetSpecial as $FleetID) {
//.........这里部分代码省略.........
示例15: define
* @version 1
* @copyright 2008 By Chlorel for XNova
*/
define('INSIDE', true);
define('INSTALL', false);
$ugamela_root_path = './';
include $ugamela_root_path . 'extension.inc';
include $ugamela_root_path . 'common.' . $phpEx;
includeLang('galaxy');
includeLang('fleet');
// blocking non-users
if ($IsUserChecked == false) {
includeLang('login');
message($lang['Login_Ok'], $lang['log_numbreg']);
}
if (IsVacationMode($user)) {
$ResultMessage = "620;" . $lang['gs_c620'] . "|" . $CurrentFlyingFleets . " " . $UserSpyProbes . " " . $UserRecycles . " " . $UserMissiles;
die($ResultMessage);
}
// PREVENT DOUBLE CLICKING :/
sleep(1);
$UserSpyProbes = $planetrow['spy_sonde'];
$UserRecycles = $planetrow['recycler'];
$UserDeuterium = $planetrow['deuterium'];
$UserMissiles = $planetrow['interplanetary_misil'];
$fleet = array();
$speedalls = array();
$PartialFleet = false;
// 610
$PartialCount = 0;
foreach ($reslist['fleet'] as $Node => $ShipID) {