more updates

This commit is contained in:
unknown
2012-06-24 16:21:41 +03:00
parent 4a62e1820b
commit 1ab732f22f
10 changed files with 46 additions and 33 deletions
+16 -3
View File
@@ -206,6 +206,7 @@ class Automation {
$this->checkInvitedPlayes();
$this->updateStore();
$this->procClimbers();
$this->CheckBan();
}
private function loyaltyRegeneration() {
@@ -3834,8 +3835,8 @@ $crannyimg = "<img src=\"".GP_LOCATE."img/g/g23.gif\" height=\"20\" width=\"15\"
}
}
private function procClimbers() {
global $database, $ranking;
private function procClimbers() {
global $database, $ranking;
$users = "SELECT * FROM " . TB_PREFIX . "users WHERE access < " . (INCLUDE_ADMIN ? "10" : "8") . "";
$array = $database->query_return($users);
$ranking->procRankArray();
@@ -3890,7 +3891,19 @@ $crannyimg = "<img src=\"".GP_LOCATE."img/g/g23.gif\" height=\"20\" width=\"15\"
}
}
}
}
}
private function checkBan() {
global $database;
$time = time();
$q = "SELECT * FROM ".TB_PREFIX."banlist WHERE active = 1 and end < $time";
$array = $database->query_return($q);
foreach($array as $banlist) {
mysql_query("UPDATE ".TB_PREFIX."banlist SET active = 0 WHERE id = ".$banlist['id']."");
mysql_query("UPDATE ".TB_PREFIX."users SET access = 2 WHERE id = ".$banlist['uid']."");
}
}
}
$automation = new Automation;
?>
+12
View File
@@ -312,6 +312,7 @@ class Building {
}
}
$level = $database->getResourceLevel($village->wid);
if($session->access!=BANNED){
if($database->addBuilding($village->wid,$id,$village->resarray['f'.$id.'t'],$loop,$time+($loop==1?ceil(60/SPEED):0),0,$level['f'.$id] + 1 + count($database->getBuildingByField($village->wid,$id)))) {
$database->modifyResource($village->wid,$uprequire['wood'],$uprequire['clay'],$uprequire['iron'],$uprequire['crop'],0);
$logging->addBuildLog($village->wid,$this->procResType($village->resarray['f'.$id.'t']),($village->resarray['f'.$id]+($loopsame>0?2:1)),0);
@@ -322,6 +323,9 @@ class Building {
header("Location: dorf1.php");
}
}
}else{
header("Location: banned.php");
}
}
}
@@ -352,11 +356,15 @@ class Building {
$time = $this->buildArray[0]['timestamp'] + round($dataarray[$village->resarray['f'.$id]-1]['time'] / 4);
}
}
if($session->access!=BANNED){
$level = $database->getResourceLevel($village->wid);
if($database->addBuilding($village->wid,$id,$village->resarray['f'.$id.'t'],$loop,$time,0,0,$level['f'.$id] + 1 + count($database->getBuildingByField($village->wid,$id)))) {
$logging->addBuildLog($village->wid,$this->procResType($village->resarray['f'.$id.'t']),($village->resarray['f'.$id]-1),2);
header("Location: dorf2.php");
}
}else{
header("Location: banned.php");
}
}
}
@@ -383,12 +391,16 @@ class Building {
}
}
if($this->meetRequirement($tid)) {
if($session->access!=BANNED){
$level = $database->getResourceLevel($village->wid);
if($database->addBuilding($village->wid,$id,$tid,$loop,$time,0,$level['f'.$id] + 1 + count($database->getBuildingByField($village->wid,$id)))) {
$logging->addBuildLog($village->wid,$this->procResType($tid),($village->resarray['f'.$id]+1),1);
$database->modifyResource($village->wid,$uprequire['wood'],$uprequire['clay'],$uprequire['iron'],$uprequire['crop'],0);
header("Location: dorf2.php");
}
}else{
header("Location: banned.php");
}
}
}
}
+8 -1
View File
@@ -250,6 +250,7 @@ class Units {
header("Location: a2b.php");
} else {
if($session->access != BANNED){
if($session->tribe == 1){ $u = ""; } elseif($session->tribe == 2){ $u = "1"; } elseif($session->tribe == 3){ $u = "2"; }elseif($session->tribe == 4){ $u = "3"; }else {$u = "4"; }
@@ -334,11 +335,14 @@ class Units {
}
header("Location: build.php?id=39");
}else{
header("Location: banned.php");
}
}}
private function sendTroopsBack($post) {
global $form, $database, $village, $generator, $session, $technology;
if($session->access != BANNED){
$enforce=$database->getEnforceArray($post['ckey'],0);
if(($enforce['from']==$village->wid) || ($enforce['vref']==$village->wid)){
$to = $database->getVillage($enforce['from']);
@@ -459,6 +463,9 @@ class Units {
header("Location: a2b.php");
}
}
}else{
header("Location: banned.php");
}
}
public function Settlers($post) {
+5 -5
View File
@@ -20,7 +20,7 @@
<th></th>
<th>Subject</th>
<th>Recipient</th>
<th class="sent"><a href="nachrichten.php?s=0&amp;t=2&amp;o=1">Sent</a></th>
<th class="sent"><a href="nachrichten.php?t=2&s=0&amp;t=2&amp;o=1">Sent</a></th>
</tr></thead><tfoot><tr><th><?php
$MyGold = mysql_query("SELECT * FROM ".TB_PREFIX."users WHERE `username`='".$session->username."'") or die(mysql_error());
$golds = mysql_fetch_array($MyGold);
@@ -34,17 +34,17 @@
echo "&laquo;&raquo;";
}
else if (!isset($_GET['s']) && count($message->sent1) > 10) {
echo "&laquo;<a href=\"?s=10&o=0\">&raquo;</a>";
echo "&laquo;<a href=\"?t=2&s=10&o=0\">&raquo;</a>";
}
else if(isset($_GET['s']) && count($message->sent1) > $_GET['s']) {
if(count($message->sent1) > ($_GET['s']+10) && $_GET['s']-10 < count($message->sent1) && $_GET['s'] != 0) {
echo "<a href=\"?s=".($_GET['s']-10)."&o=0\">&laquo;</a><a href=\"?s=".($_GET['s']+10)."&o=0\">&raquo;</a>";
echo "<a href=\"?t=2&s=".($_GET['s']-10)."&o=0\">&laquo;</a><a href=\"?t=2&s=".($_GET['s']+10)."&o=0\">&raquo;</a>";
}
else if(count($message->sent1) > $_GET['s']+10) {
echo "&laquo;<a href=\"?s=".($_GET['s']+10)."&o=0\">&raquo;</a>";
echo "&laquo;<a href=\"?t=2&s=".($_GET['s']+10)."&o=0\">&raquo;</a>";
}
else {
echo "<a href=\"?s=".($_GET['s']-10)."&o=0\">&laquo;</a>&raquo;";
echo "<a href=\"?t=2&s=".($_GET['s']-10)."&o=0\">&laquo;</a>&raquo;";
}
}
?></th></tr></tfoot>
-4
View File
@@ -78,7 +78,6 @@ $end = ($tribe*10);
?>
<h1><?php echo $actionType." to ".$process[1]; ?></h1>
<?php if($session->access != BANNED){ ?>
<form method="post" action="a2b.php">
<table id="short_info" cellpadding="1" cellspacing="1">
@@ -434,7 +433,4 @@ class="dynamic_img " src="img/x.gif" alt="OK" type="image" onclick="if (this.dis
<?php } ?>
</form>
<?php
}
else{header("Location: banned.php");}?>
</div>
-4
View File
@@ -1,5 +1,4 @@
<?php
if($session->access != BANNED){
$to = $database->getVillage($enforce['from']);
$fromcoor = $database->getCoor($enforce['from']);
$tocoor = $database->getCoor($enforce['vref']);
@@ -178,7 +177,4 @@ $tocoor = $database->getCoor($enforce['vref']);
<p class="btn"><input value="ok" name="s1" id="btn_ok" class="dynamic_img " src="img/x.gif" alt="OK" type="image" onclick="if (this.disabled==false) {document.getElementsByTagName('form')[0].submit();} this.disabled=true;" onLoad="this.disabled=false;"></p>
</form>
<?php
}
else{header("Location: banned.php");}?>
</div>
-4
View File
@@ -1,5 +1,4 @@
<?php
if($session->access != BANNED){
$to = $database->getVillage($enforce['from']);
$fromcoor = $database->getCoor($enforce['from']);
$tocoor = $database->getCoor($enforce['vref']);
@@ -179,7 +178,4 @@ $tocoor = $database->getCoor($enforce['vref']);
<p class="btn"><input value="ok" name="s1" id="btn_ok" class="dynamic_img " src="img/x.gif" alt="OK" type="image" onclick="if (this.disabled==false) {document.getElementsByTagName('form')[0].submit();} this.disabled=true;" onLoad="this.disabled=false;"></p>
</form>
<?php
}
else{header("Location: banned.php");}?>
</div>
-4
View File
@@ -1,5 +1,4 @@
<?php
if($session->access != BANNED){
$to = $database->getVillage($enforce['from']);
$fromcoor = $database->getCoor($enforce['from']);
$tocoor = $database->getCoor($enforce['vref']);
@@ -178,7 +177,4 @@ $tocoor = $database->getCoor($enforce['vref']);
<p class="btn"><input value="ok" name="s1" id="btn_ok" class="dynamic_img " src="img/x.gif" alt="OK" type="image" onclick="if (this.disabled==false) {document.getElementsByTagName('form')[0].submit();} this.disabled=true;" onLoad="this.disabled=false;"></p>
</form>
<?php
}
else{header("Location: banned.php");}?>
</div>
-4
View File
@@ -1,5 +1,4 @@
<?php
if($session->access != BANNED){
$to = $database->getVillage($enforce['from']);
$fromcoor = $database->getCoor($enforce['from']);
$tocoor = $database->getCoor($enforce['vref']);
@@ -179,7 +178,4 @@ $tocoor = $database->getCoor($enforce['vref']);
<p class="btn"><input value="ok" name="s1" id="btn_ok" class="dynamic_img " src="img/x.gif" alt="OK" type="image" onclick="if (this.disabled==false) {document.getElementsByTagName('form')[0].submit();} this.disabled=true;" onLoad="this.disabled=false;"></p>
</form>
<?php
}
else{header("Location: banned.php");}?>
</div>
+5 -4
View File
@@ -163,7 +163,7 @@ if($routeaccess = 1){
}
}
}
if($session->goldclub == 1 && $session->access != BANNED){
if($session->goldclub == 1){
if(isset($_GET['t'])==99) {
if($_GET['action'] == 'addList') {
@@ -191,7 +191,11 @@ if($session->goldclub == 1 && $session->access != BANNED){
header("Location: build.php?id=39&t=99");
}
if($_POST['action'] == 'startRaid'){
if($session->access != BANNED){
include ("Templates/a2b/startRaid.tpl");
}else{
header("Location: banned.php");
}
}
if(isset($_GET['slid']) && is_numeric($_GET['slid'])) {
@@ -216,9 +220,6 @@ if($session->goldclub == 1 && $session->access != BANNED){
}
}else{
$create = 0;
if($session->access == BANNED){
header("Location: banned.php");
}
}
if (isset($_POST['a']) == 533374 && isset($_POST['id']) == 39){