first commit

This commit is contained in:
unknown
2012-03-29 13:00:34 +02:00
commit 6928cbcd1d
2446 changed files with 85772 additions and 0 deletions
+62
View File
@@ -0,0 +1,62 @@
<?php
//////////////////////////////////////////////////////////////////////////////////////////////////////
// TRAVIANX //
// Only for advanced users, do not edit if you dont know what are you doing! //
// Made by: Dzoki & Dixie (TravianX) //
// - TravianX = Travian Clone Project - //
// DO NOT REMOVE COPYRIGHT NOTICE! //
//////////////////////////////////////////////////////////////////////////////////////////////////////
include("constant.php");
class MYSQLi_DB {
var $connection;
function MYSQLi_DB() {
$this->connection = mysqli_connect(SQL_SERVER, SQL_USER, SQL_PASS, SQL_DB) or die(mysqli_error());
}
function query($query) {
return $this->connection->query($query);
}
};
class MYSQL_DB {
var $connection;
function MYSQL_DB() {
$this->connection = mysql_connect(SQL_SERVER, SQL_USER, SQL_PASS) or die(mysql_error());
mysql_select_db(SQL_DB, $this->connection) or die(mysql_error());
}
function mysql_exec_batch ($p_query, $p_transaction_safe = true) {
if ($p_transaction_safe) {
$p_query = 'START TRANSACTION;' . $p_query . '; COMMIT;';
};
$query_split = preg_split ("/[;]+/", $p_query);
foreach ($query_split as $command_line) {
$command_line = trim($command_line);
if ($command_line != '') {
$query_result = mysql_query($command_line);
if ($query_result == 0) {
break;
};
};
};
return $query_result;
}
function query($query) {
return mysql_query($query, $this->connection);
}
};
if(DB_TYPE) {
$database = new MYSQLi_DB;
}
else {
$database = new MYSQL_DB;
}
?>
+31
View File
@@ -0,0 +1,31 @@
<?php
include ("../../GameEngine/Database.php");
include ("../../GameEngine/Admin/database.php");
include ("../../GameEngine/config.php");
include ("../../GameEngine/Lang/" . LANG . ".php");
mysql_connect(SQL_SERVER, SQL_USER, SQL_PASS);
mysql_select_db(SQL_DB);
if(isset($_POST['mhpw'])) {
$password = $_POST['mhpw'];
mysql_query("UPDATE " . TB_PREFIX . "users SET password = '" . md5($password) . "' WHERE username = 'Multihunter'");
$wid = $admin->getWref(0, 0);
$uid = 5;
$status = $database->getVillageState($wid);
if($status == 0) {
$database->setFieldTaken($wid);
$database->addVillage($wid, $uid, 'Multihunter', '5');
$database->addResourceFields($wid, $database->getVillageType($wid));
$database->addUnits($wid);
$database->addTech($wid);
$database->addABTech($wid);
}
}
header("Location: ../index.php?s=5");
?>
+21
View File
@@ -0,0 +1,21 @@
<?php
include ("../../GameEngine/Database.php");
include ("../../GameEngine/Admin/database.php");
include ("../../GameEngine/config.php");
mysql_connect(SQL_SERVER, SQL_USER, SQL_PASS);
mysql_select_db(SQL_DB);
$database->populateOasisdata();
$database->populateOasis();
$database->populateOasisUnitsHigh();
header("Location: ../index.php?s=6");
?>
+112
View File
@@ -0,0 +1,112 @@
<?php
//////////////////////////////////////////////////////////////////////////////////////////////////////
// TRAVIANX //
// Only for advanced users, do not edit if you dont know what are you doing! //
// Made by: Dzoki & Dixie (TravianX) //
// - TravianX = Travian Clone Project - //
// DO NOT REMOVE COPYRIGHT NOTICE! //
//////////////////////////////////////////////////////////////////////////////////////////////////////
include("database.php");
$xyas=(1+(2*WORLD_MAX));
for($i=0; $i<$xyas; $i++){
$y=(WORLD_MAX-$i);
for($j=0; $j<$xyas; $j++){
$x=((WORLD_MAX*-1)+$j);
//choose a field type
$rand=rand(1, 1000);
if("10" >= $rand){
$typ='1';
$otype='0';
} else if("90" >= $rand){
$typ='2';
$otype='0';
} else if("400" >= $rand){
$typ='3';
$otype='0';
} else if("480" >= $rand){
$typ='4';
$otype='0';
} else if("560" >= $rand){
$typ='5';
$otype='0';
} else if("570" >= $rand){
$typ='6';
$otype='0';
} else if("600" >= $rand){
$typ='7';
$otype='0';
} else if("630" >= $rand){
$typ='8';
$otype='0';
} else if("660" >= $rand){
$typ='9';
$otype='0';
} else if("740" >= $rand){
$typ='10';
$otype='0';
} else if("820" >= $rand){
$typ='11';
$otype='0';
} else if("900" >= $rand){
$typ='12';
$otype='0';
} else if("908" >= $rand){
$typ='0';
$otype='1';
} else if("916" >= $rand){
$typ='0';
$otype='2';
} else if("924" >= $rand){
$typ='0';
$otype='3';
} else if("932" >= $rand){
$typ='0';
$otype='4';
} else if("940" >= $rand){
$typ='0';
$otype='5';
} else if("948" >= $rand){
$typ='0';
$otype='6';
} else if("956" >= $rand){
$typ='0';
$otype='7';
} else if("964" >= $rand){
$typ='0';
$otype='8';
} else if("972" >= $rand){
$typ='0';
$otype='9';
} else if("980" >= $rand){
$typ='0';
$otype='10';
} else if("988" >= $rand){
$typ='0';
$otype='11';
} else {
$typ='0';
$otype='12';
}
//image pick
if($otype=='0'){
$image="t".rand(0,9)."";
} else {
$image="o".$otype."";
}
//into database
$q = "INSERT into ".TB_PREFIX."wdata values (0,'".$typ."','".$otype."','".$x."','".$y."',0,'".$image."')";
$database->query($q);
}
}
header("Location: ../index.php?s=4");
?>