From 1ab732f22fe978901b33298d6d3846ce7c240d2c Mon Sep 17 00:00:00 2001 From: unknown Date: Sun, 24 Jun 2012 16:21:41 +0300 Subject: [PATCH] more updates --- GameEngine/Automation.php | 19 ++++++++++++++++--- GameEngine/Building.php | 12 ++++++++++++ GameEngine/Units.php | 9 ++++++++- Templates/Message/sent.tpl | 10 +++++----- Templates/a2b/attack.tpl | 4 ---- Templates/a2b/sendback_1.tpl | 4 ---- Templates/a2b/sendback_2.tpl | 4 ---- Templates/a2b/sendback_3.tpl | 4 ---- Templates/a2b/sendback_4.tpl | 4 ---- build.php | 9 +++++---- 10 files changed, 46 insertions(+), 33 deletions(-) diff --git a/GameEngine/Automation.php b/GameEngine/Automation.php index 0b5df4cb..0dc82714 100644 --- a/GameEngine/Automation.php +++ b/GameEngine/Automation.php @@ -206,6 +206,7 @@ class Automation { $this->checkInvitedPlayes(); $this->updateStore(); $this->procClimbers(); + $this->CheckBan(); } private function loyaltyRegeneration() { @@ -3834,8 +3835,8 @@ $crannyimg = "query_return($users); $ranking->procRankArray(); @@ -3890,7 +3891,19 @@ $crannyimg = "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; ?> \ No newline at end of file diff --git a/GameEngine/Building.php b/GameEngine/Building.php index dd53dcec..faba2c6d 100644 --- a/GameEngine/Building.php +++ b/GameEngine/Building.php @@ -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"); + } } } } diff --git a/GameEngine/Units.php b/GameEngine/Units.php index 2526b1ca..d5efd632 100644 --- a/GameEngine/Units.php +++ b/GameEngine/Units.php @@ -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) { diff --git a/Templates/Message/sent.tpl b/Templates/Message/sent.tpl index 3f3a131a..e5af5732 100644 --- a/Templates/Message/sent.tpl +++ b/Templates/Message/sent.tpl @@ -20,7 +20,7 @@ Subject Recipient - Sent + Sent username."'") or die(mysql_error()); $golds = mysql_fetch_array($MyGold); @@ -34,17 +34,17 @@ echo "«»"; } else if (!isset($_GET['s']) && count($message->sent1) > 10) { - echo "«»"; + echo "«»"; } 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 "«»"; + echo "«»"; } else if(count($message->sent1) > $_GET['s']+10) { - echo "«»"; + echo "«»"; } else { - echo "«»"; + echo "«»"; } } ?> diff --git a/Templates/a2b/attack.tpl b/Templates/a2b/attack.tpl index 459750d8..efeefcad 100644 --- a/Templates/a2b/attack.tpl +++ b/Templates/a2b/attack.tpl @@ -78,7 +78,6 @@ $end = ($tribe*10); ?>

-access != BANNED){ ?>
@@ -434,7 +433,4 @@ class="dynamic_img " src="img/x.gif" alt="OK" type="image" onclick="if (this.dis - \ No newline at end of file diff --git a/Templates/a2b/sendback_1.tpl b/Templates/a2b/sendback_1.tpl index 28231860..413f6d07 100644 --- a/Templates/a2b/sendback_1.tpl +++ b/Templates/a2b/sendback_1.tpl @@ -1,5 +1,4 @@ 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']);

- \ No newline at end of file diff --git a/Templates/a2b/sendback_2.tpl b/Templates/a2b/sendback_2.tpl index fa31e928..93b3cf63 100644 --- a/Templates/a2b/sendback_2.tpl +++ b/Templates/a2b/sendback_2.tpl @@ -1,5 +1,4 @@ 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']);

- \ No newline at end of file diff --git a/Templates/a2b/sendback_3.tpl b/Templates/a2b/sendback_3.tpl index c0c7b187..aa7ea159 100644 --- a/Templates/a2b/sendback_3.tpl +++ b/Templates/a2b/sendback_3.tpl @@ -1,5 +1,4 @@ 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']);

- \ No newline at end of file diff --git a/Templates/a2b/sendback_4.tpl b/Templates/a2b/sendback_4.tpl index 4cb50201..8a460873 100644 --- a/Templates/a2b/sendback_4.tpl +++ b/Templates/a2b/sendback_4.tpl @@ -1,5 +1,4 @@ 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']);

- \ No newline at end of file diff --git a/build.php b/build.php index 53948aa5..613f00c8 100644 --- a/build.php +++ b/build.php @@ -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){