Merge pull request #201 from uroskn/master

Minor fixes
This commit is contained in:
Shadow
2016-07-06 13:29:15 +03:00
committed by GitHub
124 changed files with 28 additions and 198 deletions
+10
View File
@@ -10,3 +10,13 @@ Desktop.ini
# Mac crap
.DS_Store
# Ignore generated config file
GameEngine/config.php
# Ignore generated prevention and notes
GameEngine/Prevention/*
GameEngine/Notes/*
# Install instalation_done marker left by install script
install/installation_done
Regular → Executable
View File
Regular → Executable
View File
Regular → Executable
View File
View File
View File
View File
View File
View File
Regular → Executable
View File
View File
View File
View File
View File
View File
View File
View File
View File
View File
View File
View File
View File
View File
View File
View File
View File
View File
View File
View File
View File
View File
View File
View File
View File
View File
View File
Regular → Executable
View File
Regular → Executable
View File
Regular → Executable
View File
View File
View File
View File
View File
View File
View File
Regular → Executable
View File
View File
View File
View File
View File
View File
Regular → Executable
View File
Regular → Executable
View File
Regular → Executable
View File
Regular → Executable
View File
Regular → Executable
View File
Regular → Executable
View File
Regular → Executable
View File
Regular → Executable
View File
Regular → Executable
View File
Regular → Executable
View File
Regular → Executable
View File
Regular → Executable
View File
Regular → Executable
View File
Regular → Executable
View File
Regular → Executable
View File
Regular → Executable
View File
Regular → Executable
View File
Regular → Executable
View File
Regular → Executable
View File
Regular → Executable
View File
Regular → Executable
-170
View File
@@ -134,17 +134,6 @@ class MYSQL_DB {
return $dbarray['id'];
}
function caststruc($user) {
//loop search village user
$query = mysql_query("SELECT * FROM ".TB_PREFIX."vdata WHERE owner = ".$user."");
while($villaggi_array = mysql_fetch_array($query))
//loop structure village
$query1 = mysql_query("SELECT * FROM ".TB_PREFIX."fdata WHERE vref = ".$villaggi_array['wref']."");
$strutture= mysql_fetch_array($query1);
return $strutture;
}
function removeMeSit($uid, $uid2) {
$q = "UPDATE " . TB_PREFIX . "users set sit1 = 0 where id = $uid and sit1 = $uid2";
mysql_query($q, $this->connection);
@@ -193,12 +182,6 @@ class MYSQL_DB {
return $this->mysql_fetch_all($result);
}
function getUnstarvation(){
$q = "SELECT * FROM " . TB_PREFIX . "vdata where starv = 0 and starvupdate = 0";
$result = mysql_query($q, $this->connection);
return $this->mysql_fetch_all($result);
}
function getActivateField($ref, $field, $mode) {
if(!$mode) {
$q = "SELECT $field FROM " . TB_PREFIX . "activate where id = '$ref'";
@@ -221,14 +204,6 @@ class MYSQL_DB {
}
}
function checkActivate($act) {
$q = "SELECT * FROM " . TB_PREFIX . "activate where act = '$act'";
$result = mysql_query($q, $this->connection);
$dbarray = mysql_fetch_array($result);
return $dbarray;
}
function sitterLogin($username, $password) {
$q = "SELECT sit1,sit2 FROM " . TB_PREFIX . "users where username = '$username' and access != " . BANNED;
$result = mysql_query($q, $this->connection);
@@ -328,16 +303,6 @@ class MYSQL_DB {
}
}
function checkactiveSession($username, $sessid) {
$q = "SELECT username FROM " . TB_PREFIX . "users where username = '$username' and sessid = '$sessid' LIMIT 1";
$result = mysql_query($q, $this->connection);
if(mysql_num_rows($result) != 0) {
return true;
} else {
return false;
}
}
function submitProfile($uid, $gender, $location, $birthday, $des1, $des2) {
$q = "UPDATE " . TB_PREFIX . "users set gender = $gender, location = '$location', birthday = '$birthday', desc1 = '$des1', desc2 = '$des2' where id = $uid";
return mysql_query($q, $this->connection);
@@ -778,19 +743,6 @@ class MYSQL_DB {
return mysql_fetch_array($result);
}
public function getVillageBattleData($vid) {
$q = "SELECT u.id,u.tribe,v.capital,f.f40 AS wall FROM ".TB_PREFIX."users u,".TB_PREFIX."fdata f,".TB_PREFIX."vdata v WHERE u.id=v.owner AND f.vref=v.wref AND v.wref=".$vid;
$result = mysql_query($q, $this->connection);
return mysql_fetch_array($result);
}
public function getPopulation($uid) {
$q = "SELECT sum(pop) AS pop FROM ".TB_PREFIX."vdata WHERE owner=".$uid;
$result = mysql_query($q, $this->connection);
$dbarray = mysql_fetch_array($result);
return $dbarray['pop'];
}
function getOasisV($vid) {
$q = "SELECT * FROM " . TB_PREFIX . "odata where wref = $vid";
$result = mysql_query($q, $this->connection);
@@ -861,24 +813,6 @@ class MYSQL_DB {
return $this->mysql_fetch_all($result);
}
//fix market log
function getMarketLog() {
$q = "SELECT id,wid,log from " . TB_PREFIX . "market_log where id != 0 ORDER BY id ASC";
$result = mysql_query($q, $this->connection);
return $this->mysql_fetch_all($result);
}
function getMarketLogVillage($village) {
$q = "SELECT wref,owner,name from " . TB_PREFIX . "vdata where wref =$village ";
$result = mysql_query($q, $this->connection);
return $this->mysql_fetch_all($result);
}
function getMarketLogUsers($id_user) {
$q = "SELECT id,username from " . TB_PREFIX . "users where id =$id_user ";
$result = mysql_query($q, $this->connection);
return $this->mysql_fetch_all($result);
}
//end fix
function getCoor($wref) {
if ($wref !=""){
$q = "SELECT x,y FROM " . TB_PREFIX . "wdata where id = $wref";
@@ -1434,12 +1368,6 @@ class MYSQL_DB {
return $dbarray['id'];
}
function getDiplomacy($aid) {
$q = "SELECT * FROM " . TB_PREFIX . "diplomacy WHERE id = $aid";
$result = mysql_query($q, $this->connection);
return $this->mysql_fetch_all($result);
}
function diplomacyCancelOffer($id) {
$q = "DELETE FROM " . TB_PREFIX . "diplomacy WHERE id = $id";
return mysql_query($q, $this->connection);
@@ -1842,24 +1770,6 @@ class MYSQL_DB {
}
}
function getDelSent($uid) {
$q = "SELECT * FROM " . TB_PREFIX . "mdata WHERE owner = $uid and delowner = 1 ORDER BY time DESC";
$result = mysql_query($q, $this->connection);
return $this->mysql_fetch_all($result);
}
function getDelInbox($uid) {
$q = "SELECT * FROM " . TB_PREFIX . "mdata WHERE target = $uid and deltarget = 1 ORDER BY time DESC";
$result = mysql_query($q, $this->connection);
return $this->mysql_fetch_all($result);
}
function getDelArchive($uid) {
$q = "SELECT * FROM " . TB_PREFIX . "mdata WHERE target = $uid and archived = 1 and deltarget = 1 OR owner = $uid and archived = 1 and delowner = 1 ORDER BY time DESC";
$result = mysql_query($q, $this->connection);
return $this->mysql_fetch_all($result);
}
function unarchiveNotice($id) {
$q = "UPDATE " . TB_PREFIX . "ndata set ntype = archive, archive = 0 where id = $id";
return mysql_query($q, $this->connection);
@@ -2550,17 +2460,6 @@ class MYSQL_DB {
return mysql_query($q, $this->connection);
}
function modifyHeroByOwner($column,$value,$uid,$mode=0) {
if(!$mode) {
$q = "UPDATE `".TB_PREFIX."hero` SET $column = $value WHERE uid = $uid";
} elseif($mode=1) {
$q = "UPDATE `".TB_PREFIX."hero` SET $column = $column + $value WHERE uid = $uid";
} else {
$q = "UPDATE `".TB_PREFIX."hero` SET $column = $column - $value WHERE uid = $uid";
}
return mysql_query($q, $this->connection);
}
function modifyHeroXp($column,$value,$heroid) {
$q = "UPDATE ".TB_PREFIX."hero SET $column = $column + $value WHERE uid=$heroid";
return mysql_query($q, $this->connection);
@@ -2612,13 +2511,6 @@ class MYSQL_DB {
return $this->mysql_fetch_all($result);
}
function countTraining($vid) {
$q = "SELECT * FROM " . TB_PREFIX . "training WHERE vref = $vid";
$result = mysql_query($q, $this->connection);
$row = mysql_fetch_row($result);
return $row[0];
}
function trainUnit($vid, $unit, $amt, $pop, $each, $time, $mode) {
global $village, $building, $session, $technology;
@@ -2881,30 +2773,6 @@ class MYSQL_DB {
}
}
/***************************
Function to get world wonder level!
Made by: Dzoki
***************************/
function getWWLevel($vref) {
$q = "SELECT f99 FROM " . TB_PREFIX . "fdata WHERE vref = $vref";
$result = mysql_query($q, $this->connection) or die(mysql_error());
$dbarray = mysql_fetch_array($result);
return $dbarray['f99'];
}
/***************************
Function to get world wonder owner ID!
Made by: Dzoki
***************************/
function getWWOwnerID($vref) {
$q = "SELECT owner FROM " . TB_PREFIX . "vdata WHERE wref = $vref";
$result = mysql_query($q, $this->connection) or die(mysql_error());
$dbarray = mysql_fetch_array($result);
return $dbarray['owner'];
}
/***************************
Function to get user alliance name!
Made by: Dzoki
@@ -2940,10 +2808,6 @@ class MYSQL_DB {
}
//medal functions
function addclimberpop($user, $cp) {
$q = "UPDATE " . TB_PREFIX . "users set Rc = Rc + '$cp' where id = $user";
return mysql_query($q, $this->connection);
}
function addclimberrankpop($user, $cp) {
$q = "UPDATE " . TB_PREFIX . "users set clp = clp + '$cp' where id = $user";
return mysql_query($q, $this->connection);
@@ -2960,15 +2824,7 @@ class MYSQL_DB {
$q = "UPDATE " . TB_PREFIX . "users set oldrank = '$cp' where id = $user";
return mysql_query($q, $this->connection);
}
function removeclimberpop($user, $cp) {
$q = "UPDATE " . TB_PREFIX . "users set Rc = Rc - '$cp' where id = $user";
return mysql_query($q, $this->connection);
}
// ALLIANCE MEDAL FUNCTIONS
function addclimberpopAlly($user, $cp) {
$q = "UPDATE " . TB_PREFIX . "alidata set Rc = Rc + '$cp' where id = $user";
return mysql_query($q, $this->connection);
}
function addclimberrankpopAlly($user, $cp) {
$q = "UPDATE " . TB_PREFIX . "alidata set clp = clp + '$cp' where id = $user";
return mysql_query($q, $this->connection);
@@ -2981,10 +2837,6 @@ class MYSQL_DB {
$q = "UPDATE " . TB_PREFIX . "alidata set oldrank = '$cp' where id = $user";
return mysql_query($q, $this->connection);
}
function removeclimberpopAlly($user, $cp) {
$q = "UPDATE " . TB_PREFIX . "alidata set Rc = Rc - '$cp' where id = $user";
return mysql_query($q, $this->connection);
}
function getTrainingList() {
$q = "SELECT * FROM " . TB_PREFIX . "training where vref != ''";
@@ -3073,22 +2925,6 @@ class MYSQL_DB {
return $dbarray['crop'];
}
function Getowner($vid) {
$s = "SELECT owner FROM " . TB_PREFIX . "vdata where wref = $vid";
$result1 = mysql_query($s, $this->connection);
$row1 = mysql_fetch_row($result1);
return $row1[0];
}
public function debug($time, $uid, $debug_info) {
$q = "INSERT INTO " . TB_PREFIX . "debug_info (time,uid,debug_info) VALUES ($time,$uid,$debug_info)";
if(mysql_query($q, $this->connection)) {
return mysql_insert_id($this->connection);
} else {
return false;
}
}
function populateOasisdata() {
$q2 = "SELECT * FROM " . TB_PREFIX . "wdata where oasistype != 0";
$result2 = mysql_query($q2, $this->connection);
@@ -3211,12 +3047,6 @@ class MYSQL_DB {
return mysql_fetch_array($result);
}
function getOwnArtefactInfo2($vref) {
$q = "SELECT * FROM " . TB_PREFIX . "artefacts WHERE vref = $vref";
$result = mysql_query($q, $this->connection);
return $this->mysql_fetch_all($result);
}
function getOwnArtefactInfo3($uid) {
$q = "SELECT * FROM " . TB_PREFIX . "artefacts WHERE owner = $uid";
$result = mysql_query($q, $this->connection);
View File
Regular → Executable
View File
Regular → Executable
View File
View File
Regular → Executable
View File
Regular → Executable
+3 -8
View File
@@ -148,17 +148,12 @@ if (date('Ymd',time()) == date('Ymd',$time)) {
}
public function pageLoadTimeStart() {
$starttime = microtime();
$startarray = explode(" ", $starttime);
//$starttime = $startarray[1] + $startarray[0];
return $startarray[0];
if (isset($_SERVER["REQUEST_TIME_FLOAT"])) return $_SERVER["REQUEST_TIME_FLOAT"];
return microtime(true);
}
public function pageLoadTimeEnd() {
$endtime = microtime();
$endarray = explode(" ", $endtime);
//$endtime = $endarray[1] + $endarray[0];
return $endarray[0];
return microtime(true);
}
};
Regular → Executable
View File
Regular → Executable
View File
Regular → Executable
View File
Regular → Executable
View File
Regular → Executable
View File
Regular → Executable
View File
Regular → Executable
View File
Regular → Executable
View File
Regular → Executable
View File
Regular → Executable
View File
View File
Regular → Executable
View File
Regular → Executable
View File
Regular → Executable
View File
Regular → Executable
View File
Regular → Executable
View File
Regular → Executable
View File
Regular → Executable
View File
Regular → Executable
View File
Regular → Executable
View File
Regular → Executable
View File
Regular → Executable
View File

Some files were not shown because too many files have changed in this diff Show More