Esempio n. 1
0
<?php

require_once get_file_loc("smr_planet.inc");
if ($player->land_on_planet == "FALSE") {
    print_error("You are not on a planet!");
    return;
}
// create planet object
$planet = new SMR_PLANET($player->sector_id, $player->game_id);
$planet->build();
print_topic("PLANET : {$planet->planet_name} [SECTOR #{$player->sector_id}]");
include get_file_loc('menue.inc');
print_planet_menue();
if ($planet->build()) {
    $db->query("SELECT * FROM planet_build_construction NATURAL JOIN planet_construction " . "WHERE game_id = {$player->game_id} AND " . "sector_id = {$player->sector_id}");
    if ($db->next_record()) {
        $construction_name = $db->f("construction_name");
        $construction_id = $db->f("construction_id");
        $time_left = $db->f("time_complete") - time();
    }
    $hours = floor($time_left / 3600);
    $minutes = floor(($time_left - $hours * 3600) / 60);
    $seconds = $time_left - $hours * 3600 - $minutes * 60;
    print "<p>You are currently building: {$construction_name}.<br>";
    print "Finished in ";
    if ($hours > 0) {
        if ($hours == 1) {
            print "{$hours} hour";
        } else {
            print "{$hours} hours";
        }
Esempio n. 2
0
<?php

require_once get_file_loc("smr_planet.inc");
if ($player->land_on_planet == "FALSE") {
    print_error("You are not on a planet!");
    return;
}
// create planet object
$planet = new SMR_PLANET($player->sector_id, $player->game_id);
$planet->build();
print_topic("PLANET : {$planet->planet_name} [SECTOR #{$player->sector_id}]");
include get_file_loc('menue.inc');
print_planet_menue();
//print the dump cargo message or other message.
if (isset($var["msg"])) {
    print $var["msg"] . "<br>";
}
print "<table cellspacing=\"0\" cellpadding=\"3\" border=\"0\" class=\"standard\">";
print "<tr>";
print "<th width=\"125\">&nbsp;</th>";
print "<th width=\"75\">Current</th>";
print "<th width=\"75\">Max</th>";
print "</tr>";
print "<tr>";
print "<td>Generator</td><td align=\"center\">";
print $planet->construction[1];
print "</td><td align=\"center\">";
print $planet->max_construction[1];
print "</td>";
print "</tr>";
print "<tr>";
<?php

require_once get_file_loc("smr_planet.inc");
$planet = new SMR_PLANET($player->sector_id, $player->game_id);
$action = $_REQUEST['action'];
if ($action == "Build") {
    if ($planet->build()) {
        create_error("There is already a building in progress!");
    }
    $player->credits -= $var["cost"];
    $player->update();
    // now start the construction
    $planet->start_construction($var["construction_id"]);
    $db->query("SELECT * FROM planet_construction WHERE construction_id = " . $var["construction_id"]);
    $db->next_record();
    $name = $db->f("construction_name");
    $account->log(11, "Player starts a {$name} on planet.", $player->sector_id);
} elseif ($action == "Cancel") {
    $db->query("DELETE FROM planet_build_construction WHERE sector_id = {$player->sector_id} AND game_id = {$player->game_id}");
    $account->log(11, "Player cancels planet construction", $player->sector_id);
}
forward(create_container("skeleton.php", "planet_construction.php"));