Ejemplo n.º 1
0
$query = "SELECT id,s1,s2 FROM users WHERE s1={$sid} OR s2={$sid}";
$result = mysql_query($query);
while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
    for ($x = 1; $x < getMaxServer() + 1; $x++) {
        $str = 's' . $x;
        $number = getUserStat($str, $row[id]);
        if ($number == $sid) {
            $number = $x;
            break;
        }
    }
    $str = 'points' . $number;
    $points = getUserStat($str, $row[id]);
    $arr[$row[id]] = $points;
}
arsort($arr);
foreach ($arr as $key => $val) {
    if ($count > 100) {
        break;
    }
    $count++;
    echo '<tr>
      <td>' . $count . '.</td>
      <td><a href="./profile.php?id=' . $key . '">' . getUserStat(username, $key) . '</a></td>
      <td>' . $val . '</td>
      </tr>';
}
echo '</table>';
include './footer.php';
?>
  
Ejemplo n.º 2
0
var color=1;

function changeColor(x){
  color = x;
}';
while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
    //Create a system object for each item in db
    $pid = $row[ownerpid];
    if ($pid != 0) {
        $name = getPlanetStat(name, $sid, $pid);
    } else {
        $name = 'None';
    }
    //Get the players color if applicable
    if ($pid > 0) {
        $color = getUserStat(color, getPlanetStat(ownerid, $sid, $pid));
    } else {
        $color = -1;
    }
    //1 = RED
    //2 = YELLOW
    //3 = GREEN
    $enemy = 0;
    $query2 = "SELECT ownerid FROM planets{$sid} WHERE z=" . $row[id];
    $result2 = mysql_query($query2);
    while ($row2 = mysql_fetch_array($result2, MYSQL_ASSOC)) {
        echo '//' . $row2[ownerid] . '
   ';
        if ($row2[ownerid] != 0) {
            if ($row2[ownerid] != $id) {
                if ($enemy == 3) {
Ejemplo n.º 3
0
    }
    if ($row[visible] && !$printed) {
        echo '<tr>
        <td>' . $row[name] . '</td>
        <td>' . $row[disc] . '</td>
        <td>' . $row[points] . '</td>
        <td></td>
      </tr>';
    }
    $printed = false;
}
echo '</table></div>';
//Create the invite
if ($uid == $id) {
    echo '<div id="4" style="display:none"><u>Invite Key</u><br><br>
    Your invite key is <b>' . getUserStat(invitekey, $id) . '</b><br><br> URL: <b>http://www.playconquest.com/register.php?key=' . getUserStat(invitekey, $id) . '</b>
  </div>';
} else {
    echo '<div id="4"></div>';
}
//Create the image upload and profile edit.
echo '<div id="5" style="display:none"><u>Edit Profile</u><br><br>';
if ($uid == $id) {
    echo '<form action="./profile.php?id=' . $uid . '" method="post"  enctype="multipart/form-data"><table cellspacing=5>
      <tr>
        <td></td>
        <td>Profile Picture [must be .jpg and < 5mb]</td>
        <td><input type="file" name="file"></td>
      </tr><tr>
        <td></td>
        <td></td>
Ejemplo n.º 4
0
             }
         }
         for ($x = 1; $x < sizeof($ashiparray) + 1; $x++) {
             $str = "ship" . $x;
             setFleetStat($str, $ashiparray[$x], $sid, $afid);
         }
     }
     //The planet was conquered so change owner
     setPlanetStat(ownerid, getFleetStat(ownerid, $sid, $afid), $sid, $dpid);
     setPlanetStat(lastshipq, 0, $sid, $dpid);
     $query = "DELETE FROM shipq{$sid} WHERE pid={$dpid}";
     $result = @mysql_query($query);
 } else {
     //Destroy losers fleet
     $endstr1 = 'You attacked <a href="./planetdetails.php?id=' . $dpid . '">' . getPlanetStat(name, $sid, $dpid) . '</a> with the fleet ' . getFleetStat(name, $sid, $afid) . '. Your attack lost with ' . $attack . ' attack to ' . $defence . ' defence.';
     $endstr2 = 'Your planet <a href="./planetdetails.php?id=' . $dpid . '">' . getPlanetStat(name, $sid, $dpid) . '</a> was attacked by <a href="./profile.php?id=' . $aplayerid . '">' . getUserStat(username, $aplayerid) . '</a>. You defended with ' . $defence . ' defense to ' . $attack . ' attack.';
     destroyFleet($sid, $afid);
     echo $endstr1;
     $tempdef = $attack;
     //For total dmg, do dmg to an attacking ship, if the saved dmg is enough to destroy the ship,
     //subtract it from the shiparraycounter then at the end update.
     //Check if the dmg is more than the hp of the fleet
     $dahp = calchp($sid, $dfid);
     echo $dahp;
     if ($dahp < $tempdef) {
         destroyFleet($sid, $dfid);
     } else {
         while ($tempdef > 1) {
             for ($x = 1; $x < sizeof($dshiparray) + 1; $x++) {
                 if ($dshiparray[$x] > 0) {
                     $tempdef = $tempdef - getShipStat(hp, $x);
Ejemplo n.º 5
0
<?php

/**/
include './db_connect.php';
if (isset($_GET[id])) {
    $id = (int) escape_data($_GET[id]);
    $vote = getUserStat(votes, $id);
    $vote++;
    $query = "UPDATE users SET votes={$vote} WHERE id={$id}";
    $result = @mysql_query($query);
}
Ejemplo n.º 6
0
if (getPlanetStat(ownerid, $sid, $pid) == $id) {
    if ($goer) {
        changePage('./build.php?id=' . $pid . '&err=' . $goer);
    } else {
        changePage('./build.php?id=' . $pid);
    }
    include './footer.php';
    exit;
}
/************
PRINT PLANET DETAILS HEADER
**************/
//Get owner name
$ownerid = getPlanetStat(ownerid, $sid, $pid);
if ($ownerid > 0) {
    $name = getUserStat(username, $ownerid);
} else {
    $name = 'None';
}
$z = getPlanetStat(z, $sid, $pid);
$query = "SELECT name FROM galaxy{$sid} WHERE id={$z}";
$result = mysql_query($query);
$row = mysql_fetch_array($result);
$gname = $row[0];
echo '
  <table cellspacing=5 align="center">
    <tr>
      <td></td>
    <td><b>Galaxy</b></td>
      <td><b>Name</b></td>
      <td><b>Owner</b></td>
Ejemplo n.º 7
0
             $string = "s" . $x;
             $serverid = getUserStat($string, $id);
             if ($serverid == 0) {
                 $query = "UPDATE users SET {$string}={$sid} WHERE id={$id}";
                 $result = @mysql_query($query);
                 $bool = true;
                 break;
             }
         }
         if ($bool) {
             //Create a planet on this server
             $z = rand(1, getServerStat(maxz, $sid));
             $x = rand(0, 500);
             $y = rand(0, 500);
             $img = rand(1, 10);
             $name = getUserStat(username, $id);
             $query = "INSERT INTO planets{$sid}(name,x,y,z,landused,ownerid,img,starttime) VALUES('{$name}',{$x},{$y},{$z},1000,{$id},{$img}," . time() . ")";
             $result = @mysql_query($query);
             $query = "SELECT id FROM planets{$sid} WHERE ownerid={$id}";
             $result = mysql_query($query);
             $row = mysql_fetch_array($result);
             $_SESSION['sid'] = $sid;
             changePage('./build.php?id=' . $row[0]);
         } else {
             echo 'err';
             exit;
         }
     }
 } else {
     echo 'Sorry that server is full';
     include './footer.php';
Ejemplo n.º 8
0
<?php

require_once './www.playconquest.com/db_connect.php';
//include('./db_connect.php');
$servercount = getServerNumber();
for ($x = 1; $x < $servercount + 1; $x++) {
    $query = "SELECT ownerpid FROM galaxy{$x} WHERE ownerpid>0";
    $result = @mysql_query($query);
    $sid = $x;
    while ($row = mysql_fetch_array($result)) {
        $pid = $row[0];
        $id = getPlanetStat(ownerid, $sid, $pid);
        for ($y = 1; $y < getMaxServer() + 1; $y++) {
            $str = 's' . $y;
            $number = getUserStat($str, $id);
            if ($number == $sid) {
                $number = $y;
                break;
            }
        }
        $str = 'points' . $number;
        $points = getUserStat($str, $id);
        $points++;
        echo $str;
        $query2 = "UPDATE users SET {$str}={$points} WHERE id={$id}";
        $result2 = @mysql_query($query2);
    }
}
Ejemplo n.º 9
0
 $result = @mysql_query($query);
 $query = "TRUNCATE tech{$sid}";
 $result = @mysql_query($query);
 //Reset the Galaxy Table
 $query = "UPDATE galaxy{$sid} SET ownerpid=0";
 $result = @mysql_query($query);
 //Reset the serverlist
 $query = "UPDATE serverlist SET users=0,starttime=" . time() . " WHERE id={$sid}";
 $result = @mysql_query($query);
 //Reset the users table
 $query2 = "SELECT id,s1,s2 FROM users WHERE s1={$sid} OR s2={$sid}";
 $result2 = mysql_query($query2);
 while ($row2 = mysql_fetch_array($result2, MYSQL_ASSOC)) {
     for ($x = 1; $x < getMaxServer() + 1; $x++) {
         $str = 's' . $x;
         $number = getUserStat($str, $row2[id]);
         if ($number == $sid) {
             $number = $x;
             break;
         }
     }
     $query = "UPDATE users SET s{$number}=0, points{$number}=0, rp{$number}=0 WHERE id=" . $row2[id] . "";
     $result = @mysql_query($query);
 }
 //Populate the planets table
 for ($x = 1; $x < $row[maxz] + 1; $x++) {
     $query = "SELECT name FROM galaxy{$sid} WHERE id={$x}";
     $result = mysql_query($query);
     $row2 = mysql_fetch_array($result);
     $thename = $row2[0];
     $planetnum = rand(1, 5);
Ejemplo n.º 10
0
</script>

<center>
<br>
<a href="javascript:;" onClick="change(1)">Voting</a> | 
<a href="./board/">Forum</a> | 
<a href="./wiki/">Wiki</a>
</center><hr><Br>';
if (!isset($id)) {
    echo 'Error you must be logged in to vote!.';
}
echo '<div id="1">Invite Points ' . invitePoints($id) . '
  <table cellspacing=5>
  <tr>
    <td><b>Name</b></td>
    <td><b>Type</b></td>
    <td><b>Link</b></td>
    <td><b>IP Value</b></td>
  </tr><tr>
  <td>Player Invite</td>
  <td>Invite</td>
  <td>http://www.playconquest.com/register.php?key=' . getUserStat(invitekey, $id) . '</td>
  <td>1</td>
  </tr><tr>
  <td>BGL.com</td>
  <td>Vote</td>
  <td>
<a href="http://www.browsergamelist.com/vote.php?gid=105&id=' . $id . '" target="_blank" id="' . $id . '"><img src="http://www.browsergamelist.com/media/browsergamelist-vote2.png" alt="Vote now at BrowserGameList" title="Vote now at BrowserGameList" /></a></td>
  <td>.1</td>
  </tr></table></div>';
include './footer.php';
Ejemplo n.º 11
0
echo 'var systems = new Array();';
echo '
function system(id,name,img,x,y,owner,uname,ptype){
	this.x = x;
	this.y = y;
	this.id = id;
	this.name = name;
	this.owner = owner;
	this.ownername = uname;
	this.active = false;
	this.img = img;
	this.ptype = ptype;
}';
while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
    //Create a system object for each item in db
    echo 'systems[' . $counter . '] = new system(' . $row[id] . ',"' . $row[name] . '",' . $row[img] . ',' . $row[x] . ',' . $row[y] . ',' . $row[ownerid] . ',"' . getUserStat(username, getPlanetStat(ownerid, $sid, $row[id])) . '","' . getTypeStat(name, $row[img]) . '");';
    $counter++;
}
//end js declaration
//end js
echo '</script>';
//Print Canvas
echo '<canvas id="c"></canvas><script src="planet.js"></script>';
//Print the action menu
echo '<table cellspacing=5 cellpadding=5 align=center>
	</table>';
//Print the action menu
echo '<table cellspacing=5 cellpadding=5 align=center>
		<tr>
			<td><b>Name:</b></td>
			<td><div id="name"></div></td>
Ejemplo n.º 12
0
function invitePoints($id)
{
    $invites = getUserStat(invites, $id);
    $votes = getUserStat(votes, $id);
    if ($votes > 10) {
        $votes -= 10;
        $invites++;
        $query = "UPDATE users SET invites={$invites},votes={$votes} WHERE id={$id}";
        $result = @mysql_query($query);
    }
    return $invites . '.' . $votes;
}