本文整理汇总了PHP中ProdResources函数的典型用法代码示例。如果您正苦于以下问题:PHP ProdResources函数的具体用法?PHP ProdResources怎么用?PHP ProdResources使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了ProdResources函数的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: loca_add
<?php
// Сообщения (пока вариант без Командира).
loca_add("menu", $GlobalUni['lang']);
if (key_exists('cp', $_GET)) {
SelectPlanet($GlobalUser['player_id'], intval($_GET['cp']));
}
$GlobalUser['aktplanet'] = GetSelectedPlanet($GlobalUser['player_id']);
$now = time();
UpdateQueue($now);
$aktplanet = GetPlanet($GlobalUser['aktplanet']);
$aktplanet = ProdResources($aktplanet, $aktplanet['lastpeek'], $now);
UpdatePlanetActivity($aktplanet['planet_id']);
UpdateLastClick($GlobalUser['player_id']);
PageHeader("messages");
// *******************************************************************
$MAXMSG = 25;
// Количество сообщений на странице.
$uni = LoadUniverse();
DeleteExpiredMessages($GlobalUser['player_id']);
// Удалить сообщения которые хранятся дольше 24 часов.
// Заголовок таблицы
echo "<!-- CONTENT AREA -->\n";
echo "<div id='content'>\n";
echo "<center>\n";
//echo "GET: "; print_r ($_GET); echo "<br>";
//echo "POST: "; print_r ($_POST); echo "<br>";
if (method() === "POST") {
//print_r ($_POST);
$player_id = $GlobalUser['player_id'];
if ($_POST['deletemessages'] === "deleteall") {
示例2: Queue_Fleet_End
function Queue_Fleet_End($queue)
{
global $GlobalUser;
$fleetmap = array(202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215);
$fleet_obj = LoadFleet($queue['sub_id']);
if ($fleet_obj['m'] < 0) {
$fleet_obj['m'] = 0;
}
if ($fleet_obj['k'] < 0) {
$fleet_obj['k'] = 0;
}
if ($fleet_obj['d'] < 0) {
$fleet_obj['d'] = 0;
}
if ($fleet_obj == null) {
return;
}
$fleet = array();
foreach ($fleetmap as $i => $gid) {
$fleet[$gid] = $fleet_obj["ship{$gid}"];
}
// Обновить выработку ресурсов на планетах
$origin = GetPlanet($fleet_obj['start_planet']);
$target = GetPlanet($fleet_obj['target_planet']);
$target = ProdResources($target, $target['lastpeek'], $queue['end']);
$origin = ProdResources($origin, $origin['lastpeek'], $queue['end']);
switch ($fleet_obj['mission']) {
case 1:
AttackArrive($queue, $fleet_obj, $fleet, $origin, $target);
break;
case 101:
CommonReturn($queue, $fleet_obj, $fleet, $origin, $target);
break;
case 2:
AttackArrive($queue, $fleet_obj, $fleet, $origin, $target);
break;
case 102:
CommonReturn($queue, $fleet_obj, $fleet, $origin, $target);
break;
case 3:
TransportArrive($queue, $fleet_obj, $fleet, $origin, $target);
break;
case 103:
CommonReturn($queue, $fleet_obj, $fleet, $origin, $target);
break;
case 4:
DeployArrive($queue, $fleet_obj, $fleet, $origin, $target);
break;
case 104:
CommonReturn($queue, $fleet_obj, $fleet, $origin, $target);
break;
case 5:
HoldingArrive($queue, $fleet_obj, $fleet, $origin, $target);
break;
case 205:
HoldingHold($queue, $fleet_obj, $fleet, $origin, $target);
break;
case 105:
CommonReturn($queue, $fleet_obj, $fleet, $origin, $target);
break;
case 6:
SpyArrive($queue, $fleet_obj, $fleet, $origin, $target);
break;
case 106:
SpyReturn($queue, $fleet_obj, $fleet, $origin, $target);
break;
case 7:
ColonizationArrive($queue, $fleet_obj, $fleet, $origin, $target);
break;
case 107:
ColonizationReturn($queue, $fleet_obj, $fleet, $origin, $target);
break;
case 8:
RecycleArrive($queue, $fleet_obj, $fleet, $origin, $target);
break;
case 108:
CommonReturn($queue, $fleet_obj, $fleet, $origin, $target);
break;
case 9:
DestroyArrive($queue, $fleet_obj, $fleet, $origin, $target);
break;
case 109:
CommonReturn($queue, $fleet_obj, $fleet, $origin, $target);
break;
case 15:
ExpeditionArrive($queue, $fleet_obj, $fleet, $origin, $target);
break;
case 215:
ExpeditionHold($queue, $fleet_obj, $fleet, $origin, $target);
break;
case 115:
CommonReturn($queue, $fleet_obj, $fleet, $origin, $target);
break;
case 20:
RocketAttackArrive($queue, $fleet_obj, $fleet, $origin, $target);
break;
case 21:
AttackArrive($queue, $fleet_obj, $fleet, $origin, $target);
break;
case 121:
//.........这里部分代码省略.........
示例3: 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);
// обновить данные текущего пользователя
}
}
示例4: EnumPlanets
if ($planettype == 1 || $planettype == 3) {
$result = EnumPlanets();
$rows = dbrows($result);
while ($rows--) {
$planet = dbarray($result);
if ($planet['type'] == 0) {
$moons++;
}
if ($planettype == 1 && $planet['type'] == 0) {
continue;
}
if ($planettype == 3 && $planet['type'] != 0) {
continue;
}
$plist[$num] = GetPlanet($planet['planet_id']);
$plist[$num] = ProdResources($plist[$num], $plist[$num]['lastpeek'], $now);
$num++;
}
}
$unitab = $GlobalUni;
$speed = $unitab['speed'];
$buildmap = array(1, 2, 3, 4, 12, 14, 15, 21, 22, 23, 24, 31, 33, 34, 41, 42, 43, 44);
$fleetmap = array(202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215);
$defmap = array(401, 402, 403, 404, 405, 406, 407, 408, 502, 503);
$resmap = array(106, 108, 109, 110, 111, 113, 114, 115, 117, 118, 120, 121, 122, 123, 124, 199);
?>
<!-- CONTENT AREA -->
<div id='content'>
<center>
<script>t=0;</script>
示例5: BotCanResearch
function BotCanResearch($obj_id)
{
global $BotID, $BotNow;
$user = LoadUser($BotID);
$aktplanet = GetPlanet($user['aktplanet']);
$aktplanet = ProdResources($aktplanet, $aktplanet['lastpeek'], $BotNow);
$level = $aktplanet['r' . $obj_id] + 1;
$text = CanResearch($user, $aktplanet, $obj_id, $level);
return $text === '';
}