message_defence_owner($db, $sector, "{$l_md_msgdownerb}");
            TEXT_GOTOMAIN();
            die;
        }
        break;
    case "retrieve":
        if ($defenceinfo['ship_id'] != $playerinfo['ship_id']) {
            echo "{$l_md_notyours}<br><br>";
            TEXT_GOTOMAIN();
            ?>
</div></div>
<?php 
            include "footer.php";
            die;
        }
        $quantity = stripnum($quantity);
        if ($quantity < 0) {
            $quantity = 0;
        }
        if ($quantity > $defenceinfo['quantity']) {
            $quantity = $defenceinfo['quantity'];
        }
        $torpedo_max = NUM_TORPEDOES($playerinfo['torp_launchers']) - $playerinfo['torps'];
        $fighter_max = NUM_FIGHTERS($playerinfo['computer']) - $playerinfo['ship_fighters'];
        if ($defenceinfo['defence_type'] == 'F') {
            if ($quantity > $fighter_max) {
                $quantity = $fighter_max;
            }
        }
        if ($defenceinfo['defence_type'] == 'M') {
            if ($quantity > $torpedo_max) {
Example #2
0
include("header.php");

if(checklogin())
{
  die();
}

//-------------------------------------------------------------------------------------------------
//$db->Execute("LOCK TABLES $dbtables[players] WRITE, $dbtables[ships] WRITE, $dbtables[universe] WRITE, $dbtables[bounty] WRITE, $dbtables[zones] READ, $dbtables[planets] WRITE, $dbtables[news] WRITE, $dbtables[logs] WRITE, $dbtables[ship_types] READ");
$result = $db->Execute ("SELECT * FROM $dbtables[players] WHERE email='$username'");
$playerinfo=$result->fields;
// Find out what my ship is
$res = $db->Execute("SELECT * FROM $dbtables[ships] WHERE player_id=$playerinfo[player_id] AND ship_id=$playerinfo[currentship] LIMIT 1");
$shipinfo = $res->fields;

$ship_id = stripnum($ship_id);

$res = $db->Execute("SELECT * FROM $dbtables[ship_types],$dbtables[ships] WHERE $dbtables[ship_types].type_id=$dbtables[ships].type AND  $dbtables[ships].ship_id=$ship_id LIMIT 1");
$targetshipinfo = $res->fields;
$result2 = $db->Execute ("SELECT * FROM $dbtables[players] WHERE player_id=$targetshipinfo[player_id]");
$targetinfo=$result2->fields;

$playerscore = gen_score($playerinfo[player_id]);
$targetscore = gen_score($targetinfo[player_id]);

//$playerscore = $playerscore * $playerscore;
//$targetscore = $targetscore * $targetscore;

bigtitle();

srand((double)microtime()*1000000);
Example #3
0
//  along with this program.  If not, see <http://www.gnu.org/licenses/>.
//
// File: corp.php
include "config/config.php";
updatecookie();
// New database driven language entries
load_languages($db, $lang, array('corp', 'common', 'global_includes', 'combat', 'footer', 'news'), $langvars, $db_logging);
$title = $l_corpm_title;
include "header.php";
if (checklogin()) {
    die;
}
$result = $db->Execute("SELECT * FROM {$db->prefix}ships WHERE ship_id='{$user_ship_id}'");
db_op_result($db, $result, __LINE__, __FILE__, $db_logging);
$playerinfo = $result->fields;
$planet_id = stripnum($planet_id);
$result2 = $db->Execute("SELECT * FROM {$db->prefix}planets WHERE planet_id={$planet_id}");
db_op_result($db, $result2, __LINE__, __FILE__, $db_logging);
if ($result2) {
    $planetinfo = $result2->fields;
}
if ($planetinfo['owner'] == $playerinfo['ship_id'] || $planetinfo['corp'] == $playerinfo['team'] && $playerinfo['team'] > 0) {
    ?>
<div class="tablecell content both-border">
	<div class="pad">
<?php 
    bigtitle();
    if ($action == "planetcorp") {
        echo $l_corpm_tocorp . "<br>";
        $result = $db->Execute("UPDATE {$db->prefix}planets SET corp='{$playerinfo['team']}', owner={$playerinfo['ship_id']} WHERE planet_id={$planet_id}");
        db_op_result($db, $result, __LINE__, __FILE__, $db_logging);
Example #4
0
     break;
 case 4:
     echo "Not implemented yet. Sorry! :)<br><br>";
     LINK_BACK();
     break;
 case 5:
     // Check if Co-ordinator of team.
     // If not display "An error occured, You are not the leader of this Team." message.
     // Then show link back and break;
     if (isTeamOwner($team, $playerinfo) == false) {
         $l_team_error = str_replace("[error]", "<strong><font color=red>An error occured</font></strong><br>", $l_team_error);
         echo $l_team_error;
         LINK_BACK();
         continue;
     } else {
         $who = stripnum($who);
         $result = $db->Execute("SELECT * FROM {$db->prefix}ships WHERE ship_id=?;", array($who));
         db_op_result($db, $result, __LINE__, __FILE__, $db_logging);
         $whotoexpel = $result->fields;
         if (is_null($confirmed)) {
             echo "{$l_team_ejectsure} {$whotoexpel['character_name']}? <a href=\"teams.php?teamwhat={$teamwhat}&confirmed=1&who={$who}\">{$l_yes}</a> - <a href=\"teams.php\">{$l_no}</a><br>";
         } else {
             // check whether the player we are ejecting might have already left in the meantime
             // should go here if ($whotoexpel[team] ==
             $resx = $db->Execute("UPDATE {$db->prefix}planets SET corp='0' WHERE owner=?;", array($who));
             db_op_result($db, $resx, __LINE__, __FILE__, $db_logging);
             $resy = $db->Execute("UPDATE {$db->prefix}ships SET team = '0' WHERE ship_id=?;", array($who));
             db_op_result($db, $resy, __LINE__, __FILE__, $db_logging);
             // No more necessary due to COUNT(*) in previous SQL statement
             $db->Execute("UPDATE {$db->prefix}teams SET number_of_members=number_of_members-1 WHERE id=?;", array($whotoexpel['team']));
             playerlog($db, $who, LOG_TEAM_KICK, $team['team_name']);
Example #5
0
            ?>
</div></div>
<?php 
            include "footer.php";
            die;
        }
        if ($playerinfo['turns'] < 1) {
            echo "{$l_by_noturn}<br><br>";
            TEXT_GOTOMAIN();
            ?>
</div></div>
<?php 
            include "footer.php";
            die;
        }
        $amount = stripnum($amount);
        if ($amount < 0) {
            echo "{$l_by_zeroamount}<br><br>";
            TEXT_GOTOMAIN();
            ?>
</div></div>
<?php 
            include "footer.php";
            die;
        }
        if ($bounty_on == $playerinfo['ship_id']) {
            echo "{$l_by_yourself}<br><br>";
            TEXT_GOTOMAIN();
            ?>
</div></div>
<?php 
Example #6
0
     echo "{$l_mines_info1}<br><br>";
     $l_mines_info2 = str_replace("[mines]", $availmines, $l_mines_info2);
     $l_mines_info2 = str_replace("[fighters]", $availfighters, $l_mines_info2);
     echo "You have {$availmines} mines and {$availfighters} fighters available to deploy.<br>\n";
     echo "<br />\n";
     echo "{$l_mines_deploy} <INPUT TYPE=TEXT NAME=nummines SIZE=10 MAXLENGTH=10 VALUE={$playerinfo['torps']}> {$l_mines}.<br>";
     echo "{$l_mines_deploy} <INPUT TYPE=TEXT NAME=numfighters SIZE=10 MAXLENGTH=10 VALUE={$playerinfo['ship_fighters']}> {$l_fighters}.<br>";
     echo "Fighter mode <INPUT TYPE=RADIO NAME=mode {$set_attack} VALUE=attack>{$l_mines_att}</INPUT>";
     echo "<INPUT TYPE=RADIO NAME=mode {$set_toll} VALUE=toll>{$l_mines_toll}</INPUT><br>";
     echo "<br />\n";
     echo "<INPUT TYPE=SUBMIT VALUE={$l_submit}><INPUT TYPE=RESET VALUE={$l_reset}><br><br>";
     echo "<input type=hidden name=op value={$op}>";
     echo "</FORM>";
 } else {
     $nummines = stripnum($nummines);
     $numfighters = stripnum($numfighters);
     if (empty($nummines)) {
         $nummines = 0;
     }
     if (empty($numfighters)) {
         $numfighters = 0;
     }
     if ($nummines < 0) {
         $nummines = 0;
     }
     if ($numfighters < 0) {
         $numfighters = 0;
     }
     if ($nummines > $playerinfo['torps']) {
         echo $l_mines_notorps . "<br>";
         $nummines = 0;