本文整理汇总了PHP中GetTargetAdressLink函数的典型用法代码示例。如果您正苦于以下问题:PHP GetTargetAdressLink函数的具体用法?PHP GetTargetAdressLink怎么用?PHP GetTargetAdressLink使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了GetTargetAdressLink函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: missionCaseStayAlly
/**
* MissionCaseStayAlly @todo description
*
* @global array $lang @see common.php
* @param array $fleetRow @see common.php
* @return bool true.
*/
function missionCaseStayAlly($fleetRow)
{
global $lang;
$readConnection = Nova::getSingleton('core/database_connection_pool')->getConnection('core_read');
$startPlanet = $readConnection->select(array('name', 'id_owner'))->from($readConnection->getDeprecatedTable('planets'))->where('galaxy =?', $fleetRow['fleet_start_galaxy'])->where('system =?', $fleetRow['fleet_start_system'])->where('planet =?', $fleetRow['fleet_start_planet'])->query()->fetch();
$endPlanet = $readConnection->select(array('name', 'id_owner'))->from($readConnection->getDeprecatedTable('planets'))->where('galaxy =?', $fleetRow['fleet_end_galaxy'])->where('system =?', $fleetRow['fleet_end_system'])->where('planet =?', $fleetRow['fleet_end_planet'])->query()->fetch();
$fleetStartLink = GetStartAdressLink($fleetRow, '');
$fleetEndLink = GetTargetAdressLink($fleetRow, '');
if ($fleetRow['fleet_mess'] == 0) {
if ($fleetRow['fleet_end_stay'] <= time()) {
$readConnection->update($readConnection->getDeprecatedTable('fleets'), array('fleet_mess' => 1), array('fleet_id =?' => $fleetRow['fleet_id']));
} else {
if ($fleetRow['fleet_start_time'] <= time()) {
$message = sprintf($lang['sys_tran_mess_owner'], $endPlanet['name'], $fleetEndLink, $fleetRow['fleet_resource_metal'], $lang['Metal'], $fleetRow['fleet_resource_crystal'], $lang['Crystal'], $fleetRow['fleet_resource_deuterium'], $lang['Deuterium']);
SendSimpleMessage($startPlanet['id_owner'], '', $fleetRow['fleet_start_time'], 5, $lang['sys_mess_tower'], $lang['sys_mess_transport'], $message);
$message = sprintf($lang['sys_tran_mess_user'], $startPlanet['name'], $fleetStartLink, $endPlanet['name'], $fleetEndLink, $fleetRow['fleet_resource_metal'], $lang['Metal'], $fleetRow['fleet_resource_crystal'], $lang['Crystal'], $fleetRow['fleet_resource_deuterium'], $lang['Deuterium']);
SendSimpleMessage($endPlanet['id_owner'], '', $fleetRow['fleet_start_time'], 5, $lang['sys_mess_tower'], $lang['sys_mess_transport'], $message);
}
}
} else {
if ($fleetRow['fleet_end_time'] <= time()) {
$message = sprintf($lang['sys_tran_mess_back'], $startPlanet['name'], $fleetStartLink);
SendSimpleMessage($startPlanet['id_owner'], '', $fleetRow['fleet_end_time'], 5, $lang['sys_mess_tower'], $lang['sys_mess_fleetback'], $message);
RestoreFleetToPlanet($fleetRow, true);
$readConnection->delete($readConnection->getDeprecatedTable('fleets'), array('fleet_id =?' => $fleetRow['fleet_id']));
}
}
return true;
}
示例2: ReturnEvent
function ReturnEvent()
{
$LNG = $this->GetUserLang($this->_fleet['fleet_owner']);
$Message = sprintf($LNG['sys_fleet_won'], $TargetName, GetTargetAdressLink($this->_fleet, ''), pretty_number($this->_fleet['fleet_resource_metal']), $LNG['Metal'], pretty_number($this->_fleet['fleet_resource_crystal']), $LNG['Crystal'], pretty_number($this->_fleet['fleet_resource_deuterium']), $LNG['Deuterium']);
SendSimpleMessage($this->_fleet['fleet_owner'], '', $this->_fleet['fleet_end_time'], 3, $LNG['sys_mess_tower'], $LNG['sys_mess_fleetback'], $Message);
$this->RestoreFleet();
}
示例3: ReturnEvent
function ReturnEvent()
{
$LNG = $this->getLanguage(NULL, $this->_fleet['fleet_owner']);
$TargetName = $GLOBALS['DATABASE']->getFirstCell("SELECT name FROM " . PLANETS . " WHERE id = " . $this->_fleet['fleet_start_id'] . ";");
$Message = sprintf($LNG['sys_fleet_won'], $TargetName, GetTargetAdressLink($this->_fleet, ''), pretty_number($this->_fleet['fleet_resource_metal']), $LNG['tech'][901], pretty_number($this->_fleet['fleet_resource_crystal']), $LNG['tech'][902], pretty_number($this->_fleet['fleet_resource_deuterium']), $LNG['tech'][903], pretty_number($this->_fleet['fleet_resource_elyrium']), $LNG['tech'][904]);
SendSimpleMessage($this->_fleet['fleet_owner'], 0, $this->_fleet['fleet_end_time'], 3, $LNG['sys_mess_tower'], $LNG['sys_mess_fleetback'], $Message);
$this->RestoreFleet();
}
示例4: TargetEvent
function TargetEvent()
{
$LNG = $this->GetUserLang($this->_fleet['fleet_owner']);
$TargetUserID = $this->_fleet['fleet_target_owner'];
$TargetMessage = sprintf($LNG['sys_stat_mess'], GetTargetAdressLink($this->_fleet, ''), pretty_number($this->_fleet['fleet_resource_metal']), $LNG['Metal'], pretty_number($this->_fleet['fleet_resource_crystal']), $LNG['Crystal'], pretty_number($this->_fleet['fleet_resource_deuterium']), $LNG['Deuterium']);
SendSimpleMessage($TargetUserID, '', $this->_fleet['fleet_start_time'], 5, $LNG['sys_mess_tower'], $LNG['sys_stat_mess_stay'], $TargetMessage);
$this->RestoreFleet(false);
}
示例5: ReturnEvent
function ReturnEvent()
{
$LNG = $this->getLanguage(NULL, $this->_fleet['fleet_owner']);
$sql = 'SELECT name FROM %%PLANETS%% WHERE id = :planetId;';
$planetName = Database::get()->selectSingle($sql, array(':planetId' => $this->_fleet['fleet_start_id']), 'name');
$Message = sprintf($LNG['sys_fleet_won'], $planetName, GetTargetAdressLink($this->_fleet, ''), pretty_number($this->_fleet['fleet_resource_metal']), $LNG['tech'][901], pretty_number($this->_fleet['fleet_resource_crystal']), $LNG['tech'][902], pretty_number($this->_fleet['fleet_resource_deuterium']), $LNG['tech'][903]);
PlayerUtil::sendMessage($this->_fleet['fleet_owner'], 0, $LNG['sys_mess_tower'], 4, $LNG['sys_mess_fleetback'], $Message, $this->_fleet['fleet_end_time'], NULL, 1, $this->_fleet['fleet_universe']);
$this->RestoreFleet();
}
示例6: TargetEvent
function TargetEvent()
{
global $resource;
$iPlanetCount = $GLOBALS['DATABASE']->getFirstCell("SELECT COUNT(*) FROM " . PLANETS . " WHERE `id_owner` = '" . $this->_fleet['fleet_owner'] . "' AND `planet_type` = '1' AND `destruyed` = '0';");
$iGalaxyPlace = $GLOBALS['DATABASE']->getFirstCell("SELECT COUNT(*) FROM " . PLANETS . " WHERE `id` = '" . $this->_fleet['fleet_end_id'] . "';");
$senderUser = $GLOBALS['DATABASE']->getFirstRow("SELECT * FROM " . USERS . " WHERE `id` = '" . $this->_fleet['fleet_owner'] . "';");
$senderPlanet = $GLOBALS['DATABASE']->getFirstRow("SELECT * FROM " . PLANETS . " WHERE `id` = '" . $this->_fleet['fleet_start_id'] . "';");
$senderUser['factor'] = getFactors($senderUser, 'basic', $this->_fleet['fleet_start_time']);
$LNG = $this->getLanguage($senderUser['lang']);
$MaxPlanets = PlayerUtil::maxPlanetCount($senderUser);
if ($iGalaxyPlace != 0) {
$TheMessage = sprintf($LNG['sys_colo_notfree'], GetTargetAdressLink($this->_fleet, ''));
$this->setState(FLEET_RETURN);
} elseif ($iPlanetCount >= $MaxPlanets) {
$TheMessage = sprintf($LNG['sys_colo_maxcolo'], GetTargetAdressLink($this->_fleet, ''), $MaxPlanets);
$this->setState(FLEET_RETURN);
} elseif (PlayerUtil::allowPlanetPosition($this->_fleet['fleet_end_planet'], $senderUser) == false) {
$TheMessage = sprintf($LNG['sys_colo_notech'], GetTargetAdressLink($this->_fleet, ''), $MaxPlanets);
$this->setState(FLEET_RETURN);
} else {
require_once 'includes/functions/CreateOnePlanetRecord.php';
$NewOwnerPlanet = CreateOnePlanetRecord($this->_fleet['fleet_end_galaxy'], $this->_fleet['fleet_end_system'], $this->_fleet['fleet_end_planet'], $this->_fleet['fleet_universe'], $this->_fleet['fleet_owner'], $LNG['fcp_colony'], false, $senderUser['authlevel']);
if ($NewOwnerPlanet === false) {
$TheMessage = sprintf($LNG['sys_colo_badpos'], GetTargetAdressLink($this->_fleet, ''));
$this->setState(FLEET_RETURN);
} else {
$this->_fleet['fleet_end_id'] = $NewOwnerPlanet;
$TheMessage = sprintf($LNG['sys_colo_allisok'], GetTargetAdressLink($this->_fleet, ''));
$this->StoreGoodsToPlanet();
if ($this->_fleet['fleet_amount'] == 1) {
$this->KillFleet();
} else {
$CurrentFleet = explode(";", $this->_fleet['fleet_array']);
$NewFleet = '';
foreach ($CurrentFleet as $Item => $Group) {
if (empty($Group)) {
continue;
}
$Class = explode(",", $Group);
if ($Class[0] == 208 && $Class[1] > 1) {
$NewFleet .= $Class[0] . "," . ($Class[1] - 1) . ";";
} elseif ($Class[0] != 208 && $Class[1] > 0) {
$NewFleet .= $Class[0] . "," . $Class[1] . ";";
}
}
$this->UpdateFleet('fleet_array', $NewFleet);
$this->UpdateFleet('fleet_amount', $this->_fleet['fleet_amount'] - 1);
$this->UpdateFleet('fleet_resource_metal', 0);
$this->UpdateFleet('fleet_resource_crystal', 0);
$this->UpdateFleet('fleet_resource_deuterium', 0);
$this->setState(FLEET_RETURN);
}
}
}
SendSimpleMessage($this->_fleet['fleet_owner'], 0, $this->_fleet['fleet_start_time'], 4, $LNG['sys_colo_mess_from'], $LNG['sys_colo_mess_report'], $TheMessage);
$this->SaveFleet();
}
示例7: MissionCaseTransport
/**
* MissionCaseTransport.php
*
* @version 1
* @copyright 2008 By Chlorel for XNova
*/
function MissionCaseTransport($FleetRow)
{
global $lang;
$QryStartPlanet = "SELECT * FROM {{table}} ";
$QryStartPlanet .= "WHERE ";
$QryStartPlanet .= "`galaxy` = '" . $FleetRow['fleet_start_galaxy'] . "' AND ";
$QryStartPlanet .= "`system` = '" . $FleetRow['fleet_start_system'] . "' AND ";
$QryStartPlanet .= "`planet` = '" . $FleetRow['fleet_start_planet'] . "' AND ";
$QryStartPlanet .= "`planet_type` = '" . $FleetRow['fleet_start_type'] . "';";
$StartPlanet = doquery($QryStartPlanet, 'planets', true);
$StartName = $StartPlanet['name'];
$StartOwner = $StartPlanet['id_owner'];
$QryTargetPlanet = "SELECT * FROM {{table}} ";
$QryTargetPlanet .= "WHERE ";
$QryTargetPlanet .= "`galaxy` = '" . $FleetRow['fleet_end_galaxy'] . "' AND ";
$QryTargetPlanet .= "`system` = '" . $FleetRow['fleet_end_system'] . "' AND ";
$QryTargetPlanet .= "`planet` = '" . $FleetRow['fleet_end_planet'] . "' AND ";
$QryTargetPlanet .= "`planet_type` = '" . $FleetRow['fleet_end_type'] . "';";
$TargetPlanet = doquery($QryTargetPlanet, 'planets', true);
$TargetName = $TargetPlanet['name'];
$TargetOwner = $TargetPlanet['id_owner'];
if ($FleetRow['fleet_mess'] == 0) {
if ($FleetRow['fleet_start_time'] < time()) {
StoreGoodsToPlanet($FleetRow, false);
$Message = sprintf($lang['sys_tran_mess_owner'], $TargetName, GetTargetAdressLink($FleetRow, ''), $FleetRow['fleet_resource_metal'], $lang['Metal'], $FleetRow['fleet_resource_crystal'], $lang['Crystal'], $FleetRow['fleet_resource_deuterium'], $lang['Deuterium'], $FleetRow['fleet_resource_appolonium'], $lang['Appolonium']);
SendSimpleMessage($StartOwner, '', $FleetRow['fleet_start_time'], 5, $lang['sys_mess_tower'], $lang['sys_mess_transport'], $Message);
if ($TargetOwner != $StartOwner) {
$Message = sprintf($lang['sys_tran_mess_user'], $StartName, GetStartAdressLink($FleetRow, ''), $TargetName, GetTargetAdressLink($FleetRow, ''), $FleetRow['fleet_resource_metal'], $lang['Metal'], $FleetRow['fleet_resource_crystal'], $lang['Crystal'], $FleetRow['fleet_resource_deuterium'], $lang['Deuterium'], $FleetRow['fleet_resource_appolonium'], $lang['Appolonium']);
SendSimpleMessage($TargetOwner, '', $FleetRow['fleet_start_time'], 5, $lang['sys_mess_tower'], $lang['sys_mess_transport'], $Message);
}
$QryUpdateFleet = "UPDATE {{table}} SET ";
$QryUpdateFleet .= "`fleet_resource_metal` = '0' , ";
$QryUpdateFleet .= "`fleet_resource_crystal` = '0' , ";
$QryUpdateFleet .= "`fleet_resource_deuterium` = '0' , ";
$QryUpdateFleet .= "`fleet_resource_appolonium` = '0' , ";
$QryUpdateFleet .= "`fleet_mess` = '1' ";
$QryUpdateFleet .= "WHERE `fleet_id` = '" . $FleetRow['fleet_id'] . "' ";
$QryUpdateFleet .= "LIMIT 1 ;";
doquery($QryUpdateFleet, 'fleets');
}
} else {
if ($FleetRow['fleet_end_time'] < time()) {
$Message = sprintf($lang['sys_tran_mess_back'], $StartName, GetStartAdressLink($FleetRow, ''));
SendSimpleMessage($StartOwner, '', $FleetRow['fleet_end_time'], 5, $lang['sys_mess_tower'], $lang['sys_mess_fleetback'], $Message);
RestoreFleetToPlanet($FleetRow, true);
//Piratenangriff nach Zufallsprinzip
$zufall = 0;
$zufall = rand(1, 10);
if ($zufall == 7) {
Piratenangriff($FleetRow);
$zufall = 0;
}
// Ende Piratenangriff
doquery("DELETE FROM {{table}} WHERE fleet_id=" . $FleetRow["fleet_id"], 'fleets');
}
}
}
示例8: TargetEvent
function TargetEvent()
{
global $db, $resource, $LANG;
$iPlanetCount = $db->countquery("SELECT count(*) FROM " . PLANETS . " WHERE `id_owner` = '" . $this->_fleet['fleet_owner'] . "' AND `planet_type` = '1' AND `destruyed` = '0';");
$iGalaxyPlace = $db->countquery("SELECT count(*) AS plani FROM " . PLANETS . " WHERE `id` = '" . $this->_fleet['fleet_end_id'] . "';");
$Player = $db->uniquequery("SELECT `lang`, `authlevel`, `" . $resource[124] . "` FROM " . USERS . " WHERE `id` = '" . $this->_fleet['fleet_owner'] . "';");
$LNG = $LANG->GetUserLang($Player['lang']);
$MaxPlanets = MaxPlanets($Player[$resource[124]]);
if ($iGalaxyPlace != 0) {
$TheMessage = sprintf($LNG['sys_colo_notfree'], GetTargetAdressLink($this->_fleet, ''));
$this->UpdateFleet('fleet_mess', 1);
} elseif ($iPlanetCount >= $MaxPlanets) {
$TheMessage = sprintf($LNG['sys_colo_maxcolo'], GetTargetAdressLink($this->_fleet, ''), $MaxPlanets);
$this->UpdateFleet('fleet_mess', 1);
} else {
require_once ROOT_PATH . 'includes/functions/CreateOnePlanetRecord.php';
$NewOwnerPlanet = CreateOnePlanetRecord($this->_fleet['fleet_end_galaxy'], $this->_fleet['fleet_end_system'], $this->_fleet['fleet_end_planet'], $this->_fleet['fleet_universe'], $this->_fleet['fleet_owner'], $LNG['fcp_colony'], false, $Player['authlevel']);
if ($NewOwnerPlanet === false) {
$TheMessage = sprintf($LNG['sys_colo_badpos'], GetTargetAdressLink($this->_fleet, ''));
$this->UpdateFleet('fleet_mess', 1);
} else {
$this->_fleet['fleet_end_id'] = $NewOwnerPlanet;
$TheMessage = sprintf($LNG['sys_colo_allisok'], GetTargetAdressLink($this->_fleet, ''));
$this->StoreGoodsToPlanet();
if ($this->_fleet['fleet_amount'] == 1) {
$this->KillFleet();
} else {
$CurrentFleet = explode(";", $this->_fleet['fleet_array']);
$NewFleet = '';
foreach ($CurrentFleet as $Item => $Group) {
if (empty($Group)) {
continue;
}
$Class = explode(",", $Group);
if ($Class[0] == 208 && $Class[1] > 1) {
$NewFleet .= $Class[0] . "," . ($Class[1] - 1) . ";";
} elseif ($Class[0] != 208 && $Class[1] > 0) {
$NewFleet .= $Class[0] . "," . $Class[1] . ";";
}
}
$this->UpdateFleet('fleet_array', $NewFleet);
$this->UpdateFleet('fleet_amount', $this->_fleet['fleet_amount'] - 1);
$this->UpdateFleet('fleet_resource_metal', 0);
$this->UpdateFleet('fleet_resource_crystal', 0);
$this->UpdateFleet('fleet_resource_deuterium', 0);
$this->UpdateFleet('fleet_resource_norio', 0);
$this->UpdateFleet('fleet_mess', 1);
}
}
}
SendSimpleMessage($this->_fleet['fleet_owner'], 0, $this->_fleet['fleet_start_time'], 4, $LNG['sys_colo_mess_from'], $LNG['sys_colo_mess_report'], $TheMessage);
$this->SaveFleet();
}
示例9: MissionCaseStayAlly
function MissionCaseStayAlly($FleetRow)
{
global $lang;
$QryStartPlanet = "SELECT name, id_owner FROM {{table}} ";
$QryStartPlanet .= "WHERE ";
$QryStartPlanet .= "`galaxy` = '" . $FleetRow['fleet_start_galaxy'] . "' AND ";
$QryStartPlanet .= "`system` = '" . $FleetRow['fleet_start_system'] . "' AND ";
$QryStartPlanet .= "`planet` = '" . $FleetRow['fleet_start_planet'] . "';";
$StartPlanet = doquery($QryStartPlanet, 'planets', true);
$StartName = $StartPlanet['name'];
$StartOwner = $StartPlanet['id_owner'];
$QryTargetPlanet = "SELECT name, id_owner FROM {{table}} ";
$QryTargetPlanet .= "WHERE ";
$QryTargetPlanet .= "`galaxy` = '" . $FleetRow['fleet_end_galaxy'] . "' AND ";
$QryTargetPlanet .= "`system` = '" . $FleetRow['fleet_end_system'] . "' AND ";
$QryTargetPlanet .= "`planet` = '" . $FleetRow['fleet_end_planet'] . "';";
$TargetPlanet = doquery($QryTargetPlanet, 'planets', true);
$TargetName = $TargetPlanet['name'];
$TargetOwner = $TargetPlanet['id_owner'];
switch ($FleetRow['fleet_mess']) {
case '0':
if ($FleetRow['fleet_start_time'] <= time()) {
$Message = sprintf($lang['sys_tran_mess_owner'], $TargetName, GetTargetAdressLink($FleetRow, ''), $FleetRow['fleet_resource_metal'], $lang['Metal'], $FleetRow['fleet_resource_crystal'], $lang['Crystal'], $FleetRow['fleet_resource_deuterium'], $lang['Deuterium']);
SendSimpleMessage($StartOwner, '', $FleetRow['fleet_start_time'], 5, $lang['sys_mess_tower'], $lang['sys_mess_transport'], $Message);
$Message = sprintf($lang['sys_tran_mess_user'], $StartName, GetStartAdressLink($FleetRow, ''), $TargetName, GetTargetAdressLink($FleetRow, ''), $FleetRow['fleet_resource_metal'], $lang['Metal'], $FleetRow['fleet_resource_crystal'], $lang['Crystal'], $FleetRow['fleet_resource_deuterium'], $lang['Deuterium']);
SendSimpleMessage($TargetOwner, '', $FleetRow['fleet_start_time'], 5, $lang['sys_mess_tower'], $lang['sys_mess_transport'], $Message);
$QryUpdateFleet = "UPDATE {{table}} SET ";
$QryUpdateFleet .= "`fleet_mess` = 1 ";
$QryUpdateFleet .= "WHERE `fleet_id` = '" . $FleetRow['fleet_id'] . "' ";
$QryUpdateFleet .= "LIMIT 1 ;";
doquery($QryUpdateFleet, 'fleets');
}
break;
case '1':
if ($FleetRow['fleet_end_stay'] <= time()) {
$QryUpdateFleet = "UPDATE {{table}} SET ";
$QryUpdateFleet .= "`fleet_mess` = 2 ";
$QryUpdateFleet .= "WHERE `fleet_id` = '" . $FleetRow['fleet_id'] . "' ";
$QryUpdateFleet .= "LIMIT 1 ;";
doquery($QryUpdateFleet, 'fleets');
}
break;
default:
if ($FleetRow['fleet_end_time'] < time()) {
$Message = sprintf($lang['sys_tran_mess_back'], $StartName, GetStartAdressLink($FleetRow, ''));
SendSimpleMessage($StartOwner, '', $FleetRow['fleet_end_time'], 5, $lang['sys_mess_tower'], $lang['sys_mess_fleetback'], $Message);
RestoreFleetToPlanet($FleetRow, true);
doquery("DELETE FROM {{table}} WHERE fleet_id=" . $FleetRow["fleet_id"], 'fleets');
}
break;
}
}
示例10: TargetEvent
function TargetEvent()
{
global $db, $resource;
$iPlanetCount = $db->uniquequery("SELECT count(*) as kolo FROM " . PLANETS . " WHERE `id_owner` = '" . $this->_fleet['fleet_owner'] . "' AND `planet_type` = '1' AND `destruyed` = '0';");
$iGalaxyPlace = $db->uniquequery("SELECT count(*) AS plani FROM " . PLANETS . " WHERE `galaxy` = '" . $this->_fleet['fleet_end_galaxy'] . "' AND `system` = '" . $this->_fleet['fleet_end_system'] . "' AND `planet` = '" . $this->_fleet['fleet_end_planet'] . "';");
$PlayerTech = $db->uniquequery("SELECT `authlevel`, `" . $resource[124] . "` FROM " . USERS . " WHERE `id` = '" . $this->_fleet['fleet_owner'] . "';");
$LNG = $this->GetUserLang($this->_fleet['fleet_owner']);
if ($iGalaxyPlace['plani'] != 0) {
$TheMessage = sprintf($LNG['sys_colo_notfree'], GetTargetAdressLink($this->_fleet, ''));
$this->UpdateFleet('fleet_mess', 1);
} elseif ($iPlanetCount['kolo'] >= STANDART_PLAYER_PLANETS + ceil($PlayerTech[$resource[124]] / 2) * PLANETS_PER_TECH) {
$TheMessage = sprintf($LNG['sys_colo_maxcolo'], GetTargetAdressLink($this->_fleet, ''), STANDART_PLAYER_PLANETS + ceil($PlayerTech[$resource[124]] / 2));
$this->UpdateFleet('fleet_mess', 1);
} else {
require_once ROOT_PATH . 'includes/functions/CreateOnePlanetRecord.' . PHP_EXT;
$NewOwnerPlanet = CreateOnePlanetRecord($this->_fleet['fleet_end_galaxy'], $this->_fleet['fleet_end_system'], $this->_fleet['fleet_end_planet'], $this->_fleet['fleet_owner'], $LNG['fcp_colony'], false, $PlayerTech['authlevel']);
if ($NewOwnerPlanet !== true) {
$TheMessage = sprintf($LNG['sys_colo_badpos'], GetTargetAdressLink($this->_fleet, ''));
$this->UpdateFleet('fleet_mess', 1);
} else {
$TheMessage = sprintf($LNG['sys_colo_allisok'], GetTargetAdressLink($this->_fleet, ''));
$this->StoreGoodsToPlanet();
if ($this->_fleet['fleet_amount'] == 1) {
$db->query("DELETE FROM " . FLEETS . " WHERE fleet_id=" . $this->_fleet["fleet_id"] . ";");
} else {
$CurrentFleet = explode(";", $this->_fleet['fleet_array']);
$NewFleet = '';
foreach ($CurrentFleet as $Item => $Group) {
if (empty($Group)) {
continue;
}
$Class = explode(",", $Group);
if ($Class[0] == 208 && $Class[1] > 1) {
$NewFleet .= $Class[0] . "," . ($Class[1] - 1) . ";";
} elseif ($Class[0] != 208 && $Class[1] > 0) {
$NewFleet .= $Class[0] . "," . $Class[1] . ";";
}
}
$this->UpdateFleet('fleet_array', $NewFleet);
$this->UpdateFleet('fleet_amount', $this->_fleet['fleet_amount'] - 1);
$this->UpdateFleet('fleet_resource_metal', 0);
$this->UpdateFleet('fleet_resource_crystal', 0);
$this->UpdateFleet('fleet_resource_deuterium', 0);
$this->UpdateFleet('fleet_mess', 1);
}
}
}
SendSimpleMessage($this->_fleet['fleet_owner'], 0, $this->_fleet['fleet_start_time'], 4, $LNG['sys_colo_mess_from'], $LNG['sys_colo_mess_report'], $TheMessage);
$this->SaveFleet();
}
示例11: TargetEvent
function TargetEvent()
{
$sql = 'SELECT * FROM %%USERS%% WHERE id = :userId;';
$senderUser = Database::get()->selectSingle($sql, array(':userId' => $this->_fleet['fleet_owner']));
$senderUser['factor'] = getFactors($senderUser, 'basic', $this->_fleet['fleet_start_time']);
$fleetArray = FleetFunctions::unserialize($this->_fleet['fleet_array']);
$duration = $this->_fleet['fleet_start_time'] - $this->_fleet['start_time'];
$SpeedFactor = FleetFunctions::GetGameSpeedFactor();
$distance = FleetFunctions::GetTargetDistance(array($this->_fleet['fleet_start_galaxy'], $this->_fleet['fleet_start_system'], $this->_fleet['fleet_start_planet']), array($this->_fleet['fleet_end_galaxy'], $this->_fleet['fleet_end_system'], $this->_fleet['fleet_end_planet']));
$consumption = FleetFunctions::GetFleetConsumption($fleetArray, $duration, $distance, $senderUser, $SpeedFactor);
$this->UpdateFleet('fleet_resource_deuterium', $this->_fleet['fleet_resource_deuterium'] + $consumption / 2);
$LNG = $this->getLanguage($senderUser['lang']);
$TargetUserID = $this->_fleet['fleet_target_owner'];
$TargetMessage = sprintf($LNG['sys_stat_mess'], GetTargetAdressLink($this->_fleet, ''), pretty_number($this->_fleet['fleet_resource_metal']), $LNG['tech'][901], pretty_number($this->_fleet['fleet_resource_crystal']), $LNG['tech'][902], pretty_number($this->_fleet['fleet_resource_deuterium']), $LNG['tech'][903]);
PlayerUtil::sendMessage($TargetUserID, 0, $LNG['sys_mess_tower'], 5, $LNG['sys_stat_mess_stay'], $TargetMessage, $this->_fleet['fleet_start_time'], NULL, 1, $this->_fleet['fleet_universe']);
$this->RestoreFleet(false);
}
示例12: TargetEvent
function TargetEvent()
{
$sql = 'SELECT name FROM %%PLANETS%% WHERE `id` = :planetId;';
$startPlanetName = Database::get()->selectSingle($sql, array(':planetId' => $this->_fleet['fleet_start_id']), 'name');
$targetPlanetName = Database::get()->selectSingle($sql, array(':planetId' => $this->_fleet['fleet_end_id']), 'name');
$LNG = $this->getLanguage(NULL, $this->_fleet['fleet_owner']);
$Message = sprintf($LNG['sys_tran_mess_owner'], $targetPlanetName, GetTargetAdressLink($this->_fleet, ''), pretty_number($this->_fleet['fleet_resource_metal']), $LNG['tech'][901], pretty_number($this->_fleet['fleet_resource_crystal']), $LNG['tech'][902], pretty_number($this->_fleet['fleet_resource_deuterium']), $LNG['tech'][903]);
PlayerUtil::sendMessage($this->_fleet['fleet_owner'], 0, $LNG['sys_mess_tower'], 5, $LNG['sys_mess_transport'], $Message, $this->_fleet['fleet_start_time'], NULL, 1, $this->_fleet['fleet_universe']);
if ($this->_fleet['fleet_target_owner'] != $this->_fleet['fleet_owner']) {
$LNG = $this->getLanguage(NULL, $this->_fleet['fleet_target_owner']);
$Message = sprintf($LNG['sys_tran_mess_user'], $startPlanetName, GetStartAdressLink($this->_fleet, ''), $targetPlanetName, GetTargetAdressLink($this->_fleet, ''), pretty_number($this->_fleet['fleet_resource_metal']), $LNG['tech'][901], pretty_number($this->_fleet['fleet_resource_crystal']), $LNG['tech'][902], pretty_number($this->_fleet['fleet_resource_deuterium']), $LNG['tech'][903]);
PlayerUtil::sendMessage($this->_fleet['fleet_target_owner'], 0, $LNG['sys_mess_tower'], 5, $LNG['sys_mess_transport'], $Message, $this->_fleet['fleet_start_time'], NULL, 1, $this->_fleet['fleet_universe']);
}
$this->StoreGoodsToPlanet();
$this->setState(FLEET_RETURN);
$this->SaveFleet();
}
示例13: TargetEvent
function TargetEvent()
{
global $db, $LANG;
$StartPlanet = $db->uniquequery("SELECT name FROM " . PLANETS . " WHERE `id` = '" . $this->_fleet['fleet_start_id'] . "';");
$StartName = $StartPlanet['name'];
$StartOwner = $this->_fleet['fleet_owner'];
$TargetPlanet = $db->uniquequery("SELECT name FROM " . PLANETS . " WHERE `id` = '" . $this->_fleet['fleet_end_id'] . "';");
$TargetName = $TargetPlanet['name'];
$TargetOwner = $this->_fleet['fleet_target_owner'];
$LNG = $LANG->GetUserLang($this->_fleet['fleet_owner']);
$Message = sprintf($LNG['sys_tran_mess_owner'], $TargetName, GetTargetAdressLink($this->_fleet, ''), $this->_fleet['fleet_resource_metal'], $LNG['Metal'], $this->_fleet['fleet_resource_crystal'], $LNG['Crystal'], $this->_fleet['fleet_resource_deuterium'], $LNG['Deuterium']);
SendSimpleMessage($StartOwner, '', $this->_fleet['fleet_start_time'], 5, $LNG['sys_mess_tower'], $LNG['sys_mess_transport'], $Message);
$Message = sprintf($LNG['sys_tran_mess_user'], $StartName, GetStartAdressLink($this->_fleet, ''), $TargetName, GetTargetAdressLink($this->_fleet, ''), $this->_fleet['fleet_resource_metal'], $LNG['Metal'], $this->_fleet['fleet_resource_crystal'], $LNG['Crystal'], $this->_fleet['fleet_resource_deuterium'], $LNG['Deuterium']);
SendSimpleMessage($TargetOwner, '', $this->_fleet['fleet_start_time'], 5, $LNG['sys_mess_tower'], $LNG['sys_mess_transport'], $Message);
$this->UpdateFleet('fleet_mess', 2);
$this->SaveFleet();
}
示例14: TargetEvent
function TargetEvent()
{
$senderUser = $GLOBALS['DATABASE']->getFirstRow("SELECT * FROM " . USERS . " WHERE id = " . $this->_fleet['fleet_owner'] . ";");
$senderUser['factor'] = getFactors($senderUser, 'basic', $this->_fleet['fleet_start_time']);
$fleetArray = fleetAmountToArray($this->_fleet['fleet_array']);
$duration = $this->_fleet['fleet_start_time'] - $this->_fleet['start_time'];
require_once 'includes/classes/class.FleetFunctions.php';
$fleetMaxSpeed = FleetFunctions::GetFleetMaxSpeed($fleetArray, $senderUser);
$SpeedFactor = FleetFunctions::GetGameSpeedFactor();
$distance = FleetFunctions::GetTargetDistance(array($this->_fleet['fleet_start_galaxy'], $this->_fleet['fleet_start_system'], $this->_fleet['fleet_start_planet']), array($this->_fleet['fleet_end_galaxy'], $this->_fleet['fleet_end_system'], $this->_fleet['fleet_end_planet']));
$consumption = FleetFunctions::GetFleetConsumption($fleetArray, $duration, $distance, $fleetMaxSpeed, $senderUser, $SpeedFactor);
$this->UpdateFleet('fleet_resource_deuterium', $this->_fleet['fleet_resource_deuterium'] + $consumption / 2);
$LNG = $this->getLanguage($senderUser['lang']);
$TargetUserID = $this->_fleet['fleet_target_owner'];
$TargetMessage = sprintf($LNG['sys_stat_mess'], GetTargetAdressLink($this->_fleet, ''), pretty_number($this->_fleet['fleet_resource_metal']), $LNG['tech'][901], pretty_number($this->_fleet['fleet_resource_crystal']), $LNG['tech'][902], pretty_number($this->_fleet['fleet_resource_deuterium']), $LNG['tech'][903]);
SendSimpleMessage($TargetUserID, 0, $this->_fleet['fleet_start_time'], 5, $LNG['sys_mess_tower'], $LNG['sys_stat_mess_stay'], $TargetMessage);
$this->RestoreFleet(false);
}
示例15: TargetEvent
function TargetEvent()
{
global $db;
$Qry = "SELECT name FROM " . PLANETS . " \r\n\t\t\t\t WHERE \r\n\t\t\t\t `galaxy` = '" . $this->_fleet['fleet_start_galaxy'] . "' AND\r\n\t\t\t\t `system` = '" . $this->_fleet['fleet_start_system'] . "' AND\r\n\t\t\t\t `planet` = '" . $this->_fleet['fleet_start_planet'] . "';";
$StartPlanet = $db->uniquequery($Qry);
$StartName = $StartPlanet['name'];
$StartOwner = $this->_fleet['fleet_owner'];
$Qry = "SELECT name FROM " . PLANETS . "\r\n\t\t\t\t WHERE\r\n\t\t\t \t `galaxy` = '" . $this->_fleet['fleet_end_galaxy'] . "' AND\r\n\t\t\t\t `system` = '" . $this->_fleet['fleet_end_system'] . "' AND\r\n\t\t\t\t `planet` = '" . $this->_fleet['fleet_end_planet'] . "';";
$TargetPlanet = $db->uniquequery($Qry);
$TargetName = $TargetPlanet['name'];
$TargetOwner = $this->_fleet['fleet_target_owner'];
$LNG = $this->GetUserLang($this->_fleet['fleet_owner']);
$Message = sprintf($LNG['sys_tran_mess_owner'], $TargetName, GetTargetAdressLink($this->_fleet, ''), $this->_fleet['fleet_resource_metal'], $LNG['Metal'], $this->_fleet['fleet_resource_crystal'], $LNG['Crystal'], $this->_fleet['fleet_resource_deuterium'], $LNG['Deuterium']);
SendSimpleMessage($StartOwner, '', $this->_fleet['fleet_start_time'], 5, $LNG['sys_mess_tower'], $LNG['sys_mess_transport'], $Message);
$Message = sprintf($LNG['sys_tran_mess_user'], $StartName, GetStartAdressLink($this->_fleet, ''), $TargetName, GetTargetAdressLink($this->_fleet, ''), $this->_fleet['fleet_resource_metal'], $LNG['Metal'], $this->_fleet['fleet_resource_crystal'], $LNG['Crystal'], $this->_fleet['fleet_resource_deuterium'], $LNG['Deuterium']);
SendSimpleMessage($TargetOwner, '', $this->_fleet['fleet_start_time'], 5, $LNG['sys_mess_tower'], $LNG['sys_mess_transport'], $Message);
$this->UpdateFleet('fleet_mess', 2);
$this->SaveFleet();
}