parent
7f50a261eb
commit
3d7bda9331
@ -0,0 +1,41 @@ |
||||
<?xml version="1.0" encoding="UTF-8"?> |
||||
<classpath> |
||||
<classpathentry kind="src" path="src"/> |
||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/> |
||||
<classpathentry kind="lib" path="lib/jinput.jar" sourcepath="lib/lwjgl-source-2.8.4.zip"> |
||||
<attributes> |
||||
<attribute name="org.eclipse.jdt.launching.CLASSPATH_ATTR_LIBRARY_PATH_ENTRY" value="Sector-game/lib"/> |
||||
</attributes> |
||||
</classpathentry> |
||||
<classpathentry kind="lib" path="lib/lwjgl_util.jar" sourcepath="lib/lwjgl-source-2.8.4.zip"> |
||||
<attributes> |
||||
<attribute name="org.eclipse.jdt.launching.CLASSPATH_ATTR_LIBRARY_PATH_ENTRY" value="Sector-game/lib"/> |
||||
</attributes> |
||||
</classpathentry> |
||||
<classpathentry kind="lib" path="lib/lwjgl.jar" sourcepath="lib/lwjgl-source-2.8.4.zip"> |
||||
<attributes> |
||||
<attribute name="org.eclipse.jdt.launching.CLASSPATH_ATTR_LIBRARY_PATH_ENTRY" value="Sector-game/lib"/> |
||||
</attributes> |
||||
</classpathentry> |
||||
<classpathentry kind="lib" path="lib/slick-util.jar" sourcepath="lib/slick-util-src.zip"> |
||||
<attributes> |
||||
<attribute name="org.eclipse.jdt.launching.CLASSPATH_ATTR_LIBRARY_PATH_ENTRY" value="Sector-game/lib"/> |
||||
</attributes> |
||||
</classpathentry> |
||||
<classpathentry kind="lib" path="lib/jogg-0.0.7.jar"> |
||||
<attributes> |
||||
<attribute name="org.eclipse.jdt.launching.CLASSPATH_ATTR_LIBRARY_PATH_ENTRY" value="Sector-game/lib"/> |
||||
</attributes> |
||||
</classpathentry> |
||||
<classpathentry kind="lib" path="lib/jorbis-0.0.15.jar"> |
||||
<attributes> |
||||
<attribute name="org.eclipse.jdt.launching.CLASSPATH_ATTR_LIBRARY_PATH_ENTRY" value="Sector-game/lib"/> |
||||
</attributes> |
||||
</classpathentry> |
||||
<classpathentry kind="lib" path="lib/jdom-2.0.3.jar" sourcepath="lib/jdom-2.0.3-sources.zip"/> |
||||
<classpathentry kind="lib" path="lib/httpclient-4.2.2.jar" sourcepath="lib/httpcomponents-client-4.2.2-src.zip"/> |
||||
<classpathentry kind="lib" path="lib/httpcore-4.2.2.jar" sourcepath="lib/httpcomponents-client-4.2.2-src.zip"/> |
||||
<classpathentry kind="lib" path="lib/commons-io-2.4.jar" sourcepath="lib/commons-io-2.4-src.zip"/> |
||||
<classpathentry kind="lib" path="lib/commons-logging-1.1.1.jar"/> |
||||
<classpathentry kind="output" path="bin"/> |
||||
</classpath> |
@ -0,0 +1,2 @@ |
||||
/bin/ |
||||
*~ |
@ -0,0 +1,17 @@ |
||||
<?xml version="1.0" encoding="UTF-8"?> |
||||
<projectDescription> |
||||
<name>Sector-game</name> |
||||
<comment></comment> |
||||
<projects> |
||||
</projects> |
||||
<buildSpec> |
||||
<buildCommand> |
||||
<name>org.eclipse.jdt.core.javabuilder</name> |
||||
<arguments> |
||||
</arguments> |
||||
</buildCommand> |
||||
</buildSpec> |
||||
<natures> |
||||
<nature>org.eclipse.jdt.core.javanature</nature> |
||||
</natures> |
||||
</projectDescription> |
@ -0,0 +1,11 @@ |
||||
eclipse.preferences.version=1 |
||||
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled |
||||
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 |
||||
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve |
||||
org.eclipse.jdt.core.compiler.compliance=1.6 |
||||
org.eclipse.jdt.core.compiler.debug.lineNumber=generate |
||||
org.eclipse.jdt.core.compiler.debug.localVariable=generate |
||||
org.eclipse.jdt.core.compiler.debug.sourceFile=generate |
||||
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error |
||||
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error |
||||
org.eclipse.jdt.core.compiler.source=1.6 |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -0,0 +1,390 @@ |
||||
<?php |
||||
class DbUtil{ |
||||
public static function registerNewUser($name, $password, $email = "", $country = ""){ |
||||
$name = mysql_real_escape_string($name); |
||||
$password = mysql_real_escape_string($password); |
||||
$country = mysql_real_escape_string($country); |
||||
$email = mysql_real_escape_string($email); |
||||
|
||||
$result = self::query("SELECT COUNT(*) FROM `SECTOR_USERS` WHERE `name` = '$name';"); |
||||
$rows=0; |
||||
list($rows) = mysql_fetch_row($result); |
||||
if($rows != 0){ |
||||
XmlGen::error_exit("REGISTRATION_FAILED","Entered name is already taken."); |
||||
} |
||||
|
||||
$uid = ""; |
||||
while(true){ |
||||
$uid = "U-".Util::uniqueString(12); |
||||
$result = self::query("SELECT COUNT(*) FROM `SECTOR_USERS` WHERE `uid` = '$uid' AND `removed` = '0';"); |
||||
$row = mysql_fetch_row($result); |
||||
if($row[0] == 0) break; |
||||
} |
||||
|
||||
$time = time(); |
||||
|
||||
self::query(" |
||||
INSERT |
||||
INTO `SECTOR_USERS` |
||||
(`uid`,`name`,`password`,`email`,`reg_time`,`country`) |
||||
VALUES |
||||
('$uid','$name','$password','$email','$time','$country'); |
||||
"); |
||||
|
||||
self::refreshLogin($uid); |
||||
|
||||
exit(); |
||||
} |
||||
/* |
||||
$_REQUEST["uid"], |
||||
$_REQUEST["name"], |
||||
$_REQUEST["password"], |
||||
$_REQUEST["email"], |
||||
$_REQUEST["country"] |
||||
*/ |
||||
|
||||
public static function deleteProfile($uid){ |
||||
|
||||
$u = mysql_real_escape_string($uid); |
||||
self::query("UPDATE `SECTOR_USERS` SET `removed`='1' WHERE `uid` = '$u' LIMIT 1;"); |
||||
self::query("UPDATE `SECTOR_SCORES` SET `removed`='1' WHERE `uid` = '$u';"); |
||||
|
||||
// self::query("DELETE FROM `SECTOR_USERS` WHERE `uid` = '$u' LIMIT 1;"); |
||||
// self::query("DELETE FROM `SECTOR_SCORES` WHERE `uid` = '$u';"); |
||||
|
||||
echo XmlGen::deleteMessage(); |
||||
|
||||
exit(); |
||||
} |
||||
|
||||
|
||||
|
||||
public static function modifyProfile($uid,$name,$password,$email,$country){ |
||||
|
||||
if($name == null && $password == null && $email == null && $country == null){ |
||||
XmlGen::error_exit("INCOMPLETE_COMMAND","Nothing to change."); |
||||
} |
||||
|
||||
$n = mysql_real_escape_string($name); |
||||
$u = mysql_real_escape_string($uid); |
||||
$result = self::query("SELECT COUNT(*) FROM `SECTOR_USERS` WHERE `name` = '$n' AND `uid` != '$u';"); |
||||
$rows=0; |
||||
list($rows) = mysql_fetch_row($result); |
||||
if($rows != 0){ |
||||
XmlGen::error_exit("NAME_NOT_UNIQUE"); |
||||
} |
||||
|
||||
|
||||
$sql = ""; |
||||
|
||||
if($name != null){ |
||||
$sql .= ",`name` = '".mysql_real_escape_string($name)."'"; |
||||
} |
||||
|
||||
if($password != null){ |
||||
$sql .= ",`password` = '".mysql_real_escape_string($password)."'"; |
||||
} |
||||
|
||||
if($email == null) $email = ""; |
||||
|
||||
$sql .= ",`email` = '".mysql_real_escape_string($email)."'"; |
||||
|
||||
|
||||
if($country == null) $country = ""; |
||||
|
||||
$sql .= ",`country` = '".mysql_real_escape_string($country)."'"; |
||||
|
||||
|
||||
$sql = substr($sql,1); |
||||
|
||||
self::query(" |
||||
UPDATE `SECTOR_USERS` |
||||
SET $sql |
||||
WHERE `uid` = '$uid' |
||||
LIMIT 1; |
||||
"); |
||||
|
||||
self::refreshLogin($uid); |
||||
|
||||
exit(); |
||||
} |
||||
|
||||
public static function logIn($name, $passwordHash){ |
||||
$name = mysql_real_escape_string(trim($name)); |
||||
|
||||
$result = self::query("SELECT `uid`,`password` FROM `SECTOR_USERS` WHERE `name` = '$name' AND `removed` = '0';"); |
||||
|
||||
if(mysql_num_rows($result) == 0){ |
||||
XmlGen::error_exit("LOGIN_FAILED","Bad name or password."); |
||||
} |
||||
|
||||
$row = mysql_fetch_assoc($result); |
||||
$dbPwd = $row['password']; |
||||
$uid = $row['uid']; |
||||
|
||||
// double hash with ugly salt! |
||||
if( Util::calcSecureHash($name,$dbPwd) != $passwordHash){ |
||||
XmlGen::error_exit("LOGIN_FAILED","Bad name or password."); |
||||
} |
||||
|
||||
self::refreshLogin($uid); |
||||
|
||||
exit(); |
||||
} |
||||
|
||||
public static function isTokenValid($uid, $token){ |
||||
$uid = mysql_real_escape_string($uid); |
||||
$result = self::query("SELECT `auth_token` FROM `SECTOR_USERS` WHERE `uid` = '$uid' AND `removed` = '0';"); |
||||
|
||||
if(mysql_num_rows($result) == 0){ |
||||
return false; // bad UID |
||||
} |
||||
|
||||
$row = mysql_fetch_array($result); |
||||
return $row[0] == $token; |
||||
} |
||||
|
||||
public static function getInfo(){ |
||||
|
||||
$result = self::query("SELECT * FROM `SECTOR_INFO`;"); |
||||
|
||||
$entries = array(); |
||||
|
||||
while($row = mysql_fetch_row($result)){ |
||||
$entries[$row[0]] = $row[1]; |
||||
} |
||||
|
||||
$version = $entries['VERSION_NUMBER']+0; |
||||
|
||||
if($_REQUEST["VERSION"]<=$version){ |
||||
// only publicly available releases are counted, |
||||
// not prepared ones with higher version number |
||||
|
||||
// add to counter. |
||||
$midnight = strtotime('midnight'); |
||||
|
||||
$result = self::query("SELECT COUNT(*) FROM `SECTOR_COUNTER` WHERE `date` = '$midnight';"); |
||||
$row = mysql_fetch_array($result); |
||||
if($row[0] == 0){ |
||||
self::query("INSERT INTO `SECTOR_COUNTER`(`date`,`visits`) VALUES ('$midnight','1');"); |
||||
}else{ |
||||
self::query("UPDATE `SECTOR_COUNTER` SET `visits`=`visits`+1 WHERE `date` = '$midnight' LIMIT 1;"); |
||||
} |
||||
} |
||||
|
||||
echo XmlGen::infoTable($entries); |
||||
|
||||
exit(); |
||||
} |
||||
|
||||
public static function getUsers(){ |
||||
|
||||
$result = self::query("SELECT `name`,`reg_time`,`country` FROM `SECTOR_USERS` WHERE `removed` = '0';"); |
||||
|
||||
$entries = array(); |
||||
|
||||
while($row = mysql_fetch_array($result)){ |
||||
$entries[] = $row; |
||||
} |
||||
|
||||
echo XmlGen::userList($entries); |
||||
|
||||
exit(); |
||||
} |
||||
|
||||
|
||||
public static function getLevels(){ |
||||
|
||||
$result = self::query("SELECT `value` FROM `SECTOR_INFO` WHERE `key` = 'LEVELS_PATH';"); |
||||
$row = mysql_fetch_array($result); |
||||
$path = $row[0]; |
||||
|
||||
|
||||
$result = self::query("SELECT `lid`,`title`,`filename`,`checksum`,`time` FROM `SECTOR_LEVELS` WHERE `removed` = '0';"); |
||||
|
||||
$entries = array(); |
||||
|
||||
while($row = mysql_fetch_array($result)){ |
||||
$row[2] = $path.$row[2]; |
||||
$entries[] = $row; |
||||
} |
||||
|
||||
echo XmlGen::levelList($entries); |
||||
|
||||
exit(); |
||||
} |
||||
|
||||
public static function getLevelScores($lid, $changeFlag = null, $lastRecord = null){ |
||||
$lid = mysql_real_escape_string($lid); |
||||
|
||||
$result = self::query("SELECT COUNT(*) FROM `SECTOR_LEVELS` WHERE `lid` = '$lid' AND `removed` = '0';"); |
||||
$row = mysql_fetch_array($result); |
||||
$cnt = $row[0]; |
||||
|
||||
if($cnt==0) XmlGen::error_exit("NO_SUCH_LEVEL","No level with matching ID was found."); |
||||
|
||||
$result = self::query(" |
||||
SELECT |
||||
`SECTOR_USERS`.`name` AS `username`, |
||||
`SECTOR_SCORES`.`uid`, |
||||
`SECTOR_SCORES`.`time`, |
||||
`SECTOR_SCORES`.`score` |
||||
FROM `SECTOR_SCORES` JOIN `SECTOR_USERS` |
||||
WHERE |
||||
(`SECTOR_SCORES`.`uid` = `SECTOR_USERS`.`uid`) |
||||
AND (`lid`='$lid') |
||||
AND (`SECTOR_SCORES`.`removed` = '0') |
||||
ORDER BY `score` DESC, `time` DESC; |
||||
"); |
||||
|
||||
// username, uid, time, score |
||||
$entries = array(); |
||||
|
||||
while($row = mysql_fetch_array($result)){ |
||||
$entries[] = $row; |
||||
} |
||||
|
||||
echo XmlGen::scoreList($lid, $entries, $changeFlag, $lastRecord); |
||||
|
||||
exit(); |
||||
} |
||||
|
||||
public static function submitScore($uid, $lid, $score){ |
||||
$lid = mysql_real_escape_string($lid); |
||||
$uid = mysql_real_escape_string($uid); |
||||
$score = $score+0; |
||||
|
||||
$result = self::query("SELECT COUNT(*) FROM `SECTOR_LEVELS` WHERE `lid` = '$lid' AND `removed` = '0';"); |
||||
$row = mysql_fetch_array($result); |
||||
$cnt = $row[0]; |
||||
|
||||
if($cnt==0) XmlGen::error_exit("NO_SUCH_LEVEL","No level with matching ID was found."); |
||||
|
||||
|
||||
$result = self::query("SELECT COUNT(*) FROM `SECTOR_SCORES` WHERE `lid` = '$lid' AND `uid` = '$uid';"); |
||||
$row = mysql_fetch_array($result); |
||||
$cnt = $row[0]; |
||||
|
||||
$time = time(); |
||||
|
||||
$change = "false"; |
||||
$lastRecord = "-1"; |
||||
|
||||
if($cnt==0){ |
||||
// INSERT |
||||
self::query("INSERT INTO `SECTOR_SCORES`(`uid`,`lid`,`time`,`score`) VALUES ('$uid','$lid','$time','$score');"); |
||||
$change = "true"; |
||||
}else{ |
||||
$result = self::query("SELECT `score` FROM `SECTOR_SCORES` WHERE `lid` = '$lid' AND `uid` = '$uid';"); |
||||
$row = mysql_fetch_array($result); |
||||
$scoreOld = $row[0]; |
||||
|
||||
$lastRecord = "$scoreOld"; |
||||
if($scoreOld > $score){ |
||||
|
||||
}else{ |
||||
// UPDATE |
||||
self::query("UPDATE `SECTOR_SCORES` SET `time`='$time', `score`='$score' WHERE `lid` = '$lid' AND `uid` = '$uid' LIMIT 1;"); |
||||
if($scoreOld != $score) $change = "true"; |
||||
} |
||||
} |
||||
|
||||
self::getLevelScores($lid, $change, $lastRecord); |
||||
|
||||
exit(); |
||||
} |
||||
|
||||
public static function refreshLogin($uid){ |
||||
$token = Util::uniqueString(20); |
||||
|
||||
self::query(" |
||||
UPDATE `SECTOR_USERS` |
||||
SET `auth_token` = '$token' |
||||
WHERE `uid` = '$uid' |
||||
LIMIT 1; |
||||
"); |
||||
|
||||
$result = self::query("SELECT `name`,`email`,`reg_time`,`country` FROM `SECTOR_USERS` WHERE `uid` = '$uid';"); |
||||
|
||||
$row = mysql_fetch_assoc($result); |
||||
|
||||
$name = $row["name"]; |
||||
$email = $row["email"]; |
||||
$reg_time = $row["reg_time"]; |
||||
$country = $row["country"]; |
||||
|
||||
echo XmlGen::sessionInfo($uid, $token, $name, $email, $reg_time, $country); |
||||
} |
||||
|
||||
|
||||
|
||||
public static function addLevel($title, $filename){ |
||||
|
||||
$result = self::query("SELECT COUNT(*) FROM `SECTOR_LEVELS` WHERE `filename` = '".mysql_real_escape_string($filename)."';"); |
||||
$row = mysql_fetch_array($result); |
||||
$cnt = $row[0]; |
||||
|
||||
if($cnt>0) XmlGen::error_exit("LEVEL_ALREADY_ADDED"); |
||||
|
||||
$result = self::query("SELECT COUNT(*) FROM `SECTOR_LEVELS` WHERE `title` = '".mysql_real_escape_string($title)."';"); |
||||
$row = mysql_fetch_array($result); |
||||
$cnt = $row[0]; |
||||
|
||||
if($cnt>0) XmlGen::error_exit("LEVEL_NAME_NOT_UNIQUE"); |
||||
|
||||
$result = self::query("SELECT `value` FROM `SECTOR_INFO` WHERE `key` = 'LEVELS_PATH_RELATIVE_TO_SERVER';"); |
||||
$row = mysql_fetch_array($result); |
||||
$path = $row[0]; |
||||
|
||||
$result = self::query("SELECT `value` FROM `SECTOR_INFO` WHERE `key` = 'LEVELS_PATH';"); |
||||
$row = mysql_fetch_array($result); |
||||
$apath = $row[0]; |
||||
|
||||
$fpath = $path.$filename; |
||||
|
||||
|
||||
if(!file_exists($fpath)){ |
||||
XmlGen::error_exit("FILE_NOT_FOUND","Level file does not exist: ".$fpath); |
||||
} |
||||
|
||||
if(substr($filename,strlen($filename)-4) != ".xml"){ |
||||
XmlGen::error_exit("BAD_FILE_FORMAT", "Level file must be XML: ".$fpath); |
||||
} |
||||
|
||||
|
||||
// generate a LID |
||||
$lid = ""; |
||||
while(true){ |
||||
$lid = "L-".Util::uniqueString(9); |
||||
$result = self::query("SELECT COUNT(*) FROM `SECTOR_LEVELS` WHERE `lid` = '$lid';"); |
||||
$row = mysql_fetch_row($result); |
||||
if($row[0] == 0) break; |
||||
} |
||||
|
||||
|
||||
$hash = md5_file($fpath); |
||||
|
||||
$title = mysql_real_escape_string($title); |
||||
$filename = mysql_real_escape_string($filename); |
||||
|
||||
$time = time(); |
||||
|
||||
|
||||
self::query(" |
||||
INSERT |
||||
INTO `SECTOR_LEVELS` |
||||
(`lid`,`title`,`filename`,`checksum`,`time`) |
||||
VALUES |
||||
('$lid','$title','$filename','$hash','$time'); |
||||
"); |
||||
|
||||
echo XmlGen::levelAddedInfo($lid, $title, $apath.$filename, $hash, $time); |
||||
|
||||
exit(); |
||||
} |
||||
|
||||
public static function query($q){ |
||||
$res = mysql_query($q) or die(XmlGen::error("INTERNAL_ERROR", "DbError: ".mysql_error())); |
||||
return $res; |
||||
} |
||||
} |
@ -0,0 +1,35 @@ |
||||
<?php |
||||
|
||||
# Class for easier XML generation |
||||
class SimpleDocument extends DOMDocument{ |
||||
private $rootNode = null; |
||||
public function __construct($rootName='xml', $attribs = array()){ |
||||
parent::__construct('1.0', 'UTF-8'); |
||||
$rootElement = $this->createElement($rootName, $attribs); |
||||
|
||||
$this->rootNode = $this->appendChild($rootElement); |
||||
} |
||||
|
||||
public function createAttribute($name, $value){ |
||||
$a = parent::createAttribute($name); |
||||
$a->value = $value; |
||||
return $a; |
||||
} |
||||
|
||||
public function createElement($name='element', $attribs = null, $inner=''){ |
||||
$elem = parent::createElement($name,$inner); |
||||
|
||||
if($attribs != null){ |
||||
foreach($attribs as $key => $value){ |
||||
$a = $this->createAttribute($key, $value); |
||||
$elem->appendChild($a); |
||||
} |
||||
} |
||||
|
||||
return $elem; |
||||
} |
||||
|
||||
public function appendChildToRoot(DOMElement $element){ |
||||
return $this->rootNode->appendChild($element); |
||||
} |
||||
} |
@ -0,0 +1,38 @@ |
||||
<?php |
||||
class Util{ |
||||
// this needs name for salt. |
||||
public static function calcSecureHash($name, $password){ |
||||
// !!! When changing this, it must also be changed in the client piece! |
||||
return sha1( $name."S^1edT@R+ kN0w9e".md5( "troe(l01".$password."d*G -? df lo%iUq" )."myL!tT1e(P)0nNY" ); |
||||
} |
||||
|
||||
public static function uniqueString($len){ |
||||
$scale = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"; |
||||
$token = ""; |
||||
for($i=0;$i<$len;$i++){ |
||||
$token .= substr($scale, rand(0, strlen($scale)-1), 1); |
||||
} |
||||
return $token; |
||||
} |
||||
|
||||
public static function remoteFileExists($url) { |
||||
$curl = curl_init($url); |
||||
curl_setopt($curl, CURLOPT_NOBODY, true); |
||||
$result = curl_exec($curl); |
||||
$ret = false; |
||||
if ($result !== false) { |
||||
$statusCode = curl_getinfo($curl, CURLINFO_HTTP_CODE); |
||||
|
||||
if ($statusCode == 200) { |
||||
$ret = true; |
||||
} |
||||
} |
||||
curl_close($curl); |
||||
return $ret; |
||||
} |
||||
|
||||
public static function trimNullSafe($string){ |
||||
if($string == null) return null; |
||||
return trim($string); |
||||
} |
||||
} |
@ -0,0 +1,207 @@ |
||||
<?php |
||||
|
||||
global $ERR; |
||||
|
||||
# XML generator |
||||
class XmlGen{ |
||||
|
||||
public static function sendHeaders(){ |
||||
header("content-type: application/xml; charset=UTF-8"); |
||||
header("Cache-Control: no-cache, must-revalidate"); |
||||
} |
||||
|
||||
public static function hashCode($hash){ |
||||
self::sendHeaders(); |
||||
$doc = new SimpleDocument("hash"); |
||||
$doc->appendChildToRoot( $doc->createElement("hash", null, $hash) ); |
||||
return $doc->saveXML(); |
||||
} |
||||
|
||||
public static function deleteMessage(){ |
||||
self::sendHeaders(); |
||||
$doc = new SimpleDocument("status"); |
||||
$doc->appendChildToRoot( $doc->createElement("msg", null, "Profile deleted.") ); |
||||
return $doc->saveXML(); |
||||
} |
||||
|
||||
public static function infoTable($info){ |
||||
self::sendHeaders(); |
||||
$doc = new SimpleDocument("info"); |
||||
foreach($info as $k => $v){ |
||||
$eElem = $doc->createElement("entry"); |
||||
$enode = $doc->appendChildToRoot($eElem); |
||||
|
||||
$enode->appendChild($doc->createElement("key", null, $k)); |
||||
$enode->appendChild($doc->createElement("value", null, $v)); |
||||
} |
||||
return $doc->saveXML(); |
||||
} |
||||
|
||||
public static function userList($users){ |
||||
self::sendHeaders(); |
||||
$doc = new SimpleDocument("users"); |
||||
foreach($users as $u){ |
||||
$userElem = $doc->createElement("user"); |
||||
$unode = $doc->appendChildToRoot($userElem); |
||||
|
||||
$unode->appendChild($doc->createElement("name", null, $u[0])); |
||||
$unode->appendChild($doc->createElement("reg_time", null, $u[1])); |
||||
$unode->appendChild($doc->createElement("country", null, $u[2])); |
||||
} |
||||
return $doc->saveXML(); |
||||
} |
||||
|
||||
public static function levelList($data){ // `lid`,`title`,`filename`,`checksum`,`time` |
||||
self::sendHeaders(); |
||||
$doc = new SimpleDocument("levels"); |
||||
foreach($data as $l){ |
||||
$level = $doc->createElement("level"); |
||||
|
||||
$lnode = $doc->appendChildToRoot($level); |
||||
$lnode->appendChild($doc->createElement("lid", null, $l[0])); |
||||
$lnode->appendChild($doc->createElement("title", null, $l[1])); |
||||
$lnode->appendChild($doc->createElement("url", null, $l[2])); |
||||
$lnode->appendChild($doc->createElement("checksum", null, $l[3])); |
||||
$lnode->appendChild($doc->createElement("created", null, $l[4])); |
||||
} |
||||
return $doc->saveXML(); |
||||
} |
||||
|
||||
public static function scoreList($lid, $data, $changeFlag=null, $lastRecord=null){ // username, uid, time, score |
||||
self::sendHeaders(); |
||||
$attrs = array(); |
||||
if($changeFlag!=null) $attrs["score_improved"] = $changeFlag; |
||||
if($changeFlag!=null) $attrs["last_score"] = $lastRecord; |
||||
$doc = new SimpleDocument("scores", $attrs); |
||||
foreach($data as $l){ |
||||
$level = $doc->createElement("score"); |
||||
|
||||
$lnode = $doc->appendChildToRoot($level); |
||||
$lnode->appendChild($doc->createElement("uid", null, $l[1])); |
||||
$lnode->appendChild($doc->createElement("name", null, $l[0])); |
||||
$lnode->appendChild($doc->createElement("time", null, $l[2])); |
||||
$lnode->appendChild($doc->createElement("score", null, $l[3])); |
||||
} |
||||
return $doc->saveXML(); |
||||
} |
||||
|
||||
public static function levelAddedInfo($lid, $title, $url, $hash, $time){ |
||||
self::sendHeaders(); |
||||
$doc = new SimpleDocument("level"); |
||||
|
||||
$doc->appendChildToRoot( $doc->createElement("lid", null, $lid) ); |
||||
$doc->appendChildToRoot( $doc->createElement("title", null, $title) ); |
||||
$doc->appendChildToRoot( $doc->createElement("url", null, $url) ); |
||||
$doc->appendChildToRoot( $doc->createElement("checksum", null, $hash) ); |
||||
$doc->appendChildToRoot( $doc->createElement("created", null, $time) ); |
||||
|
||||
return $doc->saveXML(); |
||||
} |
||||
|
||||
public static function sessionInfo($uid, $token, $name=null, $email=null, $reg_time=null, $country=null){ |
||||
self::sendHeaders(); |
||||
$doc = new SimpleDocument("session"); |
||||
|
||||
$doc->appendChildToRoot( $doc->createElement("uid", null, $uid) ); |
||||
$doc->appendChildToRoot( $doc->createElement("auth_token", null, $token) ); |
||||
|
||||
$doc->appendChildToRoot( $doc->createElement("name", null, $name) ); |
||||
$doc->appendChildToRoot( $doc->createElement("email", null, $email) ); |
||||
$doc->appendChildToRoot( $doc->createElement("reg_time", null, $reg_time) ); |
||||
$doc->appendChildToRoot( $doc->createElement("country", null, $country) ); |
||||
|
||||
return $doc->saveXML(); |
||||
} |
||||
|
||||
public static function error($error, $msg=""){ |
||||
self::sendHeaders(); |
||||
global $ERR; |
||||
$e = $ERR[$error]; |
||||
$doc = new SimpleDocument("error"); |
||||
|
||||
$doc->appendChildToRoot( $doc->createElement("code", null, $e[0]) ); |
||||
$doc->appendChildToRoot( $doc->createElement("message", null, $e[1]) ); |
||||
$doc->appendChildToRoot( $doc->createElement("cause", null, $msg) ); |
||||
|
||||
return $doc->saveXML(); |
||||
} |
||||
|
||||
public static function error_exit($error, $msg=""){ |
||||
self::sendHeaders(); |
||||
global $ERR; |
||||
$e = $ERR[$error]; |
||||
$doc = new SimpleDocument("error"); |
||||
|
||||
$doc->appendChildToRoot( $doc->createElement("code", null, $e[0]) ); |
||||
$doc->appendChildToRoot( $doc->createElement("message", null, $e[1]) ); |
||||
$doc->appendChildToRoot( $doc->createElement("cause", null, $msg) ); |
||||
|
||||
echo $doc->saveXML(); |
||||
exit(); |
||||
} |
||||
|
||||
|
||||
|
||||
public static function hacking_exit(){ |
||||
|
||||
srand(round(time()/7200)); |
||||
|
||||
if(rand(0,10)==0){ |
||||
$full_url_path = "http://".$_SERVER['HTTP_HOST'].preg_replace("#/[^/]*\.php$#simU", "/", $_SERVER["PHP_SELF"])."nothingHere.txt"; |
||||
|
||||
$ch = curl_init(); |
||||
$timeout = 5; |
||||
curl_setopt($ch, CURLOPT_URL, $full_url_path); |
||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); |
||||
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout); |
||||
echo curl_exec($ch); |
||||
curl_close($ch); |
||||
|
||||
/* echo "<HTML> |
||||
<HEAD> |
||||
<TITLE>404 Not Found</TITLE> |
||||
</HEAD> |
||||
<BODY> |
||||
<H1>Not Found</H1> |
||||
The requested document was not found on this server. |
||||
<P> |
||||
<HR> |
||||
<ADDRESS> |
||||
Web Server at ".$_SERVER['SERVER_NAME']." |
||||
</ADDRESS> |
||||
</BODY> |
||||
</HTML>";*/ |
||||
|
||||
exit(); |
||||
} |
||||
|
||||
self::sendHeaders(); |
||||
|
||||
$doc = new SimpleDocument("error"); |
||||
|
||||
$msgs = array( |
||||
15 => "Internal server error.", |
||||
"Database connection timed out.", |
||||
"Service temporarily overloaded.", |
||||
"Service temporarily not available.", |
||||
"Operation not permitted.", |
||||
"Session has expired.", |
||||
"Brandwidth limit reached, aborting.", |
||||
"Access denied.", |
||||
"Unauthorised server access.", |
||||
"Invalid command exception.", |
||||
"Operation aborted.", |
||||
"Bad database entry format.", |
||||
); |
||||
|
||||
|
||||
$e = rand(15,15+count($msgs)-1); |
||||
|
||||
$doc->appendChildToRoot( $doc->createElement("code", null, $e) ); |
||||
$doc->appendChildToRoot( $doc->createElement("message", null, $msgs[$e]) ); |
||||
$doc->appendChildToRoot( $doc->createElement("cause", null, "") ); |
||||
|
||||
echo $doc->saveXML(); |
||||
exit(); |
||||
} |
||||
} |
@ -0,0 +1,75 @@ |
||||
<?php |
||||
|
||||
// DUMP OF MYSQL DATABASE FOR SECTOR |
||||
|
||||
/* |
||||
|
||||
|
||||
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO"; |
||||
|
||||
|
||||
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `SECTOR_INFO` ( |
||||
`key` varchar(30) NOT NULL COMMENT 'Property key', |
||||
`value` text NOT NULL COMMENT 'Property value (text)', |
||||
PRIMARY KEY (`key`) |
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Information for Sector, eg. Info about updates, messages etc'; |
||||
|
||||
|
||||
|
||||
|
||||
INSERT INTO `SECTOR_INFO` (`key`, `value`) VALUES |
||||
('LEVELS_PATH', 'http://www.ondrovo.com/sector/api/levels/'), |
||||
('VERSION', 'Alpha 14'), |
||||
('VERSION_NUMBER', '14'), |
||||
('LEVELS_PATH_RELATIVE_TO_SERVER', 'levels/'); |
||||
|
||||
|
||||
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `SECTOR_LEVELS` ( |
||||
`lid` varchar(20) NOT NULL COMMENT 'Level id', |
||||
`title` varchar(120) NOT NULL COMMENT 'Level title (shown is game)', |
||||
`filename` varchar(100) NOT NULL COMMENT 'File name in storage', |
||||
`checksum` varchar(100) NOT NULL COMMENT 'hashcode of the file', |
||||
`time` int(12) unsigned NOT NULL COMMENT 'time of creation', |
||||
PRIMARY KEY (`lid`), |
||||
UNIQUE KEY `title` (`title`) |
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Table of official sector levels'; |
||||
|
||||
|
||||
|
||||
|
||||
INSERT INTO `SECTOR_LEVELS` (`lid`, `title`, `filename`, `checksum`, `time`) VALUES |
||||
('L-i5dvKm6Fv', 'Demo level', 'alpha14test.xml', 'b9d8db8da9c2ca54e78bf8d2a8a2dc6c', 1356545440); |
||||
|
||||
|
||||
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `SECTOR_SCORES` ( |
||||
`id` int(12) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Entry ID', |
||||
`uid` varchar(20) NOT NULL COMMENT 'User ID', |
||||
`lid` varchar(20) NOT NULL COMMENT 'Level ID', |
||||
`time` int(12) NOT NULL COMMENT 'Time when this score has been made', |
||||
`score` int(12) NOT NULL COMMENT 'Highest score for player/level', |
||||
PRIMARY KEY (`id`) |
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Table of SECTOR highscores'; |
||||
|
||||
|
||||
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `SECTOR_USERS` ( |
||||
`uid` varchar(20) NOT NULL COMMENT 'User ID', |
||||
`name` varchar(50) NOT NULL COMMENT 'User''s nickname', |
||||
`password` varchar(80) NOT NULL COMMENT 'User''s password', |
||||
`auth_token` varchar(120) NOT NULL COMMENT 'Authentication code used to make communication more secure.', |
||||
`email` varchar(120) NOT NULL COMMENT 'Email for password recovery', |
||||
`reg_time` int(12) NOT NULL COMMENT 'Registration timestamp (for stats)', |
||||
`country` varchar(120) NOT NULL DEFAULT '' COMMENT 'Country for stats', |
||||
PRIMARY KEY (`uid`), |
||||
UNIQUE KEY `uname` (`name`) |
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Table of SECTOR''s registered users'; |
||||
|
||||
|
||||
*/ |
@ -0,0 +1,423 @@ |
||||
<?xml version="1.0" encoding="UTF-8"?> |
||||
<level> |
||||
|
||||
<info> |
||||
<title>Alpha 14 test level</title> |
||||
<subtitle>Challenge level with bosses</subtitle> |
||||
<author>MightyPork</author> |
||||
<minv>14</minv> |
||||
</info> |
||||
|
||||
|
||||
|
||||
<config> |
||||
<money>40000</money> |
||||
<building>NORMAL</building> |
||||
</config> |
||||
|
||||
|
||||
|
||||
|
||||
<discoveries> |
||||
<all level="max" /> |
||||
<discovery name="cannon" level="0" /> |
||||
</discoveries> |
||||
|
||||
|
||||
<ship> |
||||
<dim x="9" y="9" /> |
||||
<sys energy="4" shield="2" /> |
||||
<struct> |
||||
<row> |
||||
<null /> |
||||
<null /> |
||||
<null /> |
||||
<piece id="w_cannon" level="3" rotate="0" health="1.5" trigger="BTN_DOWN:0" /> |
||||
<piece id="w_emp" level="1" rotate="0" health="3.0" trigger="BTN_DOWN:1" /> |
||||
<piece id="w_cannon" level="3" rotate="0" health="1.5" trigger="BTN_DOWN:0" /> |
||||
<null /> |
||||
<null /> |
||||
<null /> |
||||
</row> |
||||
<row> |
||||
<null /> |
||||
<null /> |
||||
<piece id="w_laser" level="3" rotate="0" health="2.0" trigger="BTN_DOWN:0" /> |
||||
<piece id="bs_triangle" level="1" rotate="90" health="1.5" /> |
||||
<piece id="bs_side1" level="1" rotate="180" health="1.5" /> |
||||
<piece id="bs_triangle" level="1" rotate="0" health="1.5" /> |
||||
<piece id="w_laser" level="3" rotate="0" health="2.0" trigger="BTN_DOWN:0" /> |
||||
<null /> |
||||
<null /> |
||||
</row> |
||||
<row> |
||||
<null /> |
||||
<piece id="w_plasma" level="2" rotate="0" health="4.0" trigger="BTN_DOWN:0" /> |
||||
<piece id="bs_triangle" level="1" rotate="90" health="1.5" /> |
||||
<piece id="bs_corner1" level="1" rotate="90" health="1.5" /> |
||||
<piece id="bb_cube" level="1" rotate="0" health="1.5" /> |
||||
<piece id="bs_corner1" level="1" rotate="0" health="1.5" /> |
||||
<piece id="bs_triangle" level="1" rotate="0" health="1.5" /> |
||||
<piece id="w_plasma" level="2" rotate="0" health="4.0" trigger="BTN_DOWN:0" /> |
||||
<null /> |
||||
</row> |
||||
<row> |
||||
<piece id="w_plasma" level="2" rotate="0" health="4.0" trigger="BTN_DOWN:0" /> |
||||
<piece id="bw_triangle" level="1" rotate="90" health="1.5" /> |
||||
<piece id="bs_side1" level="1" rotate="270" health="1.5" /> |
||||
<piece id="bb_cube" level="1" rotate="0" health="1.5" /> |
||||
<piece id="bb_cube" level="1" rotate="0" health="1.5" /> |
||||
<piece id="bb_cube" level="1" rotate="0" health="1.5" /> |
||||
<piece id="bs_side1" level="1" rotate="90" health="1.5" /> |
||||
<piece id="bw_triangle" level="1" rotate="0" health="1.5" /> |
||||
<piece id="w_plasma" level="2" rotate="0" health="4.0" trigger="BTN_DOWN:0" /> |
||||
</row> |
||||
<row> |
||||
<piece id="bw_triangle" level="1" rotate="90" health="1.5" /> |
||||
<piece id="bw_cube" level="1" rotate="0" health="1.5" /> |
||||
<piece id="bs_side1" level="1" rotate="270" health="1.5" /> |
||||
<piece id="bb_cube" level="1" rotate="0" health="1.5" /> |
||||
<piece id="bb_cube" level="1" rotate="0" health="1.5" /> |
||||
<piece id="bb_cube" level="1" rotate="0" health="1.5" /> |
||||
<piece id="bs_side1" level="1" rotate="90" health="1.5" /> |
||||
<piece id="bw_cube" level="1" rotate="0" health="1.5" /> |
||||
<piece id="bw_triangle" level="1" rotate="0" health="1.5" /> |
||||
</row> |
||||
<row> |
||||
<piece id="bw_cube" level="1" rotate="0" health="1.5" /> |
||||
<piece id="bw_cube" level="1" rotate="0" health="1.5" /> |
||||
<piece id="bs_side1" level="1" rotate="270" health="1.5" /> |
||||
<piece id="bb_cube" level="1" rotate="0" health="1.5" /> |
||||
<piece id="bb_cube" level="1" rotate="0" health="1.5" /> |
||||
<piece id="bb_cube" level="1" rotate="0" health="1.5" /> |
||||
<piece id="bs_side1" level="1" rotate="90" health="1.5" /> |
||||
<piece id="bw_cube" level="1" rotate="0" health="1.5" /> |
||||
<piece id="bw_cube" level="1" rotate="0" health="1.5" /> |
||||
</row> |
||||
<row> |
||||
<piece id="bw_cube" level="1" rotate="0" health="1.5" /> |
||||
<piece id="bw_triangle" level="1" rotate="270" health="1.5" /> |
||||
<piece id="bs_triangle" level="1" rotate="180" health="1.5" /> |
||||
<piece id="bs_corner1" level="1" rotate="180" health="1.5" /> |
||||
<piece id="bb_cube" level="1" rotate="0" health="1.5" /> |
||||
<piece id="bs_corner1" level="1" rotate="270" health="1.5" /> |
||||
<piece id="bs_triangle" level="1" rotate="270" health="1.5" /> |
||||
<piece id="bw_triangle" level="1" rotate="180" health="1.5" /> |
||||
<piece id="bw_cube" level="1" rotate="0" health="1.5" /> |
||||
</row> |
||||
<row> |
||||
<piece id="bw_triangle" level="1" rotate="270" health="1.5" /> |
||||
<null /> |
||||
<null /> |
||||
<piece id="bs_triangle" level="1" rotate="180" health="1.5" /> |
||||
<piece id="bs_side1" level="1" rotate="0" health="1.5" /> |
||||
<piece id="bs_triangle" level="1" rotate="270" health="1.5" /> |
||||
<null /> |
||||
<null /> |
||||
<piece id="bw_triangle" level="1" rotate="180" health="1.5" /> |
||||
</row> |
||||
<row> |
||||
<null /> |
||||
<null /> |
||||
<null /> |
||||
<null /> |
||||
<piece id="engine_ion" level="3" rotate="0" health="4.0" /> |
||||
<null /> |
||||
<null /> |
||||
<null /> |
||||
<null /> |
||||
</row> |
||||
</struct> |
||||
</ship> |
||||
|
||||
|
||||
<sequence> |
||||
|
||||
<rockshift coord="0;-1" /> |
||||
|
||||
<rockgen id="rocks" > |
||||
<type num="-1" /> |
||||
<size range="2-8" /> |
||||
<speed num="3" /> |
||||
<rarity num="10" /> |
||||
<x range="-30-30" /> |
||||
<z range="100-120" /> |
||||
</rockgen> |
||||
|
||||
<pause t="2" /> |
||||
<msg str="Welcome to Sector!" t="3" /> |
||||
<msg str="Level by MightyPork" t="1" /> |
||||
<msg str="" t="1" /> |
||||
<msg str="Enjoy!" t="1.5" /> |
||||
|
||||
<pause t="5" /> |
||||
|
||||
<shipgen id="mines" > |
||||
<entity str="mine" /> |
||||
<rarity num="60" /> |
||||
<x range="-10-10" /> |
||||
<z range="100-120" /> |
||||
</shipgen> |
||||
|
||||
<shipgen id="fighters" > |
||||
<entity str="fighter" /> |
||||
<rarity num="110" /> |
||||
<size range="0.5-1" /> |
||||
<x range="-5-5" /> |
||||
<z range="100-120" /> |
||||
<wave str="annoyers" /> |
||||
</shipgen> |
||||
|
||||
<shipgen id="birds" > |
||||
<entity str="bird" /> |
||||
<rarity num="150" /> |
||||
<size range="0.5-1" /> |
||||
<x range="-15:15" /> |
||||
<z range="100-120" /> |
||||
<wave str="annoyers" /> |
||||
</shipgen> |
||||
|
||||
|
||||
<pause t="5" /> |
||||
|
||||
<cycle> |
||||
|
||||
|
||||
<!-- cleanup --> |
||||
<disable gen="birds" /> |
||||
<disable gen="fighters" /> |
||||
<wait for="annoyers" /> |
||||
|
||||
|
||||
|
||||
<!-- SNAKEY --> |
||||
<msg str="Snakey!" t="4"/> |
||||
|
||||
<spawn> |
||||
<entity str="snake" /> |
||||
<x range="-20:20" /> |
||||
<z range="100:110"/> |
||||
<wave str="boss" /> |
||||
<count range="5-7" /> |
||||
<dist num="2" /> |
||||
<variant range="0-5" /> |
||||
<uniform bool="true" /> |
||||
<artifact bool="true" /> |
||||
<formation str="snake" /> |
||||
</spawn> |
||||
|
||||
<wait for="boss" /> |
||||
|
||||
<!-- /SNAKEY --> |
||||
|
||||
|
||||
|
||||
<!-- SNAKEY --> |
||||
<msg str="And snake again!" t="4"/> |
||||
|
||||
<spawn> |
||||
<entity str="snake" /> |
||||
<x range="-20:20" /> |
||||
<z range="100:110"/> |
||||
<wave str="boss" /> |
||||
<count range="5-7" /> |
||||
<dist num="2" /> |
||||
<variant range="0-5" /> |
||||
<uniform bool="true" /> |
||||
<artifact bool="true" /> |
||||
<formation str="snake" /> |
||||
</spawn> |
||||
|
||||
<wait for="boss" /> |
||||
|
||||
<!-- /SNAKEY --> |
||||
|
||||
|
||||
|
||||
<!-- BURGERS --> |
||||
<pause t="3" /> |
||||
<enable gen="birds" /> |
||||
<enable gen="fighters" /> |
||||
|
||||
<spawn> |
||||
<entity str="burger" /> |
||||
<driver str="burger_zone" /> |
||||
<x num="0" /> |
||||
<z num="100" /> |
||||
<count num="10" /> |
||||
<formation str="line" /> |
||||
<uniform bool="true" /> |
||||
<dist num="3" /> |
||||
<wave str="annoyers" /> |
||||
</spawn> |
||||
|
||||
<pause t="3" /> |
||||
|
||||
<disable gen="birds" /> |
||||
<disable gen="fighters" /> |
||||
<wait for="annoyers" /> |
||||
<!-- /BURGERS --> |
||||
|
||||
|
||||
|
||||
|
||||
<!-- Getting ready for SHARK --> |
||||
<disable gen="birds" /> |
||||
<disable gen="fighters" /> |
||||
<disable gen="mines" /> |
||||
|
||||
<msg str="Better reload your shield!" t="3" /> |
||||
<wait for="annoyers" /> |
||||
<disable gen="rocks" /> |
||||
<pause t="10" /> |
||||
|
||||
|
||||
|
||||
|
||||
<!-- SHARK --> |
||||
<msg str="* Sushi Time *" t="2" /> |
||||
<msg str="" t="1" /> |
||||
<msg str="Want some seafood?" t="3" /> |
||||
<msg str="It's all yours!" t="2" /> |
||||
<pause t="3" /> |
||||
|
||||
<spawn> |
||||
<entity str="shark" /> |
||||
<driver str="shark" /> |
||||
<x num="0" /> |
||||
<z num="110" /> |
||||
<count num="1" /> |
||||
<artifact bool="true" /> |
||||
<wave str="boss" /> |
||||
<health num="2" /> |
||||
</spawn> |
||||
|
||||
<wait for="boss" /> |
||||
<!-- /SHARK --> |
||||
|
||||
|
||||
<!-- Reload shield in some rocks. --> |
||||
<enable gen="rocks" /> |
||||
<pause t="6" /> |
||||
<disable gen="rocks" /> |
||||
<pause t="8" /> |
||||
|
||||
|
||||
|
||||
<!-- FALCONS --> |
||||
<msg str="Falcons, oh man!" t="3"/> |
||||
|
||||
<spawn> |
||||
<entity str="falcon" /> |
||||
<driver str="falcon" /> |
||||
<x range="-10:10" /> |
||||
<z num="110" /> |
||||
<count num="3" /> |
||||
<wave str="boss" /> |
||||
<formation str="row" /> |
||||
<dist num="2.5" /> |
||||
</spawn> |
||||
|
||||
<wait for="boss" /> |
||||
<!-- /FALCONS --> |
||||
|
||||
<enable gen="rocks" /> |
||||
<msg str="" t="3"/> |
||||
<msg str="Ever played" t="1"/> |
||||
<msg str="MINESWEEPER?" t="3"/> |
||||
<wait t="10" /> |
||||
|
||||
<disable gen="rocks" /> |
||||
<pause t="7" /> |
||||
<msg str="WATCH OUT!" t="1.5"/> |
||||
<pause t="4" /> |
||||
|
||||
<rockshift coord="0;-2.5" /> |
||||
<repeat i="12"> |
||||
|
||||
<spawn> |
||||
<entity str="mine" /> |
||||
<scale num="1.3" /> |
||||
<x num="0" /> |
||||
<z range="110" /> |
||||
<count num="15" /> |
||||
<wave str="mines" /> |
||||
<formation str="row" /> |
||||
<dist num="1.5" /> |
||||
</spawn> |
||||
|
||||
<pause t="0.08" /> |
||||
<rockshift coord="-0.3;-2.5" /> |
||||
<pause t="0.08" /> |
||||
<rockshift coord="-0.6;-2.5" /> |
||||
<pause t="0.08" /> |
||||
<rockshift coord="-0.8;-2.5" /> |
||||
<pause t="0.08" /> |
||||
<rockshift coord="-0.6;-2.5" /> |
||||
<pause t="0.08" /> |
||||
<rockshift coord="-0.3;-2.5" /> |
||||
<pause t="0.08" /> |
||||
<pause t="0.08" /> |
||||
<rockshift coord="0;-2.5" /> |
||||
<pause t="0.08" /> |
||||
|
||||
<spawn> |
||||
<entity str="mine" /> |
||||
<scale num="1.3" /> |
||||
<x num="0" /> |
||||
<z range="110" /> |
||||
<count num="15" /> |
||||
<wave str="mines" /> |
||||
<formation str="row" /> |
||||
<dist num="1.5" /> |
||||
</spawn> |
||||
|
||||
<rockshift coord="0.3;-2.5" /> |
||||
<pause t="0.08" /> |
||||
<rockshift coord="0.6;-2.5" /> |
||||
<pause t="0.08" /> |
||||
<rockshift coord="0.8;-2.5" /> |
||||
<pause t="0.08" /> |
||||
<rockshift coord="0.6;-2.5" /> |
||||
<pause t="0.08" /> |
||||
<rockshift coord="0.3;-2.5" /> |
||||
<pause t="0.08" /> |
||||
<rockshift coord="0;-2.5" /> |
||||
|
||||
</repeat> |
||||
|
||||
<wait for="mines" /> |
||||
<msg str="Wasn't this fun?" t="3"/> |
||||
<rockshift coord="0;-1" /> |
||||
<enable gen="rocks" /> |
||||
|
||||
|
||||
<!-- a bit of rocks & annoyers --> |
||||
<msg str="Relax..." t="1.5"/> |
||||
<msg str="You're almost there..." t="3"/> |
||||
<pause t="10" /> |
||||
|
||||
<enable gen="birds" /> |
||||
<enable gen="fighters" /> |
||||
<enable gen="mines" /> |
||||
<pause t="10" /> |
||||
<disable gen="birds" /> |
||||
<disable gen="fighters" /> |
||||
<disable gen="mines" /> |
||||
|
||||
<msg str="Congratulations!" t="3" /> |
||||
<msg str="" t="2" /> |
||||
|
||||
<msg str="Welcome to the" t="2" /> |
||||
<msg str="End of level!" t="3" /> |
||||
|
||||
<msg str="" t="2" /> |
||||
<msg str="[repeat all]" t="1" /> |
||||
|
||||
<pause t="14" /> |
||||
|
||||
</cycle> |
||||
|
||||
</sequence> |
||||
|
||||
</level> |
@ -0,0 +1,22 @@ |
||||
<?php |
||||
|
||||
define("SQL_HOST","localhost"); |
||||
define("SQL_DBNAME","tridni_net_main"); |
||||
define("SQL_USERNAME","tridni_net_main"); |
||||
define("SQL_PASSWORD","ondra"); |
||||
|
||||
mysql_connect(SQL_HOST, SQL_USERNAME, SQL_PASSWORD); |
||||
|
||||
mysql_set_charset("utf8"); |
||||
|
||||
mysql_select_db(SQL_DBNAME); |
||||
|
||||
mysql_query( |
||||
"SET NAMES 'utf8' COLLATE 'utf8_general_ci';". |
||||
"SET CHARACTER SET utf8;". |
||||
"SET character_set_client = utf8;". |
||||
"SET character_set_connection = utf8;". |
||||
"SET character_set_results = utf8;" |
||||
); |
||||
|
||||
?> |
@ -0,0 +1,281 @@ |
||||
<?php |
||||
|
||||
# Error codes and messages |
||||
$ERR = array( |
||||
"NO_COMMAND" => array(0, "No command received."), |
||||
"INVALID_COMMAND" => array(1, "Invalid command requested."), |
||||
"INTERNAL_ERROR" => array(2, "Internal server error."), |
||||
"INCOMPLETE_COMMAND" => array(3, "Incomplete command received"), |
||||
"REGISTRATION_FAILED" => array(4, "Registration failed."), |
||||
"LOGIN_FAILED" => array(5, "Login failed."), |
||||
"INVALID_TOKEN" => array(6, "Authentication failed."), |
||||
"FILE_NOT_FOUND" => array(7, "File does not exist."), |
||||
"BAD_FILE_FORMAT" => array(8, "Bad file format."), |
||||
"LEVEL_ALREADY_ADDED" => array(9, "Level file is already registered to the Global Leaderboard."), |
||||
"LEVEL_NAME_NOT_UNIQUE" => array(10, "Title already used by other level."), |
||||
"NO_SUCH_LEVEL" => array(11, "No such level exists."), |
||||
"HACKING_DETECTED" => array(12, "Access denied."), |
||||
); |
||||
|
||||
define("CFG_FAKE_ERROR_FOR_HACKERS",true); |
||||
|
||||
|
||||
|
||||
require_once("mysql.php"); |
||||
|
||||
require_once("class.SimpleDocument.php"); |
||||
require_once("class.XmlGen.php"); |
||||
require_once("class.DbUtil.php"); |
||||
require_once("class.Util.php"); |
||||
|
||||
|
||||
|
||||
if(isset($_REQUEST["cmd"]) && ($_REQUEST["cmd"]=="ADD_LEVEL")){}else{ //||$_REQUEST["cmd"]=="HASH" |
||||
|
||||
// Check if the request came from a genuine Sector game |
||||
$headers = apache_request_headers(); |
||||
|
||||
if( |
||||
$headers["User-Agent"] != "Sector/HttpHelper" |
||||
or !isset($headers["X-SECTOR-VERSION"]) |
||||
or isset($headers["Cookie"]) |
||||
or isset($headers["Accept-Encoding"]) |
||||
or isset($headers["Accept-Language"]) |
||||
or isset($headers["Accept-Charset"]) |
||||
or isset($headers["Accept"]) |
||||
){ |
||||
if(CFG_FAKE_ERROR_FOR_HACKERS){ |
||||
XmlGen::hacking_exit(); |
||||
}else{ |
||||
XmlGen::error_exit("HACKING_DETECTED","Unauthorized server access."); |
||||
} |
||||
} |
||||
|
||||
$_REQUEST["VERSION"] = $headers["X-SECTOR-VERSION"]+0; |
||||
} |
||||
|
||||
|
||||
|
||||
|
||||
|
||||
if(!isset($_REQUEST["cmd"])){ |
||||
XmlGen::error_exit("NO_COMMAND"); |
||||
} |
||||
|
||||
|
||||
|
||||
|
||||
switch($_REQUEST["cmd"]){ |
||||
|
||||
case "REGISTER": |
||||
// check if name and password exist |
||||
if(!isset($_REQUEST["name"]) || !isset($_REQUEST["password"])){ |
||||
XmlGen::error_exit("INCOMPLETE_COMMAND","Missing 'name' or 'password'."); |
||||
} |
||||
|
||||
// trim, null -> "" |
||||
if(!isset($_REQUEST["email"])) $_REQUEST["email"] = ""; |
||||
if(!isset($_REQUEST["country"])) $_REQUEST["country"] = ""; |
||||
|
||||
$name = trim($_REQUEST["name"]); |
||||
$email = trim($_REQUEST["email"]); |
||||
$password = trim($_REQUEST["password"]); |
||||
$country = trim($_REQUEST["country"]); |
||||
|
||||
// check name and password length |
||||
if(strlen($_REQUEST["name"])==0 || strlen($_REQUEST["password"])==0){ |
||||
XmlGen::error_exit("INCOMPLETE_COMMAND","Zero-length 'name' or 'password'."); |
||||
} |
||||
|
||||
// register and return uid+auth_token |
||||
DbUtil::registerNewUser( |
||||
$name, |
||||
$password, |
||||
$email, |
||||
$country |
||||
); |
||||
|
||||
exit(); |
||||
|
||||
|
||||
|
||||
case "EDIT_PROFILE": |
||||
// check if name and password exist |
||||
if(!isset($_REQUEST["uid"]) || !isset($_REQUEST["auth_token"])){ |
||||
XmlGen::error_exit("INCOMPLETE_COMMAND","Missing 'uid' or 'auth_token'."); |
||||
} |
||||
|
||||
if(!DbUtil::isTokenValid($_REQUEST["uid"], $_REQUEST["auth_token"])){ |
||||
XmlGen::error_exit("INVALID_TOKEN"); |
||||
} |
||||
|
||||
// replace not set variables with nulls |
||||
if(!isset($_REQUEST["email"])) $_REQUEST["email"] = ""; |
||||
if(!isset($_REQUEST["country"])) $_REQUEST["country"] = ""; |
||||
if(!isset($_REQUEST["name"])) $_REQUEST["name"] = null; |
||||
if(!isset($_REQUEST["password"])) $_REQUEST["password"] = null; |
||||
|
||||
$uid = $_REQUEST["uid"]; |
||||
$name = Util::trimNullSafe($_REQUEST["name"]); |
||||
$email = trim($_REQUEST["email"]); |
||||
$password = Util::trimNullSafe($_REQUEST["password"]); |
||||
$country = trim($_REQUEST["country"]); |
||||
|
||||
// register and return uid+auth_token |
||||
DbUtil::modifyProfile( |
||||
$uid, |
||||
$name, |
||||
$password, |
||||
$email, |
||||
$country |
||||
); |
||||
|
||||
exit(); |
||||
|
||||
|
||||
|
||||
case "DELETE_PROFILE": |
||||
// check if name and password exist |
||||
if(!isset($_REQUEST["uid"]) || !isset($_REQUEST["auth_token"])){ |
||||
XmlGen::error_exit("INCOMPLETE_COMMAND","Missing 'uid' or 'auth_token'."); |
||||
} |
||||
|
||||
if(!DbUtil::isTokenValid($_REQUEST["uid"], $_REQUEST["auth_token"])){ |
||||
XmlGen::error_exit("INVALID_TOKEN"); |
||||
} |
||||
|
||||
$uid = $_REQUEST["uid"]; |
||||
|
||||
// register and return uid+auth_token |
||||
DbUtil::deleteProfile( |
||||
$uid |
||||
); |
||||
|
||||
exit(); |
||||
|
||||
|
||||
case "ADD_LEVEL": |
||||
// check if name and password exist |
||||
if(!isset($_REQUEST["title"]) || !isset($_REQUEST["filename"])){ |
||||
XmlGen::error_exit("INCOMPLETE_COMMAND","Missing 'title' or 'filename'."); |
||||
} |
||||
|
||||
$title = trim($_REQUEST["title"]); |
||||
$file = trim($_REQUEST["filename"]); |
||||
|
||||
DbUtil::addLevel( |
||||
$title, |
||||
$file |
||||
); |
||||
|
||||
exit(); |
||||
|
||||
|
||||
|
||||
case "GET_LEVELS": |
||||
DbUtil::getLevels(); |
||||
exit(); |
||||
|
||||
|
||||
|
||||
case "GET_SCORES": |
||||
if(!isset($_REQUEST["lid"])){ |
||||
XmlGen::error_exit("INCOMPLETE_COMMAND","Missing 'lid'."); |
||||
} |
||||
|
||||
DbUtil::getLevelScores($_REQUEST["lid"]); |
||||
|
||||
exit(); |
||||
|
||||
|
||||
|
||||
case "LOG_IN": |
||||
// check if name and password exist |
||||
if(!isset($_REQUEST["name"]) || !isset($_REQUEST["password"])){ |
||||
XmlGen::error_exit("INCOMPLETE_COMMAND","Missing 'name' or 'password'."); |
||||
} |
||||
|
||||
$name = trim($_REQUEST["name"]); |
||||
$password = trim($_REQUEST["password"]); |
||||
|
||||
// log in and return uid+auth_token |
||||
DbUtil::logIn( |
||||
$name, |
||||
$password |
||||
); |
||||
|
||||
exit(); |
||||
|
||||
|
||||
|
||||
case "GET_PROFILE_INFO": |
||||
if(!isset($_REQUEST["uid"]) || !isset($_REQUEST["auth_token"])){ |
||||
XmlGen::error_exit("INCOMPLETE_COMMAND", "Missing 'uid' or 'auth_token'."); |
||||
} |
||||
|
||||
if(!DbUtil::isTokenValid($_REQUEST["uid"], $_REQUEST["auth_token"])){ |
||||
XmlGen::error_exit("INVALID_TOKEN"); |
||||
} |
||||
|
||||
// log in and return uid+auth_token |
||||
DbUtil::refreshLogin( |
||||
$_REQUEST["uid"], |
||||
$_REQUEST["auth_token"] |
||||
); |
||||
|
||||
exit(); |
||||
|
||||
|
||||
|
||||
case "SUBMIT_SCORE": |
||||
if(!isset($_REQUEST["uid"]) || !isset($_REQUEST["auth_token"])){ |
||||
XmlGen::error_exit("INCOMPLETE_COMMAND", "Missing 'uid' or 'auth_token'."); |
||||
} |
||||
|
||||
if(!isset($_REQUEST["lid"]) || !isset($_REQUEST["score"])){ |
||||
XmlGen::error_exit("INCOMPLETE_COMMAND", "Missing 'lid' or 'score'."); |
||||
} |
||||
|
||||
if(!DbUtil::isTokenValid($_REQUEST["uid"], $_REQUEST["auth_token"])){ |
||||
XmlGen::error_exit("INVALID_TOKEN"); |
||||
} |
||||
|
||||
// log in and return uid+auth_token |
||||
DbUtil::submitScore( |
||||
$_REQUEST["uid"], |
||||
$_REQUEST["lid"], |
||||
$_REQUEST["score"] |
||||
); |
||||
|
||||
exit(); |
||||
|
||||
|
||||
|
||||
// case "HASH": |
||||
// // check if name and password exist |
||||
// if(!isset($_REQUEST["password"]) || !isset($_REQUEST["name"])){ |
||||
// XmlGen::error_exit("INCOMPLETE_COMMAND", "Missing 'name' or 'password'."); |
||||
// } |
||||
// |
||||
// echo XmlGen::hashCode(Util::calcSecureHash($_REQUEST["name"],$_REQUEST["password"])); |
||||
// |
||||
// exit(); |
||||
|
||||
|
||||
|
||||
case "GET_INFO": |
||||
DbUtil::getInfo(); |
||||
exit(); |
||||
|
||||
|
||||
|
||||
case "GET_USERS": |
||||
DbUtil::getUsers(); |
||||
|
||||
exit(); |
||||
|
||||
|
||||
|
||||
default: |
||||
XmlGen::error_exit("INVALID_COMMAND"); |
||||
} |
@ -0,0 +1,53 @@ |
||||
<?xml version="1.0" encoding="UTF-8" ?> |
||||
|
||||
<pack> |
||||
<!-- the most basic ai structure --> |
||||
<driver name="basic"> |
||||
<task id="_begin"></task> |
||||
<check for="can_fire" id="can_fire"></check> |
||||
<task if="can_fire" id="fire"></task> |
||||
<task id="fly"></task> |
||||
<task id="avoid"></task> |
||||
<task id="turn"></task> |
||||
<task id="_end"></task> |
||||
</driver> |
||||
|
||||
<!-- --> |
||||
<driver name="basic_ship" extends="basic"> |
||||
<check replace="can_fire"> |
||||
<fn str="CAN_SHOOT" /> |
||||
<gun num="0" /> |
||||
<spare str="ENEMY" /> |
||||
</check> |
||||
|
||||
<!-- Needs replace --> |
||||
<task replace="fire"></task> |
||||
|
||||
<!-- Needs replace --> |
||||
<task replace="fly"></task> |
||||
|
||||
<task replace="avoid"> |
||||
<fn str="AVOID" /> |
||||
<avoid str="NATURAL,SHOT_GOOD,SHOT_BAD,ENEMY,MINE" /> |
||||
</task> |
||||
|
||||
<task replace="turn"> |
||||
<fn str="TURN_TO" /> |
||||
<dir coord="MOVE_DIR" /> |
||||
</task> |
||||
</driver> |
||||
|
||||
|
||||
<driver name="basic_saucer" extends="basic_ship"> |
||||
|
||||
<!-- Needs replace --> |
||||
<task replace="fire"></task> |
||||
|
||||
<task replace="turn"> |
||||
<fn str="ROTATE" /> |
||||
<add num="3" /> |
||||
<random_dir bool="true"/> |
||||
</task> |
||||
</driver> |
||||
|
||||
</pack> |
@ -0,0 +1,41 @@ |
||||
<?xml version="1.0" encoding="UTF-8" ?> |
||||
|
||||
<pack> |
||||
<driver name="bird" extends="basic_ship"> |
||||
|
||||
<check for="in_zone" id="ck1" after="can_fire"> |
||||
<fn str="IS_IN_RECT" /> |
||||
<x range="-20:20" /> |
||||
<z range="-20:30" /> |
||||
</check> |
||||
|
||||
<task replace="fire" if="can_fire&in_zone"> |
||||
<fn str="SHOOT" /> |
||||
<count range="1" /> |
||||
<gap_group num="0.6" /> |
||||
<gun num="0" /> |
||||
</task> |
||||
|
||||
<task replace="fly"> |
||||
<fn str="FLY_TO_RECT" /> |
||||
<x range="-4-4"/> |
||||
<z range="15-25"/> |
||||
<weight num="30" /> |
||||
</task> |
||||
|
||||
|
||||
<task replace="turn"> |
||||
<fn str="TURN_TO" /> |
||||
<dir coord="PLAYER_DIR" /> |
||||
</task> |
||||
|
||||
<task replace="avoid"> |
||||
<fn str="AVOID" /> |
||||
<avoid str="NATURAL,SHOT_GOOD,SHOT_BAD,ENEMY,MINE" /> |
||||
<range num="4" /> |
||||
<weight num="4" /> |
||||
<square bool="true" /> |
||||
</task> |
||||
|
||||
</driver> |
||||
</pack> |
@ -0,0 +1,81 @@ |
||||
<?xml version="1.0" encoding="UTF-8" ?> |
||||
|
||||
<pack> |
||||
|
||||
<driver name="burger" extends="basic_saucer"> |
||||
<task replace="fire"> |
||||
<fn str="SHOOT" /> |
||||
<count range="2:4" /> |
||||
<gap_shot num="0.07" /> |
||||
<gap_group range="2:4" /> |
||||
<gun num="0" /> |
||||
</task> |
||||
|
||||
<task replace="avoid"> |
||||
<fn str="AVOID" /> |
||||
<avoid str="NATURAL,SHOT_GOOD,ENEMY,MINE" /> |
||||
<weight num="1" /> |
||||
</task> |
||||
|
||||
<task replace="fly"> |
||||
<fn str="FLY_TO_POINT" /> |
||||
<target coord="PLAYER_POS" /> |
||||
</task> |
||||
</driver> |
||||
|
||||
|
||||
<driver name="burger_zone" extends="burger"> |
||||
<task replace="fly"> |
||||
<fn str="FLY_TO_RECT" /> |
||||
<x range="-10:10" /> |
||||
<z range="25:40" /> |
||||
<weight num="60" /> |
||||
</task> |
||||
</driver> |
||||
|
||||
<driver name="burger_zone_mad" extends="burger_zone"> |
||||
<task replace="fire"> |
||||
<fn str="SHOOT" /> |
||||
<count range="15-25" /> |
||||
<gap_shot num="0.08" /> |
||||
<gap_group range="1:5" /> |
||||
<gun num="0" /> |
||||
</task> |
||||
</driver> |
||||
|
||||
<driver name="burger_mad" extends="burger_zone"> |
||||
<task replace="fire"> |
||||
<fn str="SHOOT" /> |
||||
<count range="15-25" /> |
||||
<gap_shot num="0.08" /> |
||||
<gap_group range="2:5" /> |
||||
<gun num="0" /> |
||||
</task> |
||||
</driver> |
||||
|
||||
<driver name="burger_king" extends="basic_saucer"> |
||||
|
||||
<check for="in_zone" id="ck1"> |
||||
<fn str="IS_IN_RECT" /> |
||||
<x range="-20:20" /> |
||||
<z range="-5:70" /> |
||||
</check> |
||||
|
||||
<task replace="fire" if="in_zone"> |
||||
<fn str="SHOOT" /> |
||||
<count range="10:20" /> |
||||
<bullets range="3:5" /> |
||||
<gap_group num="1" /> |
||||
<gap_shot num="0.02" /> |
||||
<gun num="0" /> <!--range="0-1" --> |
||||
</task> |
||||
|
||||
<task replace="fly"> |
||||
<fn str="FLY_TO_RECT" /> |
||||
<x range="-10:10" /> |
||||
<z range="20:40" /> |
||||
<weight num="10" /> |
||||
</task> |
||||
</driver> |
||||
|
||||
</pack> |
@ -0,0 +1,73 @@ |
||||
<?xml version="1.0" encoding="UTF-8" ?> |
||||
|
||||
<pack> |
||||
<driver name="cube_snake"> |
||||
|
||||
<check for="in_zone"> |
||||
<fn str="IS_IN_RECT" /> |
||||
<x range="-20:20" /> |
||||
<z range="-20:60" /> |
||||
</check> |
||||
|
||||
<check for="fire"> |
||||
<fn str="CAN_SHOOT" /> |
||||
<gun num="0" /> |
||||
<spare str="ENEMY" /> |
||||
<!-- ignore_formation bool="true" /--> |
||||
</check> |
||||
|
||||
<task if="fire*in_zone"> |
||||
<fn str="SHOOT" /> |
||||
<count range="1:3" /> |
||||
<gap_group range="0.5:2.5" /> |
||||
<gap_shot num="0.09" /> |
||||
<gun num="0" /> |
||||
</task> |
||||
|
||||
<task> |
||||
<fn str="TURN_TO" /> |
||||
<dir coord="MOVE_DIR" /> |
||||
</task> |
||||
|
||||
|
||||
<!-- SNAKE CODE --> |
||||
<check for="is_leader"> |
||||
<fn str="IS_LEADER" /> |
||||
</check> |
||||
|
||||
<check for="is_tail"> |
||||
<fn str="IS_TAIL" /> |
||||
</check> |
||||
|
||||
<task if="is_leader"> |
||||
<fn str="FLY_TO_RECT" /> |
||||
<x range="-10:10" /> |
||||
<z range="25:35" /> |
||||
<weight num="5" /> |
||||
</task> |
||||
|
||||
<task if="!is_leader"> |
||||
<fn str="FLY_TO_POINT" /> |
||||
<target coord="LEADER_POS" /> |
||||
<weight num="10" /> |
||||
</task> |
||||
|
||||
<task if="!is_leader"> |
||||
<fn str="KEEP_DISTANCE" /> |
||||
<from coord="LEADER_POS" /> |
||||
<dist range="1.5:2" /> |
||||
</task> |
||||
|
||||
|
||||
<task if="is_leader"> |
||||
<fn str="AVOID" /> |
||||
<avoid str="ENEMY,MINE,PLAYER,NATURAL,SHOT_GOOD" /> |
||||
<weight num="1.5" /> |
||||
<range num="5" /> |
||||
<ignore_formation bool="true" /> |
||||
</task> |
||||
|
||||
<!-- END OF SNAKE CODE --> |
||||
|
||||
</driver> |
||||
</pack> |
@ -0,0 +1,340 @@ |
||||
<?xml version="1.0" encoding="UTF-8" ?> |
||||
|
||||
<!-- This file shows all that can be done in a driver. --> |
||||
|
||||
<!-- The root tag "pack" can contain multiple "driver" tags, but nothing else --> |
||||
<pack> |
||||
|
||||
<!-- Here we declare a driver --> |
||||
<driver name="driver1"> |
||||
|
||||
|
||||
<!-- TASKS AND CHECKS --> |
||||
|
||||
<!-- |
||||
|
||||
Inside a driver, there can be various task and check statements. |
||||
[Checks] test something in the drone's environment, and saves the result as a true/false flag. |
||||
[Tasks] perform some actual operation - shoot, steer, rotate and similar. |
||||
|
||||
Tasks can be contitioned by the results of Checks. |
||||
|
||||
There is a list of all existing tasks and checks lower - here for the sake of simplicity |
||||
we will use FAKE tasks and checks. |
||||
--> |
||||
|
||||
|
||||
<!-- the result of a "check" is stored to a flag whose name you declare here --> |
||||
<check id="ck" for="flag_name"> |
||||
<!-- some stuff here --> |
||||
</check> |
||||
|
||||
|
||||
<!-- |
||||
task executes only if the given flag is true. |
||||
Use | as OR, & as AND, and brakcets to group the flags. |
||||
|
||||
Example: |
||||
if="((A|B)&(C|D))|E" |
||||
if="canShoot" |
||||
--> |
||||
<task id="ts" if="flag_name"> |
||||
<!-- some stuff here --> |
||||
</check> |
||||
|
||||
|
||||
|
||||
|
||||
<!-- TASK CONTENTS --> |
||||
|
||||
<task id="fakeTask"> |
||||
|
||||
<!-- name of the function used to perform this check or task --> |
||||
<fn str="NAME_OF_THE__FUNCTION" /> |
||||
|
||||
<!-- here come arguments for the function --> |
||||
<argname argtype="argvalue" /> |
||||
|
||||
<!-- |
||||
Most tasks and checks take several arguments. |
||||
|
||||
Table of argument types: |
||||
|
||||
str -> "A string value." |
||||
|
||||
num -> Number, integer "12" or float "8.751" |
||||
(also work for numbers: int, float, double) |
||||
|
||||
bool -> Boolean. |
||||
Allowed values are "true", "false", "0", "1", "yes", "no" |
||||
|
||||
range -> numeric range |
||||
format: "MIN:MAX", eg. "-13:15.5" or "3:5" |
||||
Use RANGE in place of NUM to make it generate random number from range. |
||||
That can be used for all task functions. |
||||
|
||||
coord -> a coordinate, or a vector |
||||
format: "X_COORD;Z_COORD" |
||||
This is because the Sector's scene is flat, all is at Y=0 |
||||
You can use both integer and float numbers. |
||||
|
||||
Coord has one special feature: MAGIC VALUES! |
||||
If you declare the argument as coord, but stuff it with a "magic" string value, |
||||
it will become a dynamic coordinate, always returning calculated value of the |
||||
"magic" coordinate. Example: coord="MOVE_DIR" |
||||
|
||||
Magic values: |
||||
PLAYER_POS - player's current position |
||||
PLAYER_MOTION - player's current motion vector |
||||
|
||||
POS - current position |
||||
MOTION - current motion vector of this ship |
||||
|
||||
MOVE_DIR - same as MOTION |
||||
PLAYER_DIR - vector towards player ship |
||||
|
||||
--> |
||||
|
||||
<!-- real-life examples --> |
||||
<dir coord="PLAYER_DIR" /> |
||||
<fn str="FLY_TO_RECT" /> |
||||
<gap_shot num="3" /> |
||||
<gap_group range="3:5" /> |
||||
<hello str="world" /> |
||||
|
||||
</task> |
||||
|
||||
</driver> |
||||
|
||||
|
||||
|
||||
<!-- INHERITANCE --> |
||||
|
||||
<!-- |
||||
|
||||
Drivers can be extended, their tasks and checks overriden. |
||||
|
||||
Replacing task does not need to define the "if" and "for", unless you want |
||||
to replace their value with your own. |
||||
|
||||
It's illegal to extend driver not defined yet. If your drivers are spread |
||||
among multiple files, make sure they are properly ordered in the manifest file. |
||||
|
||||
--> |
||||
|
||||
<driver name="base_driver"> |
||||
|
||||
<!-- |
||||
"id" attribute of Task or Check contains an unique identifier of the task. |
||||
"id" is not required, but in case you want to extend your driver it is neccesary. |
||||
|
||||
Task with empty contents will be considered as abstract = do-nothing task. |
||||
--> |
||||
|
||||
<!-- here come some abstract tasks (will do nothing if not overriden) --> |
||||
<check for="flag1" id="myCheck"></check> |
||||
<task if="flag1" id="myTask"></task> |
||||
|
||||
<!-- Rotate task, implemented here - but can be overriden too. --> |
||||
<task id="rotateTask"> |
||||
<fn str="ROTATE" /> |
||||
<add num="-3" /> |
||||
</task> |
||||
|
||||
</driver> |
||||
|
||||
<!-- here is a driver extending "base_driver" --> |
||||
<driver name="droid" extends="base_driver"> |
||||
|
||||
<!-- this task will replace entirely a task "myTask" from "base_driver" --> |
||||
<!-- note that here we dont need to define the "if" condition - it's inherited. --> |
||||
<task replace="myTask"> |
||||
<fn str="SHOOT" /> |
||||
<count range="1" /> |
||||
<gap_group range="3" /> |
||||
<gun num="0" /> |
||||
</task> |
||||
|
||||
<!-- how to add new tasks --> |
||||
|
||||
<!-- this task is added newly, and is placed right after "rotateTask" from "base_driver" --> |
||||
<task id="steer" after="rotateTask"> |
||||
<!-- something here --> |
||||
</task> |
||||
|
||||
<!-- here we want to put this before "myCheck" --> |
||||
<task id="aim" before="myCheck"> |
||||
<!-- something here --> |
||||
</task> |
||||
|
||||
<!-- note: before and after keywords work in all tasks, not only when extending --> |
||||
|
||||
</driver> |
||||
|
||||
|
||||
|
||||
<!-- LIST OF ALL TASKS AND CHECKS --> |
||||
|
||||
<!-- Asterisk * indicates optional arguments. --> |
||||
|
||||
<driver name="library"> |
||||
|
||||
<!-- Steer towards given coordinate --> |
||||
<task> |
||||
<fn str="FLY_TO_POINT" /> |
||||
|
||||
<target coord="0;0" /> <!-- the target coordinate; exact coord or magic word, eg. PLAYER_POS --> |
||||
<weight num="1" /> <!-- * how fast to change direction (default 1) - can be float. --> |
||||
|
||||
<!-- if you do not define "target", you can use these: --> |
||||
<!-- target will be set to random coord in between, and preserved in memory --> |
||||
<x range="-3:3" /> |
||||
<z range="5:10" /> |
||||
|
||||
</task> |
||||
|
||||
|
||||
|
||||
<!-- Steer towards given rectangular zone --> |
||||
<task> |
||||
<fn str="FLY_TO_RECT" /> |
||||
|
||||
<x range="-3:3" /> <!-- The rectangular zone is defined by it's MIN and MAX coord - it is axis-aligned. --> |
||||
<z range="5:10" /> |
||||
|
||||
<weight num="1" /> <!-- * how fast to change direction (default 1) - can be float. --> |
||||
</task> |
||||
|
||||
|
||||
|
||||
<!-- |
||||
Homming missile AI |
||||
Locks to one particular enemy it selects, and then navigates to crash into it. |
||||
Should be used together with AVOID task |
||||
--> |
||||
<task> |
||||
<fn str="FOLLOW_TARGET" /> |
||||
|
||||
<target str="PLAYER,NATURAL" /> <!-- List of allowed targets (PLAYER, NATURAL, ENEMY, SHOT_GOOD, SHOT_BAD, POWERUP etc.) --> |
||||
<range num="60" /> <!-- * radar radius - zone from which the targets can be chosen --> |
||||
</task> |
||||
|
||||
|
||||
|
||||
<!-- |
||||
Magnetic missile AI |
||||
When gets close to a suitable enemy, flies towards it as if attracted by a magnet. |
||||
--> |
||||
<task> |
||||
<fn str="MAGNET" /> |
||||
|
||||
<target str="PLAYER,NATURAL" /> <!-- List of allowed targets (PLAYER, NATURAL, ENEMY, SHOT_GOOD, SHOT_BAD, POWERUP etc.) --> |
||||
<range num="15" /> <!-- * radar radius - zone from which the targets can be chosen --> |
||||
<weight num="1" /> <!-- * how fast to change direction (default 1) - can be float. --> |
||||
</task> |
||||
|
||||
|
||||
|
||||
<!-- Avoid enemies and obstacles --> |
||||
<task> |
||||
<fn str="AVOID" /> |
||||
|
||||
<range num="3" /> <!-- * max distance of obstacle to notice it (counted from surface of collider) --> |
||||
<weight num="1" /> <!-- * steering weight (default 1) --> |
||||
<square bool="false" /> <!-- * if enabled, the strength grows with proximity by square --> |
||||
<avoid str="NATURAL,SHOT_GOOD,SHOT_BAD,ENEMY" /> |
||||
</task> |
||||
|
||||
|
||||
|
||||
<!-- Add angle to rotation --> |
||||
<task> |
||||
<fn str="ROTATE" /> |
||||
|
||||
<add num="3" /> <!-- degrees to add --> |
||||
<random_dir bool="true" /> <!-- * direction is random (CW, CWW) - chosen when first run; default=false --> |
||||
</task> |
||||
|
||||
|
||||
|
||||
<!-- Rotate to direction --> |
||||
<task> |
||||
<fn str="TURN_TO" /> |
||||
|
||||
<dir coord="MOVE_DIR" /> <!-- vector X;Z, or "magic" keywords MOVE_DIR, PLAYER_DIR --> |
||||
</task> |
||||
|
||||
|
||||
|
||||
<!-- |
||||
Shoot a gun |
||||
|
||||
This task allows two types of operation: |
||||
X------X------X------X--- ... |
||||
X-X-X------X-X-X------X-X-X--- ... |
||||
(times are in seconds) |
||||
--> |
||||
<task> |
||||
<fn str="SHOOT" /> |
||||
|
||||
<count num="3" /> <!-- number of shots in a group --> |
||||
<gap_shot num="0.07" /> <!-- * gap between two shots in a group (optional if count=0) --> |
||||
<gap_group num="3" /> <!-- gap between two groups --> |
||||
|
||||
<gun num="0" /> <!-- * gun index, telling the drone which gun to fire --> |
||||
</task> |
||||
|
||||
|
||||
|
||||
<!-- Heal - in given interval adds health points to the drone's health meter --> |
||||
<task> |
||||
<fn str="HEAL" /> |
||||
|
||||
<gap num="1" /> <!-- gap (sec) betwen healings --> |
||||
<add num="5" /> <!-- health points to add --> |
||||
<percent bool="true" /> <!-- indicates that "heal" is in % of max health --> |
||||
</task> |
||||
|
||||
<!-- ### CHECKS ### --> |
||||
|
||||
<!-- |
||||
Check: can shoot in direction? |
||||
You can use this to make sure your shots won't hit an allied ship. |
||||
--> |
||||
<check for="x"> |
||||
<fn str="CAN_SHOOT" /> |
||||
|
||||
<spare str="ENEMY" /> <!-- list of entity types to spare (the allied entities) --> |
||||
<gun num="0" /> <!-- * index of the gun probed --> |
||||
</check> |
||||
|
||||
|
||||
|
||||
<!-- Check: is drone in a rectangular zone? --> |
||||
<check for="x"> |
||||
<fn str="IS_IN_RECT" /> |
||||
|
||||
<!-- The rectangular zone is defined by it's MIN and MAX coord - it is axis-aligned. --> |
||||
<x range="-3:3" /> |
||||
<z range="5:10" /> |
||||
</check> |
||||
|
||||
|
||||
|
||||
<!-- Check: is this ship a leader of the formation? --> |
||||
<check for="x"/> |
||||
<fn str="IS_LEADER" /> |
||||
</check> |
||||
|
||||
|
||||
|
||||
<!-- Check: is this ship a tail = last ship of the formation? --> |
||||
<check for="x"/> |
||||
<fn str="IS_TAIL" /> |
||||
</check> |
||||
|
||||
</driver> |
||||
|
||||
<!-- that's all, now you can start inventing your own AIs! --> |
||||
|
||||
</pack> |
@ -0,0 +1,38 @@ |
||||
<?xml version="1.0" encoding="UTF-8" ?> |
||||
|
||||
<pack> |
||||
<driver name="falcon" extends="basic_ship"> |
||||
|
||||
<check for="in_zone" id="ck1" after="can_fire"> |
||||
<fn str="IS_IN_RECT" /> |
||||
<x range="-20:20" /> |
||||
<z range="-5:45" /> |
||||
</check> |
||||
|
||||
<task replace="fire" if="can_fire&in_zone"> |
||||
<fn str="SHOOT" /> |
||||
<count range="6:15" /> |
||||
<gap_shot num="0.07" /> |
||||
<gap_group range="2:4" /> |
||||
<gun num="0" /> |
||||
</task> |
||||
|
||||
<task replace="fly"> |
||||
<fn str="FLY_TO_RECT" /> |
||||
<x range="-10-10" /> |
||||
<z range="25:40" /> |
||||
<weight num="10" /> |
||||
</task> |
||||
|
||||
<task replace="turn" if="!in_zone"> |
||||
<fn str="TURN_TO" /> |
||||
<dir coord="MOVE_DIR" /> |
||||
</task> |
||||
|
||||
<task after="turn" if="in_zone"> |
||||
<fn str="TURN_TO" /> |
||||
<dir coord="PLAYER_DIR" /> |
||||
</task> |
||||
|
||||
</driver> |
||||
</pack> |
@ -0,0 +1,19 @@ |
||||
<?xml version="1.0" encoding="UTF-8" ?> |
||||
|
||||
<pack> |
||||
<driver name="fighter" extends="basic_ship"> |
||||
|
||||
<task replace="fly"> |
||||
<fn str="FLY_TO_POINT" /> |
||||
<target coord="PLAYER_POS" /> |
||||
</task> |
||||
|
||||
<task replace="fire"> |
||||
<fn str="SHOOT" /> |
||||
<count num="1" /> |
||||
<gap_group num="3" /> |
||||
<gun num="0" /> |
||||
</task> |
||||
|
||||
</driver> |
||||
</pack> |
@ -0,0 +1,19 @@ |
||||
<?xml version="1.0" encoding="UTF-8" ?> |
||||
|
||||
<manifest> |
||||
|
||||
<!-- This file indicates the loading order of all the sibling files. --> |
||||
|
||||
<drivers> |
||||
<file>base.xml</file> |
||||
<file>burger.xml</file> |
||||
<file>fighter.xml</file> |
||||
<file>falcon.xml</file> |
||||
<file>bird.xml</file> |
||||
<file>shark.xml</file> |
||||
<file>cube.xml</file> |
||||
<file>powerup.xml</file> |
||||
<file>mine.xml</file> |
||||
</drivers> |
||||
|
||||
</manifest> |
@ -0,0 +1,15 @@ |
||||
<?xml version="1.0" encoding="UTF-8" ?> |
||||
|
||||
<pack> |
||||
|
||||
<driver name="mine"> |
||||
|
||||
<task> |
||||
<fn str="ROTATE" /> |
||||
<add num="3" /> |
||||
<random_dir bool="true" /> |
||||
</task> |
||||
|
||||
</driver> |
||||
|
||||
</pack> |
@ -0,0 +1,78 @@ |
||||
<?xml version="1.0" encoding="UTF-8" ?> |
||||
|
||||
<pack> |
||||
|
||||
<driver name="powerup_shield"> |
||||
|
||||
<check for="fly"> |
||||
<fn str="IS_IN_RECT" /> |
||||
<x range="-30;30" /> |
||||
<z range="0;100" /> |
||||
</check> |
||||
|
||||
<task> |
||||
<fn str="ROTATE" /> |
||||
<add num="3" /> |
||||
<random_dir bool="true" /> |
||||
</task> |
||||
|
||||
<task if="fly"> |
||||
<fn str="FLY_TO_RECT" /> |
||||
<x range="-2;2" /> |
||||
<z range="3;6" /> |
||||
<weight num="0.5" /> |
||||
</task> |
||||
|
||||
<task> |
||||
<fn str="MAGNET" /> |
||||
<range num="5" /> |
||||
<weight num="0.3" /> |
||||
<target str="PLAYER" /> |
||||
</task> |
||||
|
||||
<task> |
||||
<fn str="AVOID" /> |
||||
<range num="3" /> |
||||
<weight num="0.2" /> |
||||
<avoid str="NATURAL,ENEMY,MINE" /> |
||||
</task> |
||||
|
||||
</driver> |
||||
|
||||
<driver name="powerup_artifact"> |
||||
|
||||
<check for="fly"> |
||||
<fn str="IS_IN_RECT" /> |
||||
<x range="-30;30" /> |
||||
<z range="0;100" /> |
||||
</check> |
||||
|
||||
<task> |
||||
<fn str="ROTATE" /> |
||||
<add num="2.5" /> |
||||
<random_dir bool="true" /> |
||||
</task> |
||||
|
||||
<task if="fly"> |
||||
<fn str="FLY_TO_RECT" /> |
||||
<x range="-2;2" /> |
||||
<z range="3;8" /> |
||||
<weight num="0.5" /> |
||||
</task> |
||||
|
||||
<task> |
||||
<fn str="MAGNET" /> |
||||
<range num="20" /> |
||||
<weight num="0.6" /> |
||||
<target str="PLAYER" /> |
||||
</task> |
||||
|
||||
<task> |
||||
<fn str="AVOID" /> |
||||
<range num="3" /> |
||||
<weight num="0.2" /> |
||||
<avoid str="NATURAL,ENEMY,MINE" /> |
||||
</task> |
||||
|
||||
</driver> |
||||
</pack> |
@ -0,0 +1,61 @@ |
||||
<?xml version="1.0" encoding="UTF-8" ?> |
||||
|
||||
<pack> |
||||
<driver name="shark" extends="basic_ship"> |
||||
|
||||
<check for="in_zone1" id="ck1" after="can_fire"> |
||||
<fn str="IS_IN_RECT" /> |
||||
<x range="-20:20" /> |
||||
<z range="-5:60" /> |
||||
</check> |
||||
|
||||
<check for="in_zone2" id="ck2" after="ck1"> |
||||
<fn str="IS_IN_RECT" /> |
||||
<x range="-20:20" /> |
||||
<z range="-5:80" /> |
||||
</check> |
||||
|
||||
<task replace="fire" if="can_fire*in_zone1"> |
||||
<fn str="SHOOT" /> |
||||
<count range="4:8" /> |
||||
<bullets range="3:5" /> |
||||
<gap_group num="1.5" /> |
||||
<gap_shot num="0.02" /> |
||||
<gun num="0" /> <!--range="0-1" --> |
||||
</task> |
||||
|
||||
<task replace="avoid"> |
||||
<fn str="AVOID" /> |
||||
<avoid str="NATURAL,SHOT_GOOD,SHOT_BAD,ENEMY,MINE" /> |
||||
<weight num="1.7" /> |
||||
</task> |
||||
|
||||
<task replace="fly"> |
||||
<fn str="FLY_TO_RECT" /> |
||||
<x range="-5-5" /> |
||||
<z range="18:34" /> |
||||
<weight num="30" /> |
||||
</task> |
||||
|
||||
<task replace="turn" if="!in_zone1"> |
||||
<fn str="TURN_TO" /> |
||||
<dir coord="MOVE_DIR" /> |
||||
</task> |
||||
|
||||
<task id="t1" after="turn" if="in_zone1"> |
||||
<fn str="TURN_TO" /> |
||||
<dir coord="PLAYER_DIR" /> |
||||
</task> |
||||
|
||||
<!-- <TASK AFTER="T1" ID="T2" IF="IN_ZONE"> --> |
||||
<!-- <FN STR="SET_SPEED"/> --> |
||||
<!-- <SPEED NUM="0.5"/> --> |
||||
<!-- </TASK> --> |
||||
|
||||
<!-- <task after="t2" if="!in_zone"> --> |
||||
<!-- <fn str="SET_SPEED"/> --> |
||||
<!-- <speed num="1"/> --> |
||||
<!-- </task> --> |
||||
|
||||
</driver> |
||||
</pack> |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
After Width: | Height: | Size: 7.8 KiB |
After Width: | Height: | Size: 40 KiB |
After Width: | Height: | Size: 22 KiB |
After Width: | Height: | Size: 112 KiB |
@ -0,0 +1,108 @@ |
||||
<?xml version="1.0" encoding="UTF-8"?> |
||||
<level> |
||||
|
||||
<info> |
||||
<title>Ship Building Site</title> |
||||
<subtitle>Infinite money!</subtitle> |
||||
<author>MightyPork</author> |
||||
<minv>15</minv> |
||||
</info> |
||||
|
||||
|
||||
|
||||
<config> |
||||
<building>FREE</building> |
||||
<timer>30</timer> |
||||
</config> |
||||
|
||||
|
||||
<discoveries> |
||||
<all level="max" /> |
||||
</discoveries> |
||||
|
||||
|
||||
<sequence> |
||||
|
||||
<rockshift coord="0;-1" /> |
||||
|
||||
<rockgen id="rocks1" > |
||||
<type num="0" /> |
||||
<size range="2-8" /> |
||||
<speed num="1" /> |
||||
<rarity num="40" /> |
||||
<x range="-30:-18" /> |
||||
<z range="100-120" /> |
||||
</rockgen> |
||||
|
||||
<rockgen id="rocks2" > |
||||
<type num="1" /> |
||||
<size range="2-8" /> |
||||
<speed num="1" /> |
||||
<rarity num="30" /> |
||||
<x range="-18:-6" /> |
||||
<z range="100-120" /> |
||||
</rockgen> |
||||
|
||||
<rockgen id="rocks3" > |
||||
<type num="2" /> |
||||
<size range="2-8" /> |
||||
<speed num="1" /> |
||||
<rarity num="30" /> |
||||
<x range="-6:6" /> |
||||
<z range="100-120" /> |
||||
</rockgen> |
||||
|
||||
<rockgen id="rocks4" > |
||||
<type num="3" /> |
||||
<size range="2-8" /> |
||||
<speed num="1" /> |
||||
<rarity num="30" /> |
||||
<x range="6:18" /> |
||||
<z range="100-120" /> |
||||
</rockgen> |
||||
|
||||
<rockgen id="rocks5" > |
||||
<type num="4" /> |
||||
<size range="2-8" /> |
||||
<speed num="1" /> |
||||
<rarity num="40" /> |
||||
<x range="18:30" /> |
||||
<z range="100-120" /> |
||||
</rockgen> |
||||
|
||||
|
||||
|
||||
<shipgen id="mines" > |
||||
<entity str="mine" /> |
||||
<rarity num="50" /> |
||||
<x range="-10-10" /> |
||||
<z range="100-120" /> |
||||
</shipgen> |
||||
|
||||
<shipgen id="fighters" > |
||||
<entity str="fighter" /> |
||||
<rarity num="120" /> |
||||
<x range="-10-10" /> |
||||
<z range="100-120" /> |
||||
</shipgen> |
||||
|
||||
<shipgen id="burgers" > |
||||
<entity str="burger" /> |
||||
<rarity num="130" /> |
||||
<x range="-10-10" /> |
||||
<z range="100-120" /> |
||||
</shipgen> |
||||
|
||||
<shipgen id="burgers2" > |
||||
<entity str="burger" /> |
||||
<driver str="burger_mad" /> |
||||
<rarity num="180" /> |
||||
<x range="-10-10" /> |
||||
<z range="100-120" /> |
||||
</shipgen> |
||||
|
||||
<pause t="infinite"/> |
||||
|
||||
</sequence> |
||||
|
||||
</level> |
@ -0,0 +1,9 @@ |
||||
<?xml version="1.0" encoding="UTF-8" ?> |
||||
|
||||
<manifest> |
||||
|
||||
<levels> |
||||
<file>designer.xml</file> |
||||
</levels> |
||||
|
||||
</manifest> |
@ -0,0 +1,56 @@ |
||||
<?xml version="1.0" encoding="UTF-8"?> |
||||
<level> |
||||
|
||||
<!-- Level information --> |
||||
<info> |
||||
<title>TITLE</title> |
||||
<subtitle>DESCRIPTION</subtitle> |
||||
<author>AUTHOR</author> |
||||
<minv>MIN_GAME_VERSION</minv> |
||||
</info> |
||||
|
||||
<!-- Level configuration --> |
||||
<config> |
||||
<money>MONEY</money> |
||||
<timer>TIME_LIMIT (optional)</timer> |
||||
<building>LOCKED or NORMAL or FREE</building> |
||||
</config> |
||||
|
||||
|
||||
<!-- (optional) Default ship design --> |
||||
<ship></ship> |
||||
|
||||
|
||||
<!-- (optional) Custom drivers --> |
||||
<drivers></drivers> |
||||
|
||||
|
||||
<!-- levels of discoveries --> |
||||
<!-- level values: min = none = empty = 0 | max = full | default | number -> set level --> |
||||
<discoveries> |
||||
<all level="0" /> |
||||
|
||||
<discovery name="energy" level="1" /> |
||||
<discovery name="shield" level="1" /> |
||||
|
||||
<discovery name="body" level="1" /> |
||||
|
||||
<discovery name="engineRocket" level="1" /> |
||||
<discovery name="engineIon" level="1" /> |
||||
|
||||
<discovery name="cannon" level="1" /> |
||||
<discovery name="laser" level="1" /> |
||||
<discovery name="plasma" level="1" /> |
||||
<discovery name="rocket" level="1" /> |
||||
<discovery name="rocket_guided" level="1" /> |
||||
<discovery name="emp" level="1" /> |
||||
<discovery name="fireball" level="1" /> |
||||
</discoveries> |
||||
|
||||
|
||||
<!-- level sequence --> |
||||
<sequence> |
||||
</sequence> |
||||
|
||||
|
||||
</level> |
@ -0,0 +1,13 @@ |
||||
# Blender MTL File: 'None' |
||||
# Material Count: 1 |
||||
|
||||
newmtl Material.001 |
||||
Ns 92.156863 |
||||
Ka 0.000000 0.000000 0.000000 |
||||
Kd 0.512000 0.512000 0.512000 |
||||
Ks 0.000000 0.000000 0.000000 |
||||
Ni 1.000000 |
||||
d 0.000000 |
||||
illum 2 |
||||
map_Kd limestone.jpg |
||||
map_Disp limestone.jpg |
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,13 @@ |
||||
# Blender MTL File: 'None' |
||||
# Material Count: 1 |
||||
newmtl Material |
||||
Ns 96.078431 |
||||
Ka 0.000000 0.000000 0.000000 |
||||
Kd 0.640000 0.640000 0.640000 |
||||
Ks 0.000000 0.000000 0.000000 |
||||
Ni 1.000000 |
||||
d 1.000000 |
||||
illum 1 |
||||
map_Kd limestone.jpg |
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,13 @@ |
||||
# Blender MTL File: 'asteroid.blend' |
||||
# Material Count: 1 |
||||
newmtl Material |
||||
Ns 96.078431 |
||||
Ka 0.000000 0.000000 0.000000 |
||||
Kd 0.640000 0.640000 0.640000 |
||||
Ks 0.000000 0.000000 0.000000 |
||||
Ni 1.000000 |
||||
d 1.000000 |
||||
illum 1 |
||||
map_Kd limestone.jpg |
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,14 @@ |
||||
# Blender MTL File: 'asteroid.blend' |
||||
# Material Count: 1 |
||||
newmtl Material |
||||
Ns 96.078431 |
||||
Ka 0.000000 0.000000 0.000000 |
||||
Kd 0.640000 0.640000 0.640000 |
||||
Ks 0.000000 0.000000 0.000000 |
||||
Ni 1.000000 |
||||
d 1.000000 |
||||
illum 1 |
||||
map_Kd limestone.jpg |
||||
map_Bump limestone.jpg |
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,14 @@ |
||||
# Blender MTL File: 'asteroid.blend' |
||||
# Material Count: 1 |
||||
newmtl Material |
||||
Ns 96.078431 |
||||
Ka 0.000000 0.000000 0.000000 |
||||
Kd 0.640000 0.640000 0.640000 |
||||
Ks 0.000000 0.000000 0.000000 |
||||
Ni 1.000000 |
||||
d 1.000000 |
||||
illum 1 |
||||
map_Kd limestone.jpg |
||||
map_Bump limestone.jpg |
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
After Width: | Height: | Size: 26 KiB |
After Width: | Height: | Size: 145 KiB |
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue