示例#1
0
<?php

include "connect.php";
for ($i = 0; $i <= 5; $i++) {
    $abfrage = mysql_query("SELECT * FROM schiffe WHERE besitzer=4 AND energie>0 AND typ='s'");
    while ($s = mysql_fetch_array($abfrage)) {
        $sid = $s["id"];
        $schiff = new schiff();
        $schiff->getData($sid);
        $wert = rand(0, 3);
        echo 'Schiff; ', $schiff->name, ' (', $schiff->id, ') bewegt sich von ', $schiff->x, '|', $schiff->y, ' nach ';
        if ($wert == 0 && $schiff->x > 1) {
            $schiff->energie--;
            $schiff->x--;
        }
        if ($wert == 1 && $schiff->y > 1) {
            $schiff->energie--;
            $schiff->y--;
        }
        if ($wert == 2) {
            $schiff->energie--;
            $schiff->x++;
        }
        if ($wert == 3) {
            $schiff->energie--;
            $schiff->y++;
        }
        echo $schiff->x, '|', $schiff->y;
        $schiff->setData($schiff->id);
        $abfrage2 = mysql_query("SELECT * FROM schiffe WHERE x='{$schiff->x}' AND y='{$schiff->y}' AND typ!='s'");
        while ($s2 = mysql_fetch_array($abfrage2)) {
<?php

$inhalt = array("rohstoffa", "rohstoffb", "rohstoffc", "rohstoffd", "isochips", "tritanium", "dili", "antimaterie", "deuterium");
include "connect.php";
$result = mysql_query("SELECT * FROM schiffe WHERE typ='m' AND besitzer!=2");
while ($row = mysql_fetch_array($result)) {
    $pid = $row["id"];
    $valuestring = "";
    $schiff = new schiff();
    $schiff->getData($row["id"]);
    for ($i = 0; $i < sizeof($inhalt); $i++) {
        if ($i != sizeof($inhalt) - 1) {
            $valuestring .= "'{$inhalt[$i]}',";
        }
        if ($i == sizeof($inhalt) - 1) {
            $valuestring .= "'{$inhalt[$i]}'";
        }
    }
    $firststring = "";
    for ($i = 0; $i < sizeof($inhalt); $i++) {
        if ($i != sizeof($inhalt) - 1) {
            $firststring .= "{$inhalt},";
        }
        if ($i < sizeof($inhalt) - 1) {
            $firststring .= $inhalt;
        }
    }
    mysql_query("INSERT INTO planetenlog (pid,{$firststring}) VALUES ('{$pid}',{$valuestring})") or die(mysql_error());
}
示例#3
0
if (!isset($testid)) {
    $testid = $_GET["pid"];
}
$tmp = mysql_query("SELECT besitzer FROM schiffe WHERE id='{$testid}'");
while ($testtmp = mysql_fetch_array($tmp)) {
    if ($_SESSION["Id"] != $testtmp["besitzer"]) {
        $betray = true;
    }
}
if ($betray && $testid > 0) {
    echo 'Du bist nicht eingeloggt oder du versucht auf fremde Accounts zuzugreifen...';
} else {
    //CHEATSCHUTZ ENDE
    $fromid = $_GET["from"];
    $toid = $_GET["to"];
    $from = new schiff();
    $from->getData($fromid);
    $to = new schiffgeneral();
    $to->getData($toid);
    //daten geholt ^^^^^
    $do = $_POST["do"];
    if ($from->y != $to->y || $from->x != $to->x) {
        echo '<span style="color:red;">Hinweis: Ziel ist nicht im Sektor! kein Vorgang m&ouml;glich!</span><br />';
        $do = -1;
    }
    if ($to->schildstatus == 1 && $schiff->besitzer != $_SESSION["Id"]) {
        echo '<span style="color:yellow;">Ziel hat Schilde aktiviert! Beamen nicht m&ouml;glich.</span><br />';
        $do = -1;
    }
    if ($do == 1) {
        //beamen!
示例#4
0
                 $tplanet->energie -= 7;
                 $tplanet->rohstoffb += 5;
                 $tplanet->rohstoffc -= 5;
             }
         }
         $tfeld->setData($tpid);
         $tplanet->setData($tpid);
         $tfeld->getData($tpid);
         $tplanet->getData($tpid);
     }
 }
 //ISO berechnung
 $abfrage = mysql_query("SELECT schiffe.id FROM schiffe, planet2 WHERE schiffe.besitzer !=2 AND schiffe.id = planet2.pid");
 while ($row = mysql_fetch_array($abfrage)) {
     $tpid = $row["id"];
     $tplanet = new schiff();
     $tplanet->getData($tpid);
     $tfeld = new planetfeld();
     $tfeld->getData($tpid);
     for ($i = 1; $i <= 50; $i++) {
         $amount = 0;
         $aktfeld = 'feld' . $i;
         splitfeld($tfeld->{$aktfeld}, $a, $b, $c);
         if ($b == 0) {
             if ($a == 21 && $tplanet->energie >= 10 && $tplanet->rohstoffa >= 40 && $tplanet->rohstoffb >= 30 && $tplanet->antimaterie >= 4 && $tplanet->dili >= 2) {
                 $tplanet->energie -= 10;
                 $tplanet->rohstoffb -= 30;
                 $tplanet->rohstoffa -= 40;
                 $tplanet->antimaterie -= 4;
                 $tplanet->dili -= 2;
                 $tplanet->isochips += 1;
示例#5
0
    $betray = true;
}
if (!ctype_digit($fid)) {
    $betray = true;
}
$tmp = mysql_query("SELECT besitzer FROM schiffe WHERE id='{$pid}'");
while ($testtmp = mysql_fetch_array($tmp)) {
    if ($_SESSION["Id"] != $testtmp["besitzer"]) {
        $betray = true;
    }
}
if ($betray) {
    echo 'Du bist nicht eingeloggt oder du versucht auf fremde Accounts zuzugreifen...';
} else {
    //CHEATSCHUTZ ENDE
    $aktPlanet = new schiff($pid);
    //FELDNUMMER
    $feldnummer = "feld" . $fid;
    $aktFeld = mysql_query("SELECT {$feldnummer} FROM planet2 WHERE pid='{$pid}'");
    $aktFeld = mysql_fetch_array($aktFeld);
    $aktFeld = $aktFeld[0];
    splitfeld($aktFeld, $a, $b, $c, $d, $e);
    //ENDE FELD
    //aktiveren
    if ($_GET["do"] == 'cyk') {
        $continue = true;
        if ($e > 0 && $continue) {
            $newvar1 = $a . "-" . $b . "-" . $c . "-" . $d . "-0";
            $e = 0;
            $continue = false;
        }
            if ($neuesgebot > $gebot && $me->{$ebay}["rohstoff"] >= $neuesgebot || $bieter == $_SESSION["Id"] && $neuesgebot > $gebot && $gebot + $me->{$ebay}["rohstoff"] >= $neuesgebot) {
                $alterbieter = new konto();
                $alterbieter->getData($ebay["bieter"]);
                if ($ebay["bieter"] == $_SESSION["Id"]) {
                    $me->{$ebay}["rohstoff"] += $gebot;
                } else {
                    $alterbieter->{$ebay}["rohstoff"] += $gebot;
                }
                $me->{$ebay}["rohstoff"] -= $neuesgebot;
                echo '!!! ', $me->{$ebay}["rohstoff"];
                $me->setData($self);
                if ($ebay["bieter"] != $_SESSION["Id"]) {
                    $alterbieter->setData($bieter);
                }
                mysql_query("UPDATE sebay SET gebot='{$neuesgebot}',bieter='{$self}' WHERE id='{$handelid}'");
            } else {
                echo 'Du musst mindestens 1 mehr bieten als der Vorherige UND die entsprechende Ware auf deinem Warenkonto haben!<br />';
            }
        }
    }
    echo '<h3>Schiffsversteigerung</h3>Hier findest du Angebote auf die du bieten kannst, m&ouml;chtest du selber ein Schiff versteigern, scrolle bitte nach unten f&uuml;r weitere Informationen.<br /><br />';
    echo '<table class="bordered"><tr><td>Bild</td><td>Klasse</td><td>Position</td><td>Verk&auml;ufer</td><td>Zahlungsmittel</td><td>Gebot</td><td>B</td><td>Ende</td></tr>';
    $sebayresult = mysql_query("SELECT * FROM sebay ORDER BY id DESC");
    while ($ebay = mysql_fetch_array($sebayresult)) {
        $schiff = new schiff();
        $schiff->getData($ebay["sid"]);
        echo '<tr><td><a href="sebay2.php?aid=', $ebay["id"], '" onmouseover="Tip(sebay)" onmouseout="UnTip()"><img src="', $schiff->img, '" border="0" /></a></td><td>', $schiff->klasse, '</td><td>', $schiff->x, '|', $schiff->y, '</td><td>', id2name($schiff->besitzer), '</td><td>', $inhaltcap[array_search($ebay["rohstoff"], $inhalt)], '</td><td>', $ebay["gebot"], ' (', id2name($ebay["bieter"]), ')</td><td><a href="sebay2.php?aid=', $ebay["id"], '">bieten</a></td><td>', gerdatum($ebay["ende"]), '</td></tr>';
    }
    echo '</table><br /><br /><h3> Angebot einstellen </h3>(noch nicht freigegeben)';
}
include "foot.php";
示例#7
0
<?php

include "connect.php";
for ($i = 0; $i <= 5; $i++) {
    $abfrage = mysql_query("SELECT * FROM schiffe WHERE besitzer=4 AND energie>0 AND typ='s' AND klasse='Drohne'");
    while ($s = mysql_fetch_array($abfrage)) {
        $sid = $s["id"];
        $schiff = new schiff($sid);
        $wert = rand(0, 3);
        echo 'Schiff; ', $schiff->name, ' (', $schiff->id, ') bewegt sich von ', $schiff->x, '|', $schiff->y, ' nach ';
        if ($wert == 0 && $schiff->x > 1) {
            $schiff->energie--;
            $schiff->x--;
        }
        if ($wert == 1 && $schiff->y > 1) {
            $schiff->energie--;
            $schiff->y--;
        }
        if ($wert == 2 && $schiff->x < 100) {
            $schiff->energie--;
            $schiff->x++;
        }
        if ($wert == 3 && $schiff->y < 100) {
            $schiff->energie--;
            $schiff->y++;
        }
        echo $schiff->x, '|', $schiff->y;
        $schiff->setData();
        $abfrage2 = mysql_query("SELECT * FROM schiffe WHERE x='{$schiff->x}' AND y='{$schiff->y}' AND typ!='s'");
        while ($s2 = mysql_fetch_array($abfrage2)) {
            echo '---->', $s2["typ"], ' ', id2name($s2["besitzer"]);