本文整理汇总了PHP中GetPlanet函数的典型用法代码示例。如果您正苦于以下问题:PHP GetPlanet函数的具体用法?PHP GetPlanet怎么用?PHP GetPlanet使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了GetPlanet函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: PlanetDestroyMenu
function PlanetDestroyMenu()
{
global $GlobalUser;
$aktplanet = GetPlanet($GlobalUser['aktplanet']);
PageHeader("renameplanet");
echo "<!-- CONTENT AREA -->\n";
echo "<div id='content'>\n";
echo "<center>\n\n";
echo "<h1>Переименовать/покинуть планету</h1>\n";
echo "<form action=\"index.php?page=renameplanet&session=" . $_GET['session'] . "&pl=" . $aktplanet['planet_id'] . "\" method=\"POST\">\n";
echo "<input type='hidden' name='page' value='renameplanet'>\n";
echo "<center>\n\n";
echo "<table width=\"519\">\n";
echo "<tr><td class=\"c\" colspan=\"3\">Вопросы на всякий случай</td></tr>\n";
echo "<tr><th colspan=\"3\">Уничтожение планеты [" . $aktplanet['g'] . ":" . $aktplanet['s'] . ":" . $aktplanet['p'] . "] подтвердить паролем</th></tr>\n";
echo "<tr><input type=\"hidden\" name=\"deleteid\" value =\"" . $aktplanet['planet_id'] . "\">\n";
echo "<th>Пароль</th><th><input type=\"password\" name=\"pw\"></th>\n";
echo "<th><input type=\"submit\" name=\"aktion\" value=\"Удалить планету!\" alt=\"Покинуть колонию\"></th></tr>\n";
echo "</table>\n</form>\n</center>\n\n";
echo "<br><br><br><br>\n";
echo "</center>\n";
echo "</div>\n";
echo "<!-- END CONTENT AREA -->\n";
PageFooter();
ob_end_flush();
exit;
}
示例2: planet_link
echo $pl['planet_id'];
?>
"
class="tipsStandard"
title="|Перейти к Планета ">
<img alt="" src="<?php
echo planet_link($pl);
?>
">
</a>
</div>
<?php
} else {
$moon_id = PlanetHasMoon($aktplanet['planet_id']);
if ($moon_id) {
$moon = GetPlanet($moon_id);
?>
<div id="moon">
<a href="index.php?page=overview&session=<?php
echo $session;
?>
&cp=<?php
echo $moon['planet_id'];
?>
"
class="tipsStandard"
title="|Перейти к Луна ">
<img alt="" src="red_images/17e17069847b09b3d1ef6d03729107.gif">
</a>
</div>
<?php
示例3: foreach
foreach ($unions as $i => $union) {
$fleet_obj = LoadFleet($union['fleet_id']);
if ($fleet_obj['union_id'] == $union['union_id']) {
$union_count++;
}
}
if ($union_count > 0) {
echo "<input type=\"hidden\" name=\"union2\" value=\"0\" >";
$now = time();
foreach ($unions as $i => $union) {
$fleet_obj = LoadFleet($union['fleet_id']);
if ($fleet_obj['union_id'] != $union['union_id']) {
continue;
}
$queue = GetFleetQueue($union['fleet_id']);
$target = GetPlanet($fleet_obj['target_planet']);
echo " <tr height=\"20\">";
echo "<th><div id='bxx" . ($i + 1) . "' title='" . max($queue['end'] - $now, 0) . "'star='" . $queue['end'] . "'></div></th>";
echo "<th><a href=\"javascript:setTarget(" . $target['g'] . "," . $target['s'] . "," . $target['p'] . "," . GetPlanetType($target) . "); setUnion(" . $union['union_id'] . "); shortInfo()\">";
echo $union['name'] . " [" . $target['g'] . ":" . $target['s'] . ":" . $target['p'] . "]</a></th></tr>\n";
}
echo "<script language=javascript>anz=" . $union_count . ";t();</script>\n\n";
} else {
echo " <tr height=\"20\"><th colspan=\"2\">-</th></tr>\n";
}
?>
<tr height="20">
<th colspan="2">
<input type="submit" value="Дальше" />
</th>
示例4: Admin_Bots
function Admin_Bots()
{
global $session;
global $db_prefix;
global $GlobalUser;
$result = "";
// Обработка POST-запроса.
if (method() === "POST") {
if (AddBot($_POST['name'])) {
$result = "<font color=lime>Бот успешно добавлен.</font>";
} else {
$result = "<font color=red>Игрок с таким именем уже существует.</font>";
}
}
// Обработка GET-запроса.
if (method() === "GET") {
StopBot(intval($_GET['id']));
$result = "<font color=lime>Бот остановлен.</font>";
}
?>
<?php
echo AdminPanel();
?>
<center><?php
echo $result;
?>
</center>
<h2>Список ботов:</h2>
<?php
$query = "SELECT * FROM " . $db_prefix . "queue WHERE type = 'AI' GROUP BY owner_id";
$result = dbquery($query);
$rowss = $rows = dbrows($result);
if ($rows == 0) {
echo "Ботов не обнаружено<br>";
} else {
echo "<table>\n";
echo "<tr><td class=c>ID</td><td class=c>Имя</td><td class=c>Главная планета</td><td class=c>Действие</td></tr>\n";
}
while ($rows--) {
$queue = dbarray($result);
$user = LoadUser($queue['owner_id']);
$planet = GetPlanet($user['hplanetid']);
echo "<tr>";
echo "<td>" . $user['player_id'] . "</td>";
echo "<td>" . AdminUserName($user) . "</td>";
echo "<td>" . AdminPlanetName($planet) . " " . AdminPlanetCoord($planet) . "</td>";
echo "<td><a href=\"index.php?page=admin&session={$session}&mode=Bots&action=stop&id=" . $user['player_id'] . "\">Остановить</a></td>";
echo "</tr>\n";
}
if ($rowss) {
echo "</table>";
}
?>
<h2>Добавить бота:</h2>
<form action="index.php?page=admin&session=<?php
echo $session;
?>
&mode=Bots" method="POST">
<table>
<tr><td>Имя <input type=text size=10 name="name" /> <input type=submit value="Отправить" /></td></tr>
</table>
</form>
<?php
}
示例5: Admin_Users
//.........这里部分代码省略.........
</th></tr>
<tr><th>Последний вход</th><th><?php
echo date("Y-m-d H:i:s", $user['lastlogin']);
?>
</th></tr>
<tr><th>Активность</th><th>
<?php
$now = time();
echo date("Y-m-d H:i:s", $user['lastclick']);
if ($now - $user['lastclick'] < 60 * 60) {
echo " (" . floor(($now - $user['lastclick']) / 60) . " min)";
}
?>
</th></tr>
<tr><th>IP адрес</th><th><a href="http://nic.ru/whois/?query=<?php
echo $user['ip_addr'];
?>
" target=_blank><?php
echo $user['ip_addr'];
?>
</a></th></tr>
<tr><th>Активирован</th><th><input type="checkbox" name="validated" <?php
echo IsChecked($user, "validated");
?>
/> <a href="index.php?page=admin&session=<?php
echo $session;
?>
&mode=Users&action=reactivate&player_id=<?php
echo $user['player_id'];
?>
">выслать пароль</a></th></tr>
<tr><th>Главная планета</th><th>
<?php
$planet = GetPlanet($user['hplanetid']);
echo "[" . $planet['g'] . ":" . $planet['s'] . ":" . $planet['p'] . "] <a href=\"index.php?page=admin&session={$session}&mode=Planets&cp=" . $planet['planet_id'] . "\">" . $planet['name'] . "</a>";
?>
</th></tr>
<tr><th>Текущая планета</th><th>
<?php
$planet = GetPlanet($user['aktplanet']);
echo "[" . $planet['g'] . ":" . $planet['s'] . ":" . $planet['p'] . "] <a href=\"index.php?page=admin&session={$session}&mode=Planets&cp=" . $planet['planet_id'] . "\">" . $planet['name'] . "</a>";
?>
</th></tr>
<tr><th>Права</th><th>
<select name="admin">
<option value="0" <?php
echo IsSelected($user, "admin", 0);
?>
>Пользователь</option>
<option value="1" <?php
echo IsSelected($user, "admin", 1);
?>
>Оператор</option>
<option value="2" <?php
echo IsSelected($user, "admin", 2);
?>
>Администратор</option>
</select>
</th></tr>
<tr><th>Включить слежение</th><th><input type="checkbox" name="sniff" <?php
echo IsChecked($user, "sniff");
?>
/></th></tr>
<tr><th>Отладочная информация</th><th><input type="checkbox" name="debug" <?php
echo IsChecked($user, "debug");
?>
示例6: GetPlanet
?>
:<?php
echo $aktplanet['p'];
?>
]</a> (<?php
echo $GlobalUser['oname'];
?>
) </td>
</tr>
<tr>
<td colspan="4" class="c">Передвижения флота</td>
</tr>
<?php
$target = GetPlanet(intval($_GET['spid']));
$outofrange = false;
// Проверить радиус фаланги
if ($aktplanet['g'] != $target['g'] || $aktplanet["b42"] <= 0) {
$outofrange = true;
} else {
$range = $aktplanet["b42"] * $aktplanet["b42"] - 1;
if (abs($aktplanet['s'] - $target['s']) > $range) {
$outofrange = true;
}
}
/*
if ( $GlobalUser['vacation'] ) // Игрок в режиме отпуска.
{
echo "<font color=#FF0000><center>Режим отпуска минимум до ".date ("Y-m-d H:i:s", $GlobalUser['vacation_until'])."</center></font>";
}
示例7: Admin_Broadcast
function Admin_Broadcast()
{
global $session;
global $db_prefix;
global $GlobalUser;
$write_error = "";
// Обработка POST-запроса.
if (method() === "POST") {
$cat = $_POST['cat'];
$subj = $_POST['subj'];
if ($subj === "") {
$write_error = "<center><font color=#FF0000>Заполните тему</font><br/></center>\n";
}
$text = $_POST['text'];
if ($text === "") {
$write_error = "<center><font color=#FF0000>Введите текст сообщения</font><br/></center>\n";
}
if ($write_error === "") {
if ($cat == 1) {
$query = "SELECT * FROM " . $db_prefix . "users WHERE score1 < 5000;";
} else {
if ($cat == 2) {
$query = "SELECT * FROM " . $db_prefix . "users WHERE place1 < 100;";
} else {
if ($cat == 3) {
$query = "SELECT * FROM " . $db_prefix . "users WHERE admin = 1;";
} else {
$query = "SELECT * FROM " . $db_prefix . "users;";
}
}
}
// Всем
$ownhome = GetPlanet($GlobalUser['hplanetid']);
$from = $GlobalUser['oname'] . " <a href=\"index.php?page=galaxy&galaxy=" . $ownhome['g'] . "&system=" . $ownhome['s'] . "&position=" . $ownhome['p'] . "&session={PUBLIC_SESSION}\">[" . $ownhome['g'] . ":" . $ownhome['s'] . ":" . $ownhome['p'] . "]</a>\n";
$subj = $subj . " <a href=\"index.php?page=writemessages&session={PUBLIC_SESSION}&messageziel=" . $GlobalUser['player_id'] . "&re=1&betreff=Re:" . $subj . "\">\n" . "</a>\n";
$text = str_replace('\\"', """, bb($text));
$text = str_replace('\'', "’", $text);
$text = str_replace('\\`', "‘", $text);
$result = dbquery($query);
$usernum = $rows = dbrows($result);
while ($rows--) {
$user = dbarray($result);
SendMessage($user['player_id'], $from, $subj, $text, 5);
}
if ($usernum > 0) {
$write_error = "<center><font color=#00FF00>Сообщение отправлено {$usernum} пользователям.</font><br/></center>\n";
} else {
$write_error = "<center><font color=#00FF00>Адресаты не найдены.</font><br/></center>\n";
}
}
}
?>
<?php
echo AdminPanel();
?>
<?php
echo $write_error;
?>
<table>
<form action="index.php?page=admin&session=<?php
echo $session;
?>
&mode=Broadcast" method="POST">
<tr><td>
Кому: <select name="cat">
<option value="0">Всем</option>
<option value="1">Новичкам (менее 5.000 очков)</option>
<option value="2">Игрокам из топ100</option>
<option value="3">Операторам</option>
</select>
</td></tr>
<tr><td>
Тема : <input name="subj" size=80>
</td></tr>
<tr><td>
<textarea cols='100' rows='20' name='text'></textarea>
</td></tr>
<tr><td>
<center><input type="submit" value="Отправить"></center>
</td></tr>
</form>
</table>
<?php
}
示例8: RecalcFields
function RecalcFields($planet_id)
{
global $db_prefix;
$buildmap = array(1, 2, 3, 4, 12, 14, 15, 21, 22, 23, 24, 31, 33, 34, 41, 42, 43, 44);
$planet = GetPlanet($planet_id);
$fields = 0;
if ($planet['type'] == 0 || $planet['type'] == 10003) {
$maxfields = 1;
} else {
$maxfields = floor(pow($planet['diameter'] / 1000, 2));
}
// планета
foreach ($buildmap as $i => $gid) {
$fields += $planet["b{$gid}"];
}
$maxfields += 5 * $planet["b33"] + 3 * $planet["b41"];
// терраформер и ЛБ
$query = "UPDATE " . $db_prefix . "planets SET fields={$fields}, maxfields={$maxfields} WHERE planet_id={$planet_id};";
dbquery($query);
}
示例9: loca
if ($num) {
if ($num > 1) {
$msgs = loca("OVERVIEW_MSGS");
} else {
$msgs = "";
}
echo "<tr><th colspan=\"4\"><a href=\"index.php?page=messages&dsp=1&session={$session}\"> " . va(loca("OVERVIEW_NEWMSG"), $num, $msgs) . " </th></tr>\n";
}
// Время сервера и список событий.
echo "<tr><th> " . loca("OVERVIEW_TIME") . " </th> <th colspan=3>" . date("D M j G:i:s", $now) . "</th></tr>\n";
echo "<tr><td colspan='4' class='c'> " . loca("OVERVIEW_EVENTS") . " </td> </tr>\n\n";
EventList();
// Показать, если у планеты есть луна.
$moonid = PlanetHasMoon($aktplanet['planet_id']);
if ($moonid) {
$moonobj = GetPlanet($moonid);
echo "<th> " . $moonobj['name'] . " <br>\n";
echo "<a href=\"index.php?page=overview&session={$session}&cp=" . $moonid . "\"><img src=\"" . GetPlanetSmallImage(UserSkin(), $moonobj) . "\" width=\"50\" alt=\"" . loca("MOON") . "\" height=\"50\" ></a>\n";
echo "</th>\n";
} else {
echo "<th>\n</th>\n";
}
// Показать картинку планеты.
echo "<th colspan=\"2\">\n<img src=\"" . GetPlanetImage(UserSkin(), $aktplanet) . "\" width=\"200\" height=\"200\">\n";
$result = GetBuildQueue($aktplanet['planet_id']);
$cnt = dbrows($result);
if ($cnt > 0) {
$queue = dbarray($result);
$left = $queue['end'] - time();
echo "<br><center>" . loca("NAME_" . $queue['tech_id']) . " ";
if ($queue['destroy']) {
示例10: overlib
}
echo " <tr> \n";
echo " <!-- rank --> \n";
echo " <th> \n";
echo " {$place} \n\n";
if ($diff < 0) {
echo " <a href='#' onmouseover='return overlib(\"<font color=lime>+" . abs($diff) . "</font><br/><font color=white>С " . date("Y-m-d H:i:s", $user['scoredate']) . "\");' onmouseout='return nd();'><font color='lime'>+</font></a> \n";
} else {
if ($diff > 0) {
echo " <a href='#' onmouseover='return overlib(\"<font color=red>-" . abs($diff) . "</font><br/><font color=white>С " . date("Y-m-d H:i:s", $user['scoredate']) . "\");' onmouseout='return nd();'><font color='red'>-</font></a> \n";
} else {
echo " <a href='#' onmouseover='return overlib(\"<font color=87CEEB>*</font><br/><font color=white>С " . date("Y-m-d H:i:s", $user['scoredate']) . "\");' onmouseout='return nd();'><font color='87CEEB'>*</font></a> \n";
}
}
echo " </th> \n\n";
$home = GetPlanet($user['hplanetid']);
echo " <!-- nick --> \n";
echo " <th> \n";
if ($user['player_id'] == $GlobalUser['player_id']) {
echo "<a href=\"#\" style='color:lime;'>\n";
echo $user['oname'] . "</a>\n";
} else {
echo " <a href=\"index.php?page=galaxy&no_header=1&session={$session}&p1=" . $home['g'] . "&p2=" . $home['s'] . "&p3=" . $home['p'] . "\" style='color:FFFFFF' > \n\n";
echo $user['oname'] . "</a> \n";
}
echo " </th> \n\n";
echo " <!-- message-icon --> \n";
echo " <th> \n";
if ($user['player_id'] != $GlobalUser['player_id']) {
echo " <a href=\"index.php?page=writemessages&session={$session}&messageziel=" . $user['player_id'] . "\"> \n";
echo " <img src=\"" . UserSkin() . "img/m.gif\" border=\"0\" alt=\"Написать сообщение\" /> \n";
示例11: FleetSpan
function FleetSpan($fleet_entry)
{
$mission = $fleet_entry['mission'];
$assign = $fleet_entry['assign'];
$dir = $fleet_entry['dir'];
$dir = $dir | $assign << 4;
$origin = GetPlanet($fleet_entry['origin_id']);
$target = GetPlanet($fleet_entry['target_id']);
$fleet = $fleet_entry;
$owner = LoadUser($origin['owner_id']);
$m = $fleet_entry['m'];
$k = $fleet_entry['k'];
$d = $fleet_entry['d'];
if (0) {
} else {
if ($mission == 1) {
if ($dir == 0) {
echo "<span class='flight ownattack'>Ваш " . OverFleet($fleet, 0, "ownattack") . "флот</a><a href='#' title='" . TitleFleet($fleet, 0) . "'></a> с " . PlanetFrom($origin, "ownattack") . " отправлен на " . PlanetTo($target, "ownattack") . ". Задание: " . Cargo($m, $k, $d, "ownattack", "Атаковать") . "</span>";
} else {
if ($dir == 1) {
echo "<span class='return ownattack'>Ваш " . OverFleet($fleet, 0, "ownattack") . "флот</a><a href='#' title='" . TitleFleet($fleet, 0) . "'></a>, отправленный с " . PlanetFrom($origin, "ownattack") . ", возвращается на " . PlanetTo($target, "ownattack") . ". Задание: " . Cargo($m, $k, $d, "ownattack", "Атаковать") . "</span>";
} else {
if ($dir == 0x10) {
echo "<span class='attack'>Боевой " . OverFleet($fleet, 1, "attack") . "флот</a><a href='#' title='" . TitleFleet($fleet, 1) . "'></a> игрока " . PlayerDetails($owner) . " с " . PlanetFrom($origin, "attack") . " отправлен на " . PlanetTo($target, "attack") . ". Задание: Атаковать</span>";
}
}
}
} else {
if ($mission == 2) {
if ($dir == 0) {
echo "<span class='federation'>Ваш " . OverFleet($fleet, 0, "ownfederation") . "флот</a><a href='#' title='" . TitleFleet($fleet, 0) . "'></a> с " . PlanetFrom($origin, "ownfederation") . " отправлен на " . PlanetTo($target, "ownfederation") . ". Задание: " . Cargo($m, $k, $d, "ownfederation", "Совместная атака") . "</span>";
} else {
if ($dir == 1) {
echo "<span class='return ownfederation'>Ваш " . OverFleet($fleet, 0, "ownfederation") . "флот</a><a href='#' title='" . TitleFleet($fleet, 0) . "'></a>, отправленный с " . PlanetFrom($origin, "ownfederation") . ", возвращается на " . PlanetTo($target, "ownfederation") . ". Задание: " . Cargo($m, $k, $d, "ownfederation", "Совместная атака") . "</span>";
} else {
if ($dir == 0x10) {
echo "<span class='attack'>Мирный " . OverFleet($fleet, 1, "attack") . "флот</a><a href='#' title='" . TitleFleet($fleet, 1) . "'></a> игрока " . PlayerDetails($owner) . " с " . PlanetFrom($origin, "attack") . " отправлен на " . PlanetTo($target, "attack") . ". Задание: Совместная атака</span>";
}
}
}
} else {
if ($mission == 3) {
if ($dir == 0) {
echo "<span class='flight owntransport'>Ваш " . OverFleet($fleet, 0, "owntransport") . "флот</a><a href='#' title='" . TitleFleet($fleet, 0) . "'></a> с " . PlanetFrom($origin, "owntransport") . " отправлен на " . PlanetTo($target, "owntransport") . ". Задание: " . Cargo($m, $k, $d, "owntransport", "Транспорт") . "</span>";
} else {
if ($dir == 1) {
echo "<span class='return owntransport'>Ваш " . OverFleet($fleet, 0, "owntransport") . "флот</a><a href='#' title='" . TitleFleet($fleet, 0) . "'></a>, отправленный с " . PlanetFrom($origin, "owntransport") . ", возвращается на " . PlanetTo($target, "owntransport") . ". Задание: " . Cargo($m, $k, $d, "owntransport", "Транспорт") . "</span>";
} else {
if ($dir == 0x10) {
echo "<span class='flight transport'>Мирный " . OverFleet($fleet, 1, "transport") . "флот</a><a href='#' title='" . TitleFleet($fleet, 1) . "'></a> игрока " . PlayerDetails($owner) . " с " . PlanetFrom($origin, "transport") . " отправлен на " . PlanetTo($target, "transport") . ". Задание: Транспорт</span>";
}
}
}
} else {
if ($mission == 4) {
if ($dir == 0) {
echo "<span class='flight owndeploy'>Ваш " . OverFleet($fleet, 0, "owndeploy") . "флот</a><a href='#' title='" . TitleFleet($fleet, 0) . "'></a> с " . PlanetFrom($origin, "owndeploy") . " отправлен на " . PlanetTo($target, "owndeploy") . ". Задание: " . Cargo($m, $k, $d, "owndeploy", "Оставить") . "</span>";
} else {
if ($dir == 1) {
echo "<span class='return owndeploy'>Ваш " . OverFleet($fleet, 0, "owndeploy") . "флот</a><a href='#' title='" . TitleFleet($fleet, 0) . "'></a> с " . PlanetFrom($origin, "owndeploy") . " отправлен на " . PlanetTo($target, "owndeploy") . ". Задание: " . Cargo($m, $k, $d, "owndeploy", "Оставить") . "</span>";
}
}
} else {
if ($mission == 5) {
if ($dir == 0) {
echo "<span class='flight ownhold'>Ваш " . OverFleet($fleet, 0, "ownhold") . "флот</a><a href='#' title='" . TitleFleet($fleet, 0) . "'></a> с " . PlanetFrom($origin, "ownhold") . " отправлен на " . PlanetTo($target, "ownhold") . ". Задание: " . Cargo($m, $k, $d, "ownhold", "Держаться") . "</span>";
} else {
if ($dir == 1) {
echo "<span class='return ownhold'>Ваш " . OverFleet($fleet, 0, "ownhold") . "флот</a><a href='#' title='" . TitleFleet($fleet, 0) . "'></a>, отправленный с " . PlanetFrom($origin, "ownhold") . ", возвращается на " . PlanetTo($target, "ownhold") . ". Задание: " . Cargo($m, $k, $d, "ownhold", "Держаться") . "</span>";
} else {
if ($dir == 2) {
echo "<span class='holding ownhold'>Ваш " . OverFleet($fleet, 0, "ownhold") . "флот</a><a href='#' title='" . TitleFleet($fleet, 0) . "'></a>, отправленный с " . PlanetFrom($origin, "ownhold") . ", находится на орбите " . PlanetFrom($target, "ownhold") . ". Задание: " . Cargo($m, $k, $d, "ownhold", "Держаться") . "</span>";
} else {
if ($dir == 0x20) {
echo "<span class='flight hold'>Мирный " . OverFleet($fleet, 1, "hold") . "флот</a><a href='#' title='" . TitleFleet($fleet, 1) . "'></a> игрока " . PlayerDetails($owner) . " с " . PlanetFrom($origin, "hold") . " отправлен на " . PlanetTo($target, "hold") . ". Задание: <span class='ownclass'>Держаться</span></span>";
} else {
if ($dir == 0x22) {
echo "<span class='holding hold'>" . PlayerDetails($owner) . " удерживает альянсовый " . OverFleet($fleet, 1, "hold") . "флот</a><a href='#' title='" . TitleFleet($fleet, 1) . "'></a> с " . PlanetFrom($origin, "hold") . " на орбите " . PlanetFrom($target, "hold") . ". Задание: Держаться</span>";
}
}
}
}
}
} else {
if ($mission == 6) {
if ($dir == 0) {
echo "<span class='flight ownespionage'>Ваш " . OverFleet($fleet, 0, "ownespionage") . "флот</a><a href='#' title='" . TitleFleet($fleet, 0) . "'></a> с " . PlanetFrom($origin, "ownespionage") . " отправлен на " . PlanetTo($target, "ownespionage") . ". Задание: " . Cargo($m, $k, $d, "ownespionage", "Шпионаж") . "</span>";
} else {
if ($dir == 1) {
echo "<span class='return ownespionage'>Ваш " . OverFleet($fleet, 0, "ownespionage") . "флот</a><a href='#' title='" . TitleFleet($fleet, 0) . "'></a>, отправленный с " . PlanetFrom($origin, "ownespionage") . ", возвращается на " . PlanetTo($target, "ownespionage") . ". Задание: " . Cargo($m, $k, $d, "ownespionage", "Шпионаж") . "</span>";
} else {
if ($dir == 0x10) {
echo "<span class='flight espionage'>Боевой " . OverFleet($fleet, 1, "espionage") . "флот</a><a href='#' title='" . TitleFleet($fleet, 1) . "'></a> игрока " . PlayerDetails($owner) . " с " . PlanetFrom($origin, "espionage") . " отправлен на " . PlanetTo($target, "espionage") . ". Задание: Шпионаж</span>";
}
}
}
} else {
if ($mission == 7) {
if ($dir == 0) {
echo "<span class='flight owncolony'>Ваш " . OverFleet($fleet, 0, "owncolony") . "флот</a><a href='#' title='" . TitleFleet($fleet, 0) . "'></a> с " . PlanetFrom($origin, "owncolony") . " отправлен на позицию " . PlanetTo($target, "owncolony") . ". Задание: " . Cargo($m, $k, $d, "owncolony", "Колонизировать") . "</span>";
//.........这里部分代码省略.........
示例12: Queue_Research_End
function Queue_Research_End($queue)
{
global $db_prefix, $GlobalUser;
$id = $queue['obj_id'];
$lvl = $queue['level'];
$planet_id = $queue['sub_id'];
$player_id = $queue['owner_id'];
// Рассчитать производство планеты с момента последнего обновления.
$planet = GetPlanet($planet_id);
$planet = ProdResources($planet, $planet['lastpeek'], $queue['end']);
// Обновить уровень исследования в базе данных.
$query = "UPDATE " . $db_prefix . "users SET " . ('r' . $id) . " = {$lvl} WHERE player_id = {$player_id}";
dbquery($query);
RemoveQueue($queue['task_id']);
// Добавить очки.
$res = ResearchPrice($id, $lvl);
$m = $res['m'];
$k = $res['k'];
$d = $res['d'];
$e = $res['e'];
$points = $m + $k + $d;
AdjustStats($queue['owner_id'], $points, 0, 1, '+');
RecalcRanks();
Debug("Исследование " . loca("NAME_{$id}") . " уровня {$lvl} для пользователя {$player_id} завершено.");
if ($GlobalUser['player_id'] == $player_id) {
InvalidateUserCache();
$GlobalUser = LoadUser($player_id);
// обновить данные текущего пользователя
}
}
示例13: RocketAttack
function RocketAttack($fleet_id, $planet_id)
{
global $UnitParam;
$fleet = LoadFleet($fleet_id);
$amount = $fleet['ipm_amount'];
$primary = $fleet['ipm_target'];
$origin = GetPlanet($fleet['start_planet']);
$target = GetPlanet($planet_id);
$origin_user = LoadUser($origin['owner_id']);
$target_user = LoadUser($target['owner_id']);
// Отбить атаку МПР перехватчиками
$ipm = $amount;
$abm = $target['d502'];
$ipm = max(0, $ipm - $abm);
$ipm_destroyed = $amount - $ipm;
$target['d502'] -= $ipm_destroyed;
$maxdamage = $ipm * 12000 * (1 + $origin_user['r109'] / 10);
// Произвести атаку первичной цели
if ($primary > 0 && $ipm > 0) {
$armor = $UnitParam[$primary][0] * (1 + 0.1 * $target_user['r111']) / 10;
$count = $target["d{$primary}"];
$destroyed = min(floor($maxdamage / $armor), $count);
$target["d{$primary}"] -= $destroyed;
$maxdamage -= $destroyed * $armor;
$maxdamage -= $destroyed;
}
// Расчитать потери обороны, если еще остались МПР
if ($maxdamage > 0) {
$defmap = array(401, 402, 403, 404, 405, 406, 407, 408, 502, 503);
foreach ($defmap as $i => $id) {
if ($id == $primary) {
continue;
}
$armor = $UnitParam[$id][0] * (1 + 0.1 * $target_user['r111']) / 10;
$count = $target["d{$id}"];
if ($count == 0) {
continue;
}
$destroyed = min(floor($maxdamage / $armor), $count);
$target["d{$id}"] -= $destroyed;
$maxdamage -= $destroyed * $armor;
$maxdamage -= $destroyed;
if ($maxdamage <= 0) {
break;
}
}
}
// Записать назад потери обороны.
SetPlanetDefense($planet_id, $target);
// Изменить статистику игроков
RecalcRanks();
$text = "{$amount} ракетам из общего числа выпущенных ракет с планеты " . $origin['name'] . " <a href=# onclick=showGalaxy(" . $origin['g'] . "," . $origin['s'] . "," . $origin['p'] . "); >[" . $origin['g'] . ":" . $origin['s'] . ":" . $origin['p'] . "]</a> ";
$text .= "удалось попасть на Вашу планету " . $target['name'] . " <a href=# onclick=showGalaxy(" . $target['g'] . "," . $target['s'] . "," . $target['p'] . "); >[" . $target['g'] . ":" . $target['s'] . ":" . $target['p'] . "]</a> !<br>";
if ($ipm_destroyed) {
$text .= "{$ipm_destroyed} ракет(-ы) было уничтожено Вашими ракетами-перехватчиками<br>:<br>";
}
$defmap = array(503, 502, 408, 407, 406, 405, 404, 403, 402, 401);
$text .= "<table width=400><tr><td class=c colspan=4>Поражённая оборона</td></tr>";
$n = 0;
foreach ($defmap as $i => $gid) {
if ($n % 2 == 0) {
$text .= "</tr>";
}
if ($target["d{$gid}"]) {
$text .= "<td>" . loca("NAME_{$gid}") . "</td><td>" . nicenum($target["d{$gid}"]) . "</td>";
$n++;
}
}
$text .= "</table><br>\n";
// Обновить активность на планете.
$queue = GetFleetQueue($fleet_id);
UpdatePlanetActivity($planet_id, $queue['end']);
SendMessage($target_user['player_id'], "Командование флотом", "Ракетная атака", $text, 2);
}
示例14: intval
$source_id = 0;
}
if (key_exists('zm', $_POST)) {
$target_id = intval($_POST['zm']);
} else {
$target_id = 0;
}
$total = 0;
foreach ($fleetmap as $i => $gid) {
if (!key_exists("c{$gid}", $_POST)) {
$_POST["c{$gid}"] = 0;
}
$total += floor(abs(intval($_POST["c{$gid}"])));
}
$source = GetPlanet($source_id);
$target = GetPlanet($target_id);
if ($source['type'] != 0) {
$GateError .= "<center>\nС какой луны?<br></center>\n";
}
if ($target['type'] != 0) {
$GateError .= "<center>\nНа какую луну?<br></center>\n";
}
if ($GateError === "") {
if ($source["b43"] == 0) {
$GateError .= "<center>\nНа исходной луне нет ворот<br></center>\n";
}
if ($target["b43"] == 0) {
$GateError .= "<center>\nНа целевой луне нет ворот<br></center>\n";
}
}
if ($GateError === "") {
示例15: Buddy_Outcome
function Buddy_Outcome()
{
global $GlobalUser;
echo "<table width=\"519\">\n";
echo " <tr><td class=\"c\" colspan=\"6\">" . loca("BUDDY_YOUR_REQUESTS") . "</td></tr>\n";
$result = EnumOutcomeBuddy($GlobalUser['player_id']);
$num = dbrows($result);
if ($num) {
$i = 1;
echo " <tr>\n";
echo " <th></th>\n";
echo " <th>" . loca("BUDDY_USER") . "</th>\n";
echo " <th>" . loca("BUDDY_ALLY") . "</th>\n";
echo " <th>" . loca("BUDDY_COORD") . "</th>\n";
echo " <th>" . loca("BUDDY_TEXT") . "</th>\n";
echo " <th></th>\n";
echo " </tr>\n";
while ($num--) {
$buddy = dbarray($result);
$userto = LoadUser($buddy['request_to']);
$home = GetPlanet($userto['hplanetid']);
echo " <tr>\n";
echo " <th width=\"20\">{$i}</th>\n";
echo " <th><a href=\"index.php?page=writemessages&session=" . $_GET['session'] . "&messageziel=" . $userto['player_id'] . "\">" . $userto['oname'] . "</a></th>\n";
if ($userto['ally_id'] > 0) {
$ally = LoadAlly($userto['ally_id']);
echo " <th><a href=index.php?page=ainfo&session=" . $_GET['session'] . "&allyid=" . $userto['ally_id'] . " target='_ally'> ";
echo $ally['tag'];
if ($userto['allyrank'] == 0) {
echo " (G)";
}
echo "</a></th>\n";
} else {
echo " <th><a href=index.php?page=allianzen&session=" . $_GET['session'] . "> </a></th>\n";
}
echo " <th><a href=\"index.php?page=galaxy&galaxy=" . $home['g'] . "&system=" . $home['s'] . "&position=" . $home['p'] . "&session=" . $_GET['session'] . "\" >[" . $home['g'] . ":" . $home['s'] . ":" . $home['p'] . "]</a></th>\n";
echo " <th>" . $buddy['text'] . "</th>\n";
echo " <th width=\"100\"><a href=?page=buddy&session=" . $_GET['session'] . "&action=4&buddy_id=" . $buddy['buddy_id'] . ">" . loca("BUDDY_RECALL") . "</a></th>\n";
echo " </tr>\n";
$i++;
}
} else {
echo " <tr> <th colspan=\"6\">" . loca("BUDDY_NO_REQUESTS") . "</th> </tr>\n";
}
echo " <tr> <td class=\"c\" colspan=\"6\"><a href=\"?page=buddy&session=" . $_GET['session'] . "\">" . loca("BUDDY_BACK") . "</a></td> </tr>\n";
echo "</table><br><br><br><br>\n";
}