started to fix defence reports icons and farmlist and fix deleting oasis that you own and links

This commit is contained in:
unknown
2012-04-07 03:41:50 +03:00
parent 634c3406fb
commit bf27475b88
13 changed files with 1294 additions and 11 deletions
+3 -3
View File
@@ -780,7 +780,7 @@ private function loyaltyRegeneration() {
--------------------------------*/
}else{
$Attacker['id'] = $database->getUserField($database->getVillageField($data['from'],"owner"),"id",0);
$Defender['id'] = 3;
$Defender['id'] = 2;
$owntribe = $database->getUserField($database->getVillageField($data['from'],"owner"),"tribe",0);
$targettribe = 4;
@@ -1849,9 +1849,9 @@ private function loyaltyRegeneration() {
}
}
else {
if($unitssend_def[1] == 0 and $unitssend_def[2] == 0 and $unitssend_def[3] == 0 and $unitssend_def[4] == 0 and $unitssend_def[5] == 0 and $unitssend_def[6] == 0){
if($unitssend_def[1] == '0,0,0,0,0,0,0,0,0,0' and $unitssend_def[2] == '0,0,0,0,0,0,0,0,0,0' and $unitssend_def[3] == '0,0,0,0,0,0,0,0,0,0' and $unitssend_def[4] == '0,0,0,0,0,0,0,0,0,0' and $unitssend_def[5] == '0,0,0,0,0,0,0,0,0,0'){
$database->addNotice($to['owner'],$to['wref'],$targetally,7,''.addslashes($from['name']).' attacks '.addslashes($to['name']).'',$data2,$AttackArrivalTime);
}else if($totaldead_def == 0){
}else if($totaldead_def == '0,0,0,0,0,0,0,0,0,0'){
$database->addNotice($to['owner'],$to['wref'],$targetally,4,''.addslashes($from['name']).' attacks '.addslashes($to['name']).'',$data2,$AttackArrivalTime);
}else if($unitssend_def > $totaldead_def){
$database->addNotice($to['owner'],$to['wref'],$targetally,5,''.addslashes($from['name']).' attacks '.addslashes($to['name']).'',$data2,$AttackArrivalTime);
+60 -1
View File
@@ -576,6 +576,11 @@
}
}
}
function removeOases($wref) {
$q = "UPDATE ".TB_PREFIX."odata SET conqured = 0, owner = 2, name = 'Unoccupied Oasis' WHERE wref = $wref";
return mysql_query($q, $this->connection);
}
/***************************
@@ -2471,9 +2476,63 @@
$q = 'SELECT * FROM `' . TB_PREFIX . 'links` WHERE `userid` = ' . $id . ' ORDER BY `pos` ASC';
return mysql_query($q, $this->connection);
}
function removeLinks($id){
$q = "DELETE FROM " . TB_PREFIX . "links WHERE `id` = ".$id."";
return mysql_query($q, $this->connection);
}
function getArrayMemberVillage($uid){
function getVilFarmlist($wref){
$q = 'SELECT * FROM ' . TB_PREFIX . 'farmlist WHERE wref = ' . $wref . ' ORDER BY wref ASC';
$result = mysql_query($q, $this->connection);
$dbarray = mysql_fetch_array($result);
if($dbarray['id']!=0) {
return true;
} else {
return false;
}
}
function getRaidList($id) {
$q = "SELECT * FROM " . TB_PREFIX . "raidlist WHERE id = ".$id."";
$result = mysql_query($q, $this->connection);
return mysql_fetch_array($result);
}
function delFarmList($id, $owner) {
$q = "DELETE FROM " . TB_PREFIX . "farmlist where id = $id and owner = $owner";
return mysql_query($q, $this->connection);
}
function delSlotFarm($id) {
$q = "DELETE FROM " . TB_PREFIX . "raidlist where id = $id";
return mysql_query($q, $this->connection);
}
function createFarmList($wref, $owner, $name) {
$q = "INSERT INTO " . TB_PREFIX . "farmlist (`wref`, `owner`, `name`) VALUES ('$wref', '$owner', '$name')";
return mysql_query($q, $this->connection);
}
function addSlotFarm($lid, $towref, $x, $y, $distance, $t1, $t2, $t3, $t4, $t5, $t6, $t7, $t8, $t9, $t10) {
$q = "INSERT INTO " . TB_PREFIX . "raidlist (`lid`, `towref`, `x`, `y`, `distance`, `t1`, `t2`, `t3`, `t4`, `t5`, `t6`, `t7`, `t8`, `t9`, `t10`) VALUES ('$lid', '$towref', '$x', '$y', '$distance', '$t1', '$t2', '$t3', '$t4', '$t5', '$t6', '$t7', '$t8', '$t9', '$t10')";
return mysql_query($q, $this->connection);
}
function editSlotFarm($eid, $lid, $wref, $x, $y, $dist, $t1, $t2, $t3, $t4, $t5, $t6, $t7, $t8, $t9, $t10) {
$q = "UPDATE " . TB_PREFIX . "raidlist set lid = '$lid', towref = '$wref', x = '$x', y = '$y', t1 = '$t1', t2 = '$t2', t3 = '$t3', t4 = '$t4', t5 = '$t5', t6 = '$t6', t7 = '$t7', t8 = '$t8', t9 = '$t9', t10 = '$t10' WHERE id = $eid";
return mysql_query($q, $this->connection);
}
function getArrayMemberVillage($uid){
$q = 'SELECT a.wref, a.name, b.x, b.y from '.TB_PREFIX.'vdata AS a left join '.TB_PREFIX.'wdata AS b ON b.id = a.wref where owner = '.$uid.' order by capital DESC,pop DESC';
$result = mysql_query($q, $this->connection);