当前位置: 首页>>代码示例>>PHP>>正文


PHP ProdResources函数代码示例

本文整理汇总了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") {
开发者ID:vksavochkin,项目名称:ogame-opensource,代码行数:31,代码来源:messages.php

示例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:
//.........这里部分代码省略.........
开发者ID:Ansty93,项目名称:ogame-opensource,代码行数:101,代码来源:fleet.php

示例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);
        // обновить данные текущего пользователя
    }
}
开发者ID:Ansty93,项目名称:ogame-opensource,代码行数:30,代码来源:queue.php

示例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>  
开发者ID:vksavochkin,项目名称:ogame-opensource,代码行数:31,代码来源:imperium.php

示例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 === '';
}
开发者ID:Ansty93,项目名称:ogame-opensource,代码行数:10,代码来源:botapi.php


注:本文中的ProdResources函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。