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


PHP UpdatePlanetBatimentQueueList函数代码示例

本文整理汇总了PHP中UpdatePlanetBatimentQueueList函数的典型用法代码示例。如果您正苦于以下问题:PHP UpdatePlanetBatimentQueueList函数的具体用法?PHP UpdatePlanetBatimentQueueList怎么用?PHP UpdatePlanetBatimentQueueList使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了UpdatePlanetBatimentQueueList函数的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: ShowPlanetMenu

function ShowPlanetMenu($CurrentUser)
{
    global $dpath, $lang;
    $planets = SortUserPlanets($CurrentUser);
    while ($p = mysql_fetch_array($planets)) {
        if ($p["destruyed"] == 0) {
            $ct = $p["field_max"] + $p["terraformer"] * FIELDS_BY_TERRAFORMER;
            if ($p['planet_type'] == 3) {
                $ct = $p["field_max"];
            }
            if ($p['b_building'] != 0) {
                UpdatePlanetBatimentQueueList($CurrentUserPlanet, $CurrentUser);
                if ($p['b_building'] != 0) {
                    $BuildQueue = $p['b_building_id'];
                    $QueueArray = explode(";", $BuildQueue);
                    $CurrentBuild = explode(",", $QueueArray[0]);
                    $BuildElement = $CurrentBuild[0];
                    $BuildLevel = $CurrentBuild[1];
                    $BuildRestTime = pretty_time($CurrentBuild[3] - time());
                    $construccion = "" . $lang['tech'][$BuildElement] . "<br>(Construyendo nivel " . $BuildLevel . ")<br>Tiempo restante:" . $BuildRestTime . "";
                } else {
                    CheckPlanetUsedFields($p);
                    $construccion = $lang['ov_free'];
                }
            } else {
                $construccion = $lang['ov_free'];
            }
            $popup = "" . $p['name'] . "&nbsp;[" . $p['galaxy'] . ":" . $p['system'] . ":" . $p['planet'] . "]<br>Campos&nbsp;ocupados:&nbsp;" . $p['field_current'] . "/" . $ct . "<br>" . $construccion . "";
            if ($t == 0) {
                $parse['mplanet'] .= "<th text-decoration:none>";
            }
            if ($p['planet_type'] == 1 && $p["id"] != $CurrentUser["current_planet"]) {
                $parse['mplanet'] .= "<div align=center><a class=mplanet href=game.php?page={$_GET['page']}&gid={$_GET['gid']}&cp=" . $p['id'] . "&mode=" . $_GET['mode'] . "&re=0 onmouseover=\"return overlib('" . $popup . "', CENTER, OFFSETX, -80, OFFSETY, 20, WIDTH, 200)\" onmouseout=\"return nd();\"><img src=" . $dpath . "/planeten/" . $p['image'] . ".jpg border=0 height=78 width=78><br><font color=#2E9AFE>" . $p['name'] . "&nbsp;</font><font color=#58FA58><br>[" . $p['galaxy'] . ":" . $p['system'] . ":" . $p['planet'] . "]</font></a>";
            } elseif ($p['planet_type'] == 3 && $p["id"] != $CurrentUser["current_planet"]) {
                $parse['mplanet'] .= "<div align=center><a class=mplanet href=game.php?page={$_GET['page']}&gid={$_GET['gid']}&cp=" . $p['id'] . "&mode=" . $_GET['mode'] . "&re=0 onmouseover=\"return overlib('" . $popup . "', CENTER, OFFSETX, -80, OFFSETY, 20, WIDTH, 200)\" onmouseout=\"return nd();\"><img src=" . $dpath . "/planeten/" . $p['image'] . ".jpg border=0 height=78 width=78><br>" . $p['name'] . " (Luna)&nbsp;<font color=#58FA58><br>[" . $p['galaxy'] . ":" . $p['system'] . ":" . $p['planet'] . "]</font></a>";
            } else {
                $parse['mplanet'] .= "<div align=center><a class=mplanet href=# onmouseover=\"return overlib('" . $popup . "', CENTER, OFFSETX, -80, OFFSETY, 20, WIDTH, 200)\" onmouseout=\"return nd();\"><img src=" . $dpath . "/planeten/" . $p['image'] . ".jpg border=0 height=78 width=78><br><font color=#FFFF00>" . $p['name'] . "&nbsp;</font><font color=#FE9A2E><br>[" . $p['galaxy'] . ":" . $p['system'] . ":" . $p['planet'] . "]</font></a></div>";
            }
            if ($t == 6) {
                $parse['mplanet'] .= "</th>";
                $t = 0;
            } else {
                $t = $t + 1;
            }
        }
    }
    $parse['mplanet'] .= "</center></table>";
    return parsetemplate(gettemplate('planet_menu'), $parse);
}
开发者ID:sonicmaster,项目名称:RPG,代码行数:49,代码来源:ShowPlanetMenu.php

示例2: ShowOverviewPage


//.........这里部分代码省略.........
            //////////////////////////////////////////////////
            $OtherFleets = doquery("SELECT * FROM {{table}} WHERE `fleet_target_owner` = '" . $CurrentUser['id'] . "';", 'fleets');
            $Record = 2000;
            while ($FleetRow = mysql_fetch_array($OtherFleets)) {
                if ($FleetRow['fleet_owner'] != $CurrentUser['id']) {
                    if ($FleetRow['fleet_mission'] != 8) {
                        $Record++;
                        $StartTime = $FleetRow['fleet_start_time'];
                        $StayTime = $FleetRow['fleet_end_stay'];
                        if ($StartTime > time()) {
                            $Label = "ofs";
                            $fpage[$StartTime . $id] = $FlyingFleetsTable->BuildFleetEventTable($FleetRow, 0, false, $Label, $Record);
                        }
                        if ($FleetRow['fleet_mission'] == 5) {
                            $Label = "oft";
                            if ($StayTime > time()) {
                                $fpage[$StayTime . $id] = $FlyingFleetsTable->BuildFleetEventTable($FleetRow, 1, false, $Label, $Record);
                            }
                        }
                    }
                }
            }
            mysql_free_result($OtherFleets);
            $planets_query = doquery("SELECT * FROM `{{table}}` WHERE id_owner='{$CurrentUser['id']}' AND `destruyed` = 0", "planets");
            $Colone = 1;
            $AllPlanets = "<tr>";
            while ($CurrentUserPlanet = mysql_fetch_array($planets_query)) {
                if ($CurrentUserPlanet["id"] != $CurrentUser["current_planet"] && $CurrentUserPlanet['planet_type'] != 3) {
                    $Coloneshow++;
                    $AllPlanets .= "<th width='80'>" . $CurrentUserPlanet['name'] . "<br>";
                    $AllPlanets .= "<a href=\"game.php?page=overview&cp=" . $CurrentUserPlanet['id'] . "&re=0\" title=\"" . $CurrentUserPlanet['name'] . "\"><img src=\"" . $dpath . "planeten/small/s_" . $CurrentUserPlanet['image'] . ".gif\" height=\"50\" width=\"50\"></a><br>";
                    $AllPlanets .= "<center>";
                    if ($CurrentUserPlanet['b_building'] != 0) {
                        UpdatePlanetBatimentQueueList($CurrentUserPlanet, $CurrentUser);
                        if ($CurrentUserPlanet['b_building'] != 0) {
                            $BuildQueue = $CurrentUserPlanet['b_building_id'];
                            $QueueArray = explode(";", $BuildQueue);
                            $CurrentBuild = explode(",", $QueueArray[0]);
                            $BuildElement = $CurrentBuild[0];
                            $BuildLevel = $CurrentBuild[1];
                            $BuildRestTime = pretty_time($CurrentBuild[3] - time());
                            $AllPlanets .= '' . $lang['tech'][$BuildElement] . ' (' . $BuildLevel . ')';
                            $AllPlanets .= "<br><font color=\"#7f7f7f\">(" . $BuildRestTime . ")</font>";
                        } else {
                            CheckPlanetUsedFields($CurrentUserPlanet);
                            $AllPlanets .= $lang['ov_free'];
                        }
                    } else {
                        $AllPlanets .= $lang['ov_free'];
                    }
                    $AllPlanets .= "</center></th>";
                    if ($Colone <= 5) {
                        $Colone++;
                    } else {
                        $AllPlanets .= "</tr><tr>";
                        $Colone = 1;
                    }
                }
            }
            mysql_free_result($planets_query);
            $AllPlanets .= "</tr>";
            if ($game_config['OverviewNewsFrame'] == '1') {
                $parse['NewsFrame'] = "<tr>" . $lang['ov_news_title'] . "<th colspan=\"4\">" . stripslashes($game_config['OverviewNewsText']) . "</th></tr>";
            }
            if ($lunarow['id'] != 0 && $lunarow['destruyed'] != 1 && $CurrentPlanet['planet_type'] != 3) {
                if ($CurrentPlanet['planet_type'] == 1 or $lunarow['id'] != 0) {
开发者ID:sonicmaster,项目名称:RPG,代码行数:67,代码来源:ShowOverviewPage.php

示例3: pretty_number

 $parse['Have_new_level_raid'] = $HaveNewLevelRaid;
 $parse['time'] = "<div id=\"dateheure\"></div>";
 $parse['dpath'] = $dpath;
 $parse['planet_image'] = $planetrow['image'];
 $parse['anothers_planets'] = $AllPlanets;
 $parse['max_users'] = $MaxUsers['count'];
 $parse['metal_debris'] = pretty_number($galaxyrow['metal']);
 $parse['crystal_debris'] = pretty_number($galaxyrow['crystal']);
 $parse['appolonium_debris'] = pretty_number($galaxyrow['appolonium']);
 if (($galaxyrow['metal'] != 0 || $galaxyrow['crystal'] != 0 || $galaxyrow['appolonium'] != 0) && $planetrow[$resource[219]] != 0 or $planetrow[$resource[209]] != 0) {
     $parse['get_link'] = " [<a href=\"quickfleet.php?mode=8&amp;g=" . $galaxyrow['galaxy'] . "&amp;s=" . $galaxyrow['system'] . "&amp;p=" . $galaxyrow['planet'] . "&amp;t=2\">" . $lang['type_mission'][8] . "</a>]";
 } else {
     $parse['get_link'] = '';
 }
 if ($planetrow['b_building'] != 0) {
     UpdatePlanetBatimentQueueList($planetrow, $user);
     if ($planetrow['b_building'] != 0) {
         $BuildQueue = explode(";", $planetrow['b_building_id']);
         $CurrBuild = explode(",", $BuildQueue[0]);
         $RestTime = $planetrow['b_building'] - time();
         $PlanetID = $planetrow['id'];
         $Build = countdown('gebaude', $RestTime);
         $Build2 = $lang['tech'][$CurrBuild[0]];
         $parse['build'] = '<table cellspacing="0" cellpadding="0" style="width:100%;">
                             <tr><td class="sb" align="left" style="width:30%;" valign="top" ><img src="' . $dpath . 'gebaeude/' . $CurrBuild[0] . '.gif" style="width:40px; height:40px;" alt=""></td>
                                 <td class="sb" align="center" style="width:70%;" valign="middle" >' . $Build . ' </td></tr>
                             <tr><td class="sb" align="center" style="width:30%;" valign="middle" ><img src="./styl/image/pfeile/rechto.png" alt=""></td>
                                 <td class="sb" align="left" style="width:70%;" valign="middle" >' . $Build2 . ' </td></tr>
                         </table>';
     } else {
         $parse['build'] = '<table cellspacing="0" style="width:100%;">
开发者ID:sonicmaster,项目名称:RPG,代码行数:31,代码来源:overview.php

示例4: Update

 protected function Update()
 {
     //UpdatePlanet($this->CurrentPlanet, $this->user, time(), true);
     UpdatePlanetBatimentQueueList($this->CurrentPlanet, $this->user);
     HandleTechnologieBuild($this->CurrentPlanet, $this->user);
     PlanetResourceUpdate($this->user, $this->CurrentPlanet, time());
 }
开发者ID:Artea,项目名称:xg-bot,代码行数:7,代码来源:class.Bot.php

示例5: HandleEventQueue

function HandleEventQueue()
{
    $lockname = "HandleEventQueue";
    if (!get_lock($lockname)) {
        return;
    }
    $events = doquery("SELECT * FROM event_queue ORDER BY due_time LIMIT 5", 'NOTABLE');
    while ($event = mysql_fetch_array($events)) {
        switch ($event['type']) {
            case "building":
                UpdatePlanetBatimentQueueList($event['id']);
                break;
            case "tech":
                break;
            default:
                assert(false);
        }
    }
    release_lock($lockname);
}
开发者ID:GaryHuang-CL,项目名称:y1910061,代码行数:20,代码来源:functions.php

示例6: ShowOverviewPage


//.........这里部分代码省略.........
            $OtherFleets = doquery("SELECT * FROM {{table}} WHERE `fleet_target_owner` = '" . intval($CurrentUser['id']) . "';", 'fleets');
            $Record = 2000;
            while ($FleetRow = mysql_fetch_array($OtherFleets)) {
                if ($FleetRow['fleet_owner'] != $CurrentUser['id']) {
                    if ($FleetRow['fleet_mission'] != 8) {
                        $Record++;
                        $StartTime = $FleetRow['fleet_start_time'];
                        $StayTime = $FleetRow['fleet_end_stay'];
                        $id = $FleetRow['fleet_id'];
                        if ($StartTime > time()) {
                            $Label = "ofs";
                            $fpage[$StartTime . $id] = $FlyingFleetsTable->BuildFleetEventTable($FleetRow, 0, false, $Label, $Record);
                        }
                        if ($FleetRow['fleet_mission'] == 5) {
                            $Label = "oft";
                            if ($StayTime > time()) {
                                $fpage[$StayTime . $id] = $FlyingFleetsTable->BuildFleetEventTable($FleetRow, 1, false, $Label, $Record);
                            }
                        }
                    }
                }
            }
            mysql_free_result($OtherFleets);
            $planets_query = doquery("SELECT * FROM `{{table}}` WHERE id_owner='" . intval($CurrentUser['id']) . "' AND `destruyed` = 0", "planets");
            $Colone = 1;
            $AllPlanets = "<tr>";
            while ($CurrentUserPlanet = mysql_fetch_array($planets_query)) {
                if ($CurrentUserPlanet["id"] != $CurrentUser["current_planet"] && $CurrentUserPlanet['planet_type'] != 3) {
                    $Coloneshow++;
                    $AllPlanets .= "<th>" . $CurrentUserPlanet['name'] . "<br>";
                    $AllPlanets .= "<a href=\"game.php?page=overview&cp=" . $CurrentUserPlanet['id'] . "&re=0\" title=\"" . $CurrentUserPlanet['name'] . "\"><img src=\"" . $dpath . "planeten/small/s_" . $CurrentUserPlanet['image'] . ".jpg\" height=\"50\" width=\"50\"></a><br>";
                    $AllPlanets .= "<center>";
                    if ($CurrentUserPlanet['b_building'] != 0) {
                        UpdatePlanetBatimentQueueList($CurrentUserPlanet, $CurrentUser);
                        if ($CurrentUserPlanet['b_building'] != 0) {
                            $BuildQueue = $CurrentUserPlanet['b_building_id'];
                            $QueueArray = explode(";", $BuildQueue);
                            $CurrentBuild = explode(",", $QueueArray[0]);
                            $BuildElement = $CurrentBuild[0];
                            $BuildLevel = $CurrentBuild[1];
                            $BuildRestTime = pretty_time($CurrentBuild[3] - time());
                            $AllPlanets .= '' . $lang['tech'][$BuildElement] . ' (' . $BuildLevel . ')';
                            $AllPlanets .= "<br><font color=\"#7f7f7f\">(" . $BuildRestTime . ")</font>";
                        } else {
                            CheckPlanetUsedFields($CurrentUserPlanet);
                            $AllPlanets .= $lang['ov_free'];
                        }
                    } else {
                        $AllPlanets .= $lang['ov_free'];
                    }
                    $AllPlanets .= "</center></th>";
                    if ($Colone <= 1) {
                        $Colone++;
                    } else {
                        $AllPlanets .= "</tr><tr>";
                        $Colone = 1;
                    }
                }
            }
            mysql_free_result($planets_query);
            $AllPlanets .= "</tr>";
            if ($lunarow['id'] != 0 && $lunarow['destruyed'] != 1 && $CurrentPlanet['planet_type'] != 3) {
                if ($CurrentPlanet['planet_type'] == 1 or $lunarow['id'] != 0) {
                    $moon = doquery("SELECT `id`,`name`,`image` FROM {{table}} WHERE `galaxy` = '" . intval($CurrentPlanet['galaxy']) . "' AND `system` = '" . intval($CurrentPlanet['system']) . "' AND `planet` = '" . intval($CurrentPlanet['planet']) . "' AND `planet_type` = '3'", 'planets', true);
                    $parse['moon_img'] = "<a href=\"game.php?page=overview&cp=" . $moon['id'] . "&re=0\" title=\"" . $moon['name'] . "\"><img src=\"" . $dpath . "planeten/" . $moon['image'] . ".jpg\" height=\"50\" width=\"50\"></a>";
                    $parse['moon'] = $moon['name'] . " (" . $lang['fcm_moon'] . ")";
开发者ID:sonicmaster,项目名称:RPG,代码行数:67,代码来源:ShowOverviewPage.php

示例7: ShowImperiumPage

function ShowImperiumPage($CurrentUser)
{
    global $lang, $resource, $reslist, $dpath;
    $lang['imperium_vision'] = 'Visi&oacute;n general del Imperio';
    $lang['name'] = 'Planeta';
    $lang['coordinates'] = 'Coordenadas';
    $lang['fields'] = 'Campos';
    $lang['resources'] = 'Recursos';
    $lang['buildings'] = 'Edificios';
    $lang['investigation'] = 'Investigaciones';
    $lang['ships'] = 'Flotas';
    $lang['defense'] = 'Defensas';
    $parse = $lang;
    if (isset($_GET['planet_type'])) {
        if ($_GET['planet_type'] == 1) {
            $planettype = " AND `planet_type` = '1'";
            $parse['select1'] = ' selected';
        } elseif ($_GET['planet_type'] == 3) {
            $planettype = "AND `planet_type` = '3'";
            $parse['select3'] = ' selected';
        } else {
            $planettype = '';
            $parse['select0'] = ' selected';
        }
    } else {
        $planettype = '';
        $parse['select0'] = ' selected';
    }
    $planetsrow = doquery("SELECT * FROM {{table}} WHERE `id_owner` = '" . $CurrentUser['id'] . "'{$planettype};", 'planets');
    $planet = array();
    while ($p = mysql_fetch_array($planetsrow)) {
        PlanetResourceUpdate($CurrentUser, $p, time());
        $planet['sum'] = sumar_array($planet['sum'], $p);
        $planet[] = $p;
    }
    uksort($planet, 'planet_empire_sort');
    $parse['mount'] = count($planet) + 3;
    // primera tabla, con las imagenes y coordenadas
    $row = gettemplate('empire/imperium_row');
    $row2 = gettemplate('empire/imperium_row2');
    foreach ($planet as $ID => $p) {
        if ($ID !== 'sum') {
            UpdatePlanetBatimentQueueList($p, $CurrentUser);
            $AllPlanets = '';
            if ($p['b_building'] != 0) {
                $BuildQueue = $p['b_building_id'];
                $QueueArray = explode(";", $BuildQueue);
                $CurrentBuild = explode(",", $QueueArray[0]);
                $BuildElement = $CurrentBuild[0];
                $BuildLevel = $CurrentBuild[1];
                $BuildRestTime = pretty_time($CurrentBuild[3] - time());
                $AllPlanets .= $lang['tech'][$BuildElement] . ' (' . $BuildLevel . ')';
                $AllPlanets .= "<br/><font color=\"#7f7f7f\">(" . $BuildRestTime . ")</font>";
            } else {
                CheckPlanetUsedFields($p);
                $AllPlanets .= "<a href='game.php?page=buildings'>Libre</a>";
            }
            // {file_images}
            $parse['build'] .= '<th width="75">' . $AllPlanets . '</th>';
            $data['text'] = '<a href="game.php?page=overview&cp=' . $p['id'] . '&re=0"><img src="' . $dpath . 'planeten/' . $p['image'] . '.jpg" border="0" height="75" width="75"></a><br/>';
            $parse['file_images'] .= parsetemplate($row, $data);
            // {file_names}
            $data['text'] = '<a href="game.php?page=overview&cp=' . $p['id'] . '&re=0">' . $p['name'] . ' </a>';
            if ($p['planet_type'] == 3) {
                $data['text'] = '<a href="game.php?page=overview&cp=' . $p['id'] . '&re=0">' . $p['name'] . ' (Luna)</a>';
            }
            $parse['file_names'] .= parsetemplate($row2, $data);
            // {file_type}
            $data['text'] = GetPlanetType($p);
            $parse['file_type'] .= parsetemplate($row2, $data);
            // {file_coordinates}
            $data['text'] = "[<a href=\"game.php?page=galaxy&mode=3&galaxy={$p['galaxy']}&system={$p['system']}\">{$p['galaxy']}:{$p['system']}:{$p['planet']}</a>]";
            $parse['file_coordinates'] .= parsetemplate($row2, $data);
            // {file_fields}
            $data['text'] = $p['field_current'] . '/' . CalculateMaxPlanetFields($p) . '<br/>' . GetPercentBar($p['field_current'], CalculateMaxPlanetFields($p));
            $parse['file_fields'] .= parsetemplate($row2, $data);
            // {file_metal}
            $data['text'] = '<a href="game.php?page=resources&cp=' . $p['id'] . '&re=0&planettype=' . $p['planet_type'] . '">' . pretty_number($p['metal']) . '</a><br/>' . GetPercentBar($p['metal'], $p['metal_max'] * MAX_OVERFLOW);
            $parse['file_metal'] .= parsetemplate($row2, $data);
            // {file_crystal}
            $data['text'] = '<a href="game.php?page=resources&cp=' . $p['id'] . '&re=0&planettype=' . $p['planet_type'] . '">' . pretty_number($p['crystal']) . '</a><br/>' . GetPercentBar($p['crystal'], $p['crystal_max'] * MAX_OVERFLOW);
            $parse['file_crystal'] .= parsetemplate($row2, $data);
            // {file_deuterium}
            $data['text'] = '<a href="game.php?page=resources&cp=' . $p['id'] . '&re=0&planettype=' . $p['planet_type'] . '">' . pretty_number($p['deuterium']) . '</a><br/>' . GetPercentBar($p['deuterium'], $p['deuterium_max'] * MAX_OVERFLOW);
            $parse['file_deuterium'] .= parsetemplate($row2, $data);
            // {file_hidrogeno}
            $data['text'] = '<a href="game.php?page=resources&cp=' . $p['id'] . '&re=0&planettype=' . $p['planet_type'] . '">' . pretty_number($p['tritium']) . '</a><br/>' . GetPercentBar($p['tritium'], $p['tritium_max'] * MAX_OVERFLOW);
            $parse['file_tritium'] .= parsetemplate($row2, $data);
            // {file_energy}
            $data['text'] = pretty_number($p['energy_max'] - $p['energy_used']) . ' / ' . pretty_number($p['energy_max']) . '<br/>' . GetPercentBar($p['energy_max'], $p['energy_max'] - $p['energy_used']);
            $parse['file_energy'] .= parsetemplate($row2, $data);
            $Queue = ShowBuildingsPage::ShowBuildingQueue($p, $CurrentUser);
            foreach ($resource as $i => $res) {
                if (in_array($i, $reslist['build'])) {
                    if ($Queue['buildingarray'][$i] > $p[$resource[$i]]) {
                        $p[$resource[$i]] = $p[$resource[$i]] . " <span style='color:lime;'>+" . ($Queue['buildingarray'][$i] - $p[$resource[$i]]) . "</span>";
                    }
                    $data['text'] = $p[$resource[$i]] == 0 ? '' : "<a href=\"game.php?page=buildings&cp={$p['id']}&re=0&planettype={$p['planet_type']}\">" . pretty_number($p[$resource[$i]]) . "</a>";
                    if (IsElementBuyable($CurrentUser, $p, $i, true, false) and IsTechnologieAccessible($CurrentUser, $p, $i) and $p["field_current"] < CalculateMaxPlanetFields($p)) {
                        $data['text'] .= " <a href=\"game.php?page=buildings&cmd=insert&cp={$p['id']}&re=0&building=" . $i . "\"><font color=lime>+</font></a>";
//.........这里部分代码省略.........
开发者ID:sonicmaster,项目名称:RPG,代码行数:101,代码来源:ShowImperiumPage.php

示例8: ShowOverviewPage


//.........这里部分代码省略.........
                        $Record++;
                        $StartTime = $FleetRow['fleet_start_time'];
                        $StayTime = $FleetRow['fleet_end_stay'];
                        if ($StartTime > time()) {
                            $Label = "ofs";
                            $fpage[$StartTime] = $FlyingFleetsTable->BuildFleetEventTable($FleetRow, 0, false, $Label, $Record);
                        }
                        if ($FleetRow['fleet_mission'] == 5) {
                            $Label = "oft";
                            if ($StayTime > time()) {
                                $fpage[$StayTime] = $FlyingFleetsTable->BuildFleetEventTable($FleetRow, 1, false, $Label, $Record);
                            }
                        }
                    }
                }
            }
            mysql_free_result($OtherFleets);
            $planets_query = $db->query("SELECT * FROM `{{table}}` WHERE id_owner='{$CurrentUser['id']}' AND `destruyed` = 0", "planets");
            $Colone = 1;
            $PlanetaQueInv = array();
            while ($CurrentUserPlanet = mysql_fetch_array($planets_query)) {
                if ($CurrentUserPlanet["b_tech"] != 0) {
                    $PlanetaQueInv['b_tech'] = $CurrentUserPlanet["b_tech"];
                    $PlanetaQueInv['b_tech_id'] = $CurrentUserPlanet["b_tech_id"];
                    $PlanetaQueInv['name'] = $CurrentUserPlanet["name"];
                    $PlanetaQueInv['id'] = $CurrentUserPlanet["id"];
                }
                if ($CurrentUserPlanet["id"] != $CurrentUser["current_planet"] && $CurrentUserPlanet['planet_type'] != 3) {
                    $Coloneshow++;
                    $AllPlanets .= "<th>" . $CurrentUserPlanet['name'] . "<br>";
                    $AllPlanets .= "<a href=\"game.php?page=overview&cp=" . $CurrentUserPlanet['id'] . "&re=0\" title=\"" . $CurrentUserPlanet['name'] . "\"><img src=\"" . $dpath . "planeten/small/s_" . $CurrentUserPlanet['image'] . ".jpg\" height=\"20\" width=\"20\"></a><br>";
                    $AllPlanets .= "<center>";
                    if ($CurrentUserPlanet['b_building'] != 0) {
                        UpdatePlanetBatimentQueueList($CurrentUserPlanet, $CurrentUser);
                        if ($CurrentUserPlanet['b_building'] != 0) {
                            $BuildQueue = $CurrentUserPlanet['b_building_id'];
                            $QueueArray = explode(";", $BuildQueue);
                            $CurrentBuild = explode(",", $QueueArray[0]);
                            $BuildElement = $CurrentBuild[0];
                            $BuildLevel = $CurrentBuild[1];
                            $BuildRestTime = pretty_time($CurrentBuild[3] - time());
                            $AllPlanets .= '' . $lang['tech'][$BuildElement] . ' (' . $BuildLevel . ')';
                            $AllPlanets .= "<br><font color=\"#7f7f7f\">(" . $BuildRestTime . ")</font>";
                        } else {
                            CheckPlanetUsedFields($CurrentUserPlanet);
                            $AllPlanets .= $lang['ov_free'];
                        }
                    } else {
                        $AllPlanets .= $lang['ov_free'];
                    }
                    $AllPlanets .= "</center></th>";
                    if ($Coloneshow % 6 == 0) {
                        $AllPlanets .= "</tr><tr>";
                    }
                }
            }
            if ($lunarow['id'] != 0 && $lunarow['destruyed'] != 0 && $CurrentPlanet['planet_type'] != 3) {
                if ($CurrentPlanet['planet_type'] == 1 or $lunarow['id'] != 0) {
                    $displays->newblock('moon');
                    $displays->assign('moon_img', "<a href=\"game.php?page=overview&cp=" . $lunarow['id'] . "&re=0\" title=\"" . $lunarow['name'] . "\"><img src=\"" . $dpath . "planeten/small/s_" . $lunarow['image'] . ".png\" height=\"50\" width=\"50\"></a>");
                    $displays->assign('moon', $lunarow['name'] . " (" . $lang['fcm_moon'] . ")");
                }
            }
            $parse['planet_diameter'] = pretty_number($CurrentPlanet['diameter']);
            $parse['planet_field_current'] = $CurrentPlanet['field_current'];
            $parse['planet_field_max'] = CalculateMaxPlanetFields($CurrentPlanet);
开发者ID:sonicmaster,项目名称:RPG,代码行数:67,代码来源:ShowOverviewPage.php

示例9: MissionCaseDestruction

function MissionCaseDestruction($FleetRow)
{
    global $user, $phpEx, $ugamela_root_path, $pricelist, $lang, $resource, $CombatCaps;
    includeLang('system');
    if ($FleetRow['fleet_start_time'] <= time()) {
        if ($FleetRow['fleet_mess'] == 0) {
            if (!isset($CombatCaps[202]['sd'])) {
                message("<font color=\"red\">" . $lang['sys_no_vars'] . "</font>", $lang['sys_error'], "fleet." . $phpEx, 2);
            }
            $QryGalaxyMoon = "SELECT * FROM {{table}} ";
            $QryGalaxyMoon .= "WHERE ";
            $QryGalaxyMoon .= "`galaxy` = '" . $FleetRow['fleet_end_galaxy'] . "' AND ";
            $QryGalaxyMoon .= "`system` = '" . $FleetRow['fleet_end_system'] . "' AND ";
            $QryGalaxyMoon .= "`planet` = '" . $FleetRow['fleet_end_planet'] . "';";
            $QryGalaxy = doquery($QryGalaxyMoon, 'galaxy', true);
            $QryTargetMoon = "SELECT * FROM {{table}} ";
            $QryTargetMoon .= "WHERE ";
            $QryTargetMoon .= "`galaxy` = '" . $FleetRow['fleet_end_galaxy'] . "' AND ";
            $QryTargetMoon .= "`system` = '" . $FleetRow['fleet_end_system'] . "' AND ";
            $QryTargetMoon .= "`planet` = '" . $FleetRow['fleet_end_planet'] . "' AND ";
            $QryTargetMoon .= "`planet_type` = '3';";
            $TargetMoon = doquery($QryTargetMoon, 'planets', true);
            $TargetUserID = $TargetMoon['id_owner'];
            $TargerMoonID = $TargetMoon['id'];
            $MoonSize = $TargetMoon['diameter'];
            $MoonID = $TargetMoon['id'];
            $MoonName = $TargetMoon['name'];
            $QryCurrentUser = "SELECT * FROM {{table}} ";
            $QryCurrentUser .= "WHERE ";
            $QryCurrentUser .= "`id` = '" . $FleetRow['fleet_owner'] . "';";
            $CurrentUser = doquery($QryCurrentUser, 'users', true);
            $CurrentUserID = $CurrentUser['id'];
            $QryTargetUser = "SELECT * FROM {{table}} ";
            $QryTargetUser .= "WHERE ";
            $QryTargetUser .= "`id` = '" . $TargetUserID . "';";
            $TargetUser = doquery($QryTargetUser, 'users', true);
            $QryTargetTech = "SELECT ";
            $QryTargetTech .= "`military_tech`, `defence_tech`, `shield_tech` ";
            $QryTargetTech .= "FROM {{table}} ";
            $QryTargetTech .= "WHERE ";
            $QryTargetTech .= "`id` = '" . $TargetUserID . "';";
            $TargetTechno = doquery($QryTargetTech, 'users', true);
            $QryCurrentTech = "SELECT ";
            $QryCurrentTech .= "`military_tech`, `defence_tech`, `shield_tech` ";
            $QryCurrentTech .= "FROM {{table}} ";
            $QryCurrentTech .= "WHERE ";
            $QryCurrentTech .= "`id` = '" . $CurrentUserID . "';";
            $CurrentTechno = doquery($QryCurrentTech, 'users', true);
            for ($SetItem = 200; $SetItem < 500; $SetItem++) {
                if ($TargetMoon[$resource[$SetItem]] > 0) {
                    $TargetSet[$SetItem]['count'] = $TargetMoon[$resource[$SetItem]];
                }
            }
            $TheFleet = explode(";", $FleetRow['fleet_array']);
            foreach ($TheFleet as $a => $b) {
                if ($b != '') {
                    $a = explode(",", $b);
                    $CurrentSet[$a[0]]['count'] = $a[1];
                }
            }
            UpdatePlanetBatimentQueueList($TargetMoon, $TargetUser);
            PlanetResourceUpdate($TargetUser, $TargetMoon, time());
            //UPDATE PLANET RESOURCES
            include_once $ugamela_root_path . 'includes/ataki.' . $phpEx;
            // Calcul de la duree de traitement (initialisation)
            $mtime = microtime();
            $mtime = explode(" ", $mtime);
            $mtime = $mtime[1] + $mtime[0];
            $starttime = $mtime;
            $walka = walka($CurrentSet, $TargetSet, $CurrentTechno, $TargetTechno);
            // Calcul de la duree de traitement (calcul)
            $mtime = microtime();
            $mtime = explode(" ", $mtime);
            $mtime = $mtime[1] + $mtime[0];
            $endtime = $mtime;
            $totaltime = $endtime - $starttime;
            // Ce qu'il reste de l'attaquant
            $CurrentSet = $walka["atakujacy"];
            // Ce qu'il reste de l'attaqué
            $TargetSet = $walka["wrog"];
            // Le resultat de la bataille
            $FleetResult = $walka["wygrana"];
            // Rapport long (rapport de bataille detaillé)
            $dane_do_rw = $walka["dane_do_rw"];
            // Rapport court (cdr + unitées perdues)
            $zlom = $walka["zlom"];
            $FleetArray = "";
            $FleetAmount = 0;
            $FleetStorage = 0;
            $Rips = 0;
            foreach ($CurrentSet as $Ship => $Count) {
                if ($Ship == '214') {
                    $Rips += $Count['count'];
                }
                if ($Ship == '210') {
                    $FleetStorage += 0;
                } else {
                    $FleetStorage += $pricelist[$Ship]["capacity"] * $Count['count'];
                }
                $FleetArray .= $Ship . "," . $Count['count'] . ";";
//.........这里部分代码省略.........
开发者ID:sonicmaster,项目名称:RPG,代码行数:101,代码来源:MissionCaseDestruction.php

示例10: ShowOverviewPage


//.........这里部分代码省略.........
            $OtherFleets = doquery("SELECT * FROM {{table}} WHERE `fleet_target_owner` = '" . intval($CurrentUser['id']) . "';", 'fleets');
            $Record = 2000;
            while ($FleetRow = mysql_fetch_array($OtherFleets)) {
                if ($FleetRow['fleet_owner'] != $CurrentUser['id']) {
                    if ($FleetRow['fleet_mission'] != 8) {
                        $Record++;
                        $StartTime = $FleetRow['fleet_start_time'];
                        $StayTime = $FleetRow['fleet_end_stay'];
                        $id = $FleetRow['fleet_id'];
                        if ($StartTime > time()) {
                            $Label = "ofs";
                            $fpage[$StartTime . $id] = $FlyingFleetsTable->BuildFleetEventTable($FleetRow, 0, false, $Label, $Record);
                        }
                        if ($FleetRow['fleet_mission'] == 5) {
                            $Label = "oft";
                            if ($StayTime > time()) {
                                $fpage[$StayTime . $id] = $FlyingFleetsTable->BuildFleetEventTable($FleetRow, 1, false, $Label, $Record);
                            }
                        }
                    }
                }
            }
            mysql_free_result($OtherFleets);
            $planets_query = doquery("SELECT * FROM `{{table}}` WHERE id_owner='" . intval($CurrentUser['id']) . "' AND `destruyed` = 0", "planets");
            $Colone = 1;
            $AllPlanets = "<tr>";
            while ($CurrentUserPlanet = mysql_fetch_array($planets_query)) {
                if ($CurrentUserPlanet["id"] != $CurrentUser["current_planet"] && $CurrentUserPlanet['planet_type'] != 3) {
                    $Coloneshow++;
                    $AllPlanets .= "<th>" . $CurrentUserPlanet['name'] . "<br>";
                    $AllPlanets .= "<a href=\"game.php?page=overview&cp=" . $CurrentUserPlanet['id'] . "&re=0\" title=\"" . $CurrentUserPlanet['name'] . "\"><img src=\"" . $dpath . "planeten/small/s_" . $CurrentUserPlanet['image'] . ".jpg\" height=\"50\" width=\"50\"></a><br>";
                    $AllPlanets .= "<center>";
                    if ($CurrentUserPlanet['b_building'] != 0) {
                        UpdatePlanetBatimentQueueList($CurrentUserPlanet, $CurrentUser);
                        if ($CurrentUserPlanet['b_building'] != 0) {
                            $BuildQueue = $CurrentUserPlanet['b_building_id'];
                            $QueueArray = explode(";", $BuildQueue);
                            $CurrentBuild = explode(",", $QueueArray[0]);
                            $BuildElement = $CurrentBuild[0];
                            $BuildLevel = $CurrentBuild[1];
                            $BuildRestTime = pretty_time($CurrentBuild[3] - time());
                            $AllPlanets .= '' . $lang['tech'][$BuildElement] . ' (' . $BuildLevel . ')';
                            $AllPlanets .= "<br><font color=\"#7f7f7f\">(" . $BuildRestTime . ")</font>";
                        } else {
                            CheckPlanetUsedFields($CurrentUserPlanet);
                            $AllPlanets .= $lang['ov_free'];
                        }
                    } else {
                        $AllPlanets .= $lang['ov_free'];
                    }
                    $AllPlanets .= "</center></th>";
                    if ($Colone <= 9) {
                        $Colone++;
                    } else {
                        $AllPlanets .= "</tr><tr>";
                        $Colone = 0;
                    }
                }
            }
            mysql_free_result($planets_query);
            $AllPlanets .= "</tr>";
            if ($game_config['OverviewNewsFrame'] == '1') {
                $parse['NewsFrame'] = "<tr>" . $lang['ov_news_title'] . "<th colspan=\"4\">" . stripslashes($game_config['OverviewNewsText']) . "</th></tr>";
            }
            if ($lunarow['id'] != 0 && $lunarow['destruyed'] != 1 && $CurrentPlanet['planet_type'] != 3) {
                if ($CurrentPlanet['planet_type'] == 1 or $lunarow['id'] != 0) {
开发者ID:sonicmaster,项目名称:RPG,代码行数:67,代码来源:ShowOverviewPage.php

示例11: ShowOverviewPage


//.........这里部分代码省略.........
            $Record = 2000;
            while ($FleetRow = mysql_fetch_array($OtherFleets)) {
                if ($FleetRow['fleet_owner'] != $CurrentUser['id']) {
                    if ($FleetRow['fleet_mission'] != 8) {
                        $Record++;
                        $StartTime = $FleetRow['fleet_start_time'];
                        $StayTime = $FleetRow['fleet_end_stay'];
                        if ($StartTime > time()) {
                            $Label = "ofs";
                            $fpage[$StartTime] = $FlyingFleetsTable->BuildFleetEventTable($FleetRow, 0, false, $Label, $Record);
                        }
                        if ($FleetRow['fleet_mission'] == 5) {
                            $Label = "oft";
                            if ($StayTime > time()) {
                                $fpage[$StayTime] = $FlyingFleetsTable->BuildFleetEventTable($FleetRow, 1, false, $Label, $Record);
                            }
                        }
                    }
                }
            }
            $planets_query = doquery("SELECT * FROM `{{table}}` WHERE id_owner='{$CurrentUser['id']}' AND `destruyed` = 0", "planets");
            $Colone = 1;
            $AllPlanets = "<tr>";
            if ($game_config['OverviewNewsFrame'] == '1') {
                $parse['NewsFrame'] = "<tr><th>" . $lang['ov_news_title'] . "</th><th colspan=\"3\">" . stripslashes($game_config['OverviewNewsText']) . "</th></tr>";
            }
            while ($CurrentUserPlanet = mysql_fetch_array($planets_query)) {
                if ($CurrentUserPlanet["id"] != $CurrentUser["current_planet"] && $CurrentUserPlanet['planet_type'] != 3) {
                    $Coloneshow++;
                    $AllPlanets .= "<th>" . $CurrentUserPlanet['name'] . "<br>";
                    $AllPlanets .= "<a href=\"game.php?page=overview&cp=" . $CurrentUserPlanet['id'] . "&re=0\" title=\"" . $CurrentUserPlanet['name'] . "\"><img src=\"" . $dpath . "planeten/small/s_" . $CurrentUserPlanet['image'] . ".jpg\" height=\"50\" width=\"50\"></a><br>";
                    $AllPlanets .= "<center>";
                    if ($CurrentUserPlanet['b_building'] != 0) {
                        UpdatePlanetBatimentQueueList($CurrentUserPlanet, $CurrentUser);
                        if ($CurrentUserPlanet['b_building'] != 0) {
                            $BuildQueue = $CurrentUserPlanet['b_building_id'];
                            $QueueArray = explode(";", $BuildQueue);
                            $CurrentBuild = explode(",", $QueueArray[0]);
                            $BuildElement = $CurrentBuild[0];
                            $BuildLevel = $CurrentBuild[1];
                            $BuildRestTime = pretty_time($CurrentBuild[3] - time());
                            $AllPlanets .= '' . $lang['tech'][$BuildElement] . ' (' . $BuildLevel . ')';
                            $AllPlanets .= "<br><font color=\"#7f7f7f\">(" . $BuildRestTime . ")</font>";
                        } else {
                            CheckPlanetUsedFields($CurrentUserPlanet);
                            $AllPlanets .= $lang['ov_free'];
                        }
                    } else {
                        $AllPlanets .= $lang['ov_free'];
                    }
                    $AllPlanets .= "</center></th>";
                    if ($Colone <= 1) {
                        $Colone++;
                    } else {
                        $AllPlanets .= "</tr><tr>";
                        $Colone = 1;
                    }
                }
            }
            $AllPlanets .= "</tr>";
            if ($lunarow['id'] != 0 && $lunarow['destruyed'] != 1 && $CurrentPlanet['planet_type'] != 3) {
                if ($CurrentPlanet['planet_type'] == 1 or $lunarow['id'] != 0) {
                    $moon = doquery("SELECT `id`,`name`,`image` FROM {{table}} WHERE `galaxy` = '" . $CurrentPlanet['galaxy'] . "' AND `system` = '" . $CurrentPlanet['system'] . "' AND `planet` = '" . $CurrentPlanet['planet'] . "' AND `planet_type` = '3'", 'planets', true);
                    $parse['moon_img'] = "<a href=\"game.php?page=overview&cp=" . $moon['id'] . "&re=0\" title=\"" . $moon['name'] . "\"><img src=\"" . $dpath . "planeten/" . $moon['image'] . ".jpg\" height=\"50\" width=\"50\"></a>";
                    $parse['moon'] = $moon['name'] . " (" . $lang['fcm_moon'] . ")";
                } else {
开发者ID:sonicmaster,项目名称:RPG,代码行数:67,代码来源:ShowOverviewPage.php


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