} } 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'; exit; } } } function gameTypeToText($type) { if ($type == 0) {
<?php /**/ include './header.php'; if (isset($_GET[id])) { $pid = escape_data($_GET[id]); //Make sure you own if (getPlanetStat(ownerid, $sid, $pid) != $id) { echo 'err'; exit; } } else { echo 'err'; exit; } if (isset($_POST['name'])) { $name = '' . escape_data($_POST['name']); setPlanetStat(name, $name, $sid, $pid); changePage('./planets.php'); } echo '<form action="./name.php?id=' . $pid . '" method="post"> <input type="text" name="name" value="' . getPlanetStat(name, $sid, $pid) . '"> <input type="Submit" value="Change">'; include './footer.php';
//Check if it is already probing if (getFleetStat(probes, $sid, $fid) > 0) { echo 'This fleets probes are already launched.'; } else { setFleetStat(probes, $pid, $sid, $fid); $traveltime = travelTime($sid, getFleetStat(loc, $sid, $fid), $pid, $id); setFleetStat(probetime, $traveltime, $sid, $fid); echo 'You have sent your probes.<br>'; } } //See if the person owns the planet 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);
<?php /**/ include './header.php'; if (isset($_GET[id])) { $fid = escape_data($_GET[id]); //Make sure you own if (getFleetStat(ownerid, $sid, $fid) != $id) { echo 'err'; exit; } } else { echo 'err'; exit; } if (isset($_POST['name'])) { $name = '' . escape_data($_POST['name']); setFleetStat(name, $name, $sid, $fid); changePage('./fleet.php'); } echo '<form action="./fname.php?id=' . $fid . '" method="post"> <input type="text" name="name" value="' . getFleetStat(name, $sid, $fid) . '"> <input type="Submit" value="Change">'; include './footer.php';