diff --git a/GameEngine/Alliance.php b/GameEngine/Alliance.php index 7f176e48..9cfd8136 100755 --- a/GameEngine/Alliance.php +++ b/GameEngine/Alliance.php @@ -221,7 +221,7 @@ class Alliance { *****************************************/ public function sendInvite($post) { global $form, $database, $session; - if($session->access != BANNED){ + $UserData = $database->getUserArray(stripslashes($post['a_name']), 0); if($this->userPermArray['opt4'] == 0) { $form->addError("name", NO_PERMISSION); @@ -257,10 +257,6 @@ class Alliance { 0, true); } - }else{ - header("Location: banned.php"); - exit; - } } /***************************************** @@ -268,19 +264,15 @@ class Alliance { *****************************************/ private function rejectInvite($get) { global $database, $session; - if($session->access != BANNED){ + foreach($this->inviteArray as $invite) { if($invite['id'] == $get['d'] && $invite['uid'] == $session->uid) { $database->removeInvitation($get['d']); $database->insertAlliNotice($invite['alliance'], ''.addslashes($session->username).' has rejected the invitation.'); } } - header("Location: build.php?gid=18"); - exit; - }else{ - header("Location: banned.php"); - exit; - } + header("Location: build.php?gid=18"); + exit; } /***************************************** @@ -288,7 +280,7 @@ class Alliance { *****************************************/ private function delInvite($get) { global $database, $session; - if($session->access != BANNED){ + $inviteArray = $database->getAliInvitations($session->alliance); foreach($inviteArray as $invite) { if($invite['id'] == $get['d'] && $invite['alliance'] == $session->alliance && $this->userPermArray['opt4'] == 1) { @@ -297,12 +289,8 @@ class Alliance { $database->insertAlliNotice($session->alliance, ''.addslashes($session->username).' has deleted the invitation for '.addslashes($invitename['username']).'.'); } } - header("Location: allianz.php?delinvite"); - exit; - }else{ - header("Location: banned.php"); - exit; - } + header("Location: allianz.php?delinvite"); + exit; } /***************************************** @@ -311,34 +299,29 @@ class Alliance { private function acceptInvite($get) { global $form, $database, $session; - if ($session->access != BANNED) { - foreach ($this->inviteArray as $invite) { - if ($session->alliance == 0) { - if ($invite['id'] == $get['d'] && $invite['uid'] == $session->uid) { - $memberlist = $database->getAllMember($invite['alliance']); - $alliance_info = $database->getAlliance($invite['alliance']); - if (count($memberlist) < $alliance_info['max']) { - $database->removeInvitation($get['d']); - $database->updateUserField($invite['uid'], "alliance", $invite['alliance'], 1); - $database->createAlliPermissions($invite['uid'], $invite['alliance'], '', 0, 0, 0, 0, 0, 0, 0, 0); - // Log the notice - $database->insertAlliNotice($invite['alliance'], ''.addslashes($session->username).' has joined the alliance.'); - } else { - $accept_error = 1; - $max = $alliance_info['max']; - } - } - } - } - - if($accept_error == 1){ - $form->addError("ally_accept", "The alliance can contain only ".$max." members at this moment."); - }else{ - header("Location: build.php?gid=18"); - exit; - } - } else{ - header("Location: banned.php"); + foreach ($this->inviteArray as $invite) { + if ($session->alliance == 0) { + if ($invite['id'] == $get['d'] && $invite['uid'] == $session->uid) { + $memberlist = $database->getAllMember($invite['alliance']); + $alliance_info = $database->getAlliance($invite['alliance']); + if (count($memberlist) < $alliance_info['max']) { + $database->removeInvitation($get['d']); + $database->updateUserField($invite['uid'], "alliance", $invite['alliance'], 1); + $database->createAlliPermissions($invite['uid'], $invite['alliance'], '', 0, 0, 0, 0, 0, 0, 0, 0); + // Log the notice + $database->insertAlliNotice($invite['alliance'], ''.addslashes($session->username).' has joined the alliance.'); + } else { + $accept_error = 1; + $max = $alliance_info['max']; + } + } + } + } + + if($accept_error == 1) $form->addError("ally_accept", "The alliance can contain only ".$max." members at this moment."); + else + { + header("Location: build.php?gid=18"); exit; } } @@ -348,7 +331,7 @@ class Alliance { *****************************************/ private function createAlliance($post) { global $form, $database, $session, $bid18, $building; - if($session->access != BANNED){ + if(!isset($post['ally1']) || $post['ally1'] == "") { $form->addError("ally1", ATAG_EMPTY); } @@ -385,10 +368,6 @@ class Alliance { header("Location: build.php?gid=18"); exit; } - }else{ - header("Location: banned.php"); - exit; - } } /***************************************** @@ -397,11 +376,6 @@ class Alliance { private function changeAliName($get) { global $form, $database, $session; - if($session->access == BANNED) { - header("Location: banned.php"); - exit; - } - $userAlly = $database->getAlliance($session->alliance); if(!isset($get['ally1']) || $get['ally1'] == "") $form->addError("ally1", ATAG_EMPTY); @@ -431,7 +405,7 @@ class Alliance { *****************************************/ private function updateAlliProfile($post) { global $database, $session, $form; - if($session->access != BANNED){ + if($this->userPermArray['opt3'] == 0) { $form->addError("perm", NO_PERMISSION); } @@ -443,10 +417,6 @@ class Alliance { // log the notice $database->insertAlliNotice($session->alliance, ''.addslashes($session->username).' has changed the alliance description.'); } - }else{ - header("Location: banned.php"); - exit; - } } /***************************************** @@ -455,12 +425,7 @@ class Alliance { private function changeUserPermissions($post) { global $database, $session, $form; - if($session->access == BANNED) - { - header("Location: banned.php"); - exit; - } - + if($this->userPermArray['opt1'] == 0) $form->addError("perm", NO_PERMISSION); elseif($database->getUserField($post['a_user'], "alliance", 0) != $session->alliance) $form->addError("perm", USER_NOT_IN_YOUR_ALLY); elseif($post['a_user'] == $session->uid) $form->addError("perm", CANT_EDIT_YOUR_PERMISSIONS); @@ -487,31 +452,26 @@ class Alliance { private function kickAlliUser($post) { global $database, $session, $form; - if ($session->access != BANNED) { - $UserData = $database->getUserArray($post['a_user'], 1); - if($this->userPermArray['opt2'] == 0) { - $form->addError("perm", NO_PERMISSION); - } else if($database->getUserField($post['a_user'], "alliance", 0) != $session->alliance){ - $form->addError("perm", USER_NOT_IN_YOUR_ALLY); - } else if($UserData['id'] != $session->uid){ - $database->updateUserField($post['a_user'], 'alliance', 0, 1); - $database->deleteAlliPermissions($post['a_user']); - $database->deleteAlliance($session->alliance); - // log the notice - $database->insertAlliNotice($session->alliance, ''.($kickedUsername = addslashes($database->getUserField($post['a_user'], "username", 0))).' has been expelled from the alliance by '.addslashes($session->username).'.'); - if($session->alliance && $database->isAllianceOwner($UserData['id']) == $session->alliance){ - $newowner = $database->getAllMember2($session->alliance); - $newleader = $newowner['id']; - $q = "UPDATE " . TB_PREFIX . "alidata set leader = ".(int) $newleader." where id = ".(int) $session->alliance.""; - $database->query($q); - $database->updateAlliPermissions($newleader, 1, 1, 1, 1, 1, 1, 1, 1, 1); - Automation::updateMax($newleader); - } - $form->addError("perm", $kickedUsername.ALLY_USER_KICKED); - } - } else { - header("Location: banned.php"); - exit; + $UserData = $database->getUserArray($post['a_user'], 1); + if($this->userPermArray['opt2'] == 0) { + $form->addError("perm", NO_PERMISSION); + } else if($database->getUserField($post['a_user'], "alliance", 0) != $session->alliance){ + $form->addError("perm", USER_NOT_IN_YOUR_ALLY); + } else if($UserData['id'] != $session->uid){ + $database->updateUserField($post['a_user'], 'alliance', 0, 1); + $database->deleteAlliPermissions($post['a_user']); + $database->deleteAlliance($session->alliance); + // log the notice + $database->insertAlliNotice($session->alliance, ''.($kickedUsername = addslashes($database->getUserField($post['a_user'], "username", 0))).' has been expelled from the alliance by '.addslashes($session->username).'.'); + if($session->alliance && $database->isAllianceOwner($UserData['id']) == $session->alliance){ + $newowner = $database->getAllMember2($session->alliance); + $newleader = $newowner['id']; + $q = "UPDATE " . TB_PREFIX . "alidata set leader = ".(int) $newleader." where id = ".(int) $session->alliance.""; + $database->query($q); + $database->updateAlliPermissions($newleader, 1, 1, 1, 1, 1, 1, 1, 1, 1); + Automation::updateMax($newleader); + } + $form->addError("perm", $kickedUsername.ALLY_USER_KICKED); } } /***************************************** @@ -519,11 +479,6 @@ class Alliance { *****************************************/ public function setForumLink($post) { global $database, $session, $form; - if($session->access == BANNED) - { - header("Location: banned.php"); - exit; - } if($this->userPermArray['opt5'] == 0) $form->addError("perm", NO_PERMISSION); else @@ -537,25 +492,21 @@ class Alliance { *****************************************/ public function Vote($post) { global $database, $session; - if($session->access != BANNED){ - if($database->checkSurvey($post['tid']) && !$database->checkVote($post['tid'], $session->uid)){ - $survey = $database->getSurvey($post['tid']); - $text = ''.$survey['voted'].','.$session->uid.','; - $database->Vote($post['tid'], $post['vote'], $text); - } - header("Location: allianz.php?s=2&fid2=".$post['fid2']."&tid=".$post['tid']); - exit; - }else{ - header("Location: banned.php"); - exit; + + if($database->checkSurvey($post['tid']) && !$database->checkVote($post['tid'], $session->uid)){ + $survey = $database->getSurvey($post['tid']); + $text = ''.$survey['voted'].','.$session->uid.','; + $database->Vote($post['tid'], $post['vote'], $text); } + header("Location: allianz.php?s=2&fid2=".$post['fid2']."&tid=".$post['tid']); + exit; } /***************************************** Function to quit from alliance *****************************************/ private function quitally($post) { global $database, $session, $form; - if($session->access != BANNED){ + if(!isset($post['pw']) || $post['pw'] == "") { $form->addError("pw", PW_EMPTY); } elseif(!password_verify($post['pw'], $session->userinfo['password'])) { @@ -620,18 +571,11 @@ class Alliance { header("Location: spieler.php?uid=".$session->uid); exit; } - }else{ - header("Location: banned.php"); - exit; - } } private function changediplomacy($post) { global $database, $session, $form; - if($session->access == BANNED) { - header("Location: banned.php"); - exit; - } + if($this->userPermArray['opt6'] == 1){ if(!empty($post['a_name']) || !empty($post['dipl'])){ $aName = $post['a_name']; diff --git a/GameEngine/Building.php b/GameEngine/Building.php index 971106c3..ac51f3e1 100755 --- a/GameEngine/Building.php +++ b/GameEngine/Building.php @@ -77,32 +77,27 @@ class Building { public function canProcess($id, $tid) { //add fix by ronix global $session, $database, $village; - - if($session->access == BANNED){ - header("Location: banned.php"); - exit; - } $levels = $database->getResourceLevel($village->wid); - // don't allow building WW to level 51 with a waiting loop + //Don't allow building WW to level 51 with a waiting loop if (!(($tid != 99 || ($tid == 99 && $this->allowWwUpgrade())))) $this->redirect($tid); if ( - // check that our ID actually exists within the buildings list + //Check that our ID actually exists within the buildings list isset($village->resarray['f'.$tid.'t']) && - // let's see if we should allow building what we want where we want to - // (prevent building resource fields in the village + //Let's see if we should allow building what we want where we want to + //(Prevent building resource fields in the village ( ($tid >= 1 && $tid <= 18 && $id >= 1 && $id <= 4) || ($tid >= 19 && $id > 4) ) && - // check that we're not trying to change a standing building type + //Check that we're not trying to change a standing building type ( $levels['f'.$tid.'t'] == $id || $levels['f'.$tid.'t'] == 0 ) && - // check that we're not trying to build in the walls id + //Check that we're not trying to build in the walls id ( ($tid == 40 && in_array($id, [31, 32, 33])) || $tid != 40 @@ -112,15 +107,15 @@ class Building { $this->redirect($tid); } - // check if the building will be built with the master builder + //Check if the building will be built with the master builder if(isset($_GET['master'])){ - // if so, we have to check if it'll be built or upgraded + //If so, we have to check if it'll be built or upgraded if($levels['f'.$tid.'t'] == 0) { - // the building will be built, we have to check if we can build it + //The building will be built, we have to check if we can build it if(!$this->meetRequirement($id)) $this->redirect($tid); }else{ - // the building will be upgraded, we have to check if we can upgrade it + //The building will be upgraded, we have to check if we can upgrade it if($this->isMax($id, $tid, $this->isLoop($tid) + $this->isCurrent($tid))){ $this->redirect($tid); } @@ -146,11 +141,6 @@ class Building { public function procBuild($get) { global $session, $village, $database; - - if($session->access == BANNED){ - header("Location: banned.php"); - exit; - } if(isset($get['a']) && $get['c'] == $session->checker && !isset($get['id'])) { if($get['a'] == 0) $this->removeBuilding($get['d']); @@ -354,11 +344,6 @@ class Building { private function upgradeBuilding($id) { global $database, $village, $session, $logging, ${'bid'.$village->resarray['f'.$id.'t']}; - if($session->access == BANNED){ - header("Location: banned.php"); - exit; - } - if($this->allocated < $this->maxConcurrent) { $uprequire = $this->resourceRequired($id,$village->resarray['f'.$id.'t']); $time = time() + $uprequire['time']; @@ -413,11 +398,6 @@ class Building { private function downgradeBuilding($id) { global $database, $village, $session, $logging; - if($session->access == BANNED){ - header("Location: banned.php"); - exit; - } - if($this->allocated < $this->maxConcurrent) { $name = "bid".$village->resarray['f'.$id.'t']; global $$name; @@ -455,11 +435,6 @@ class Building { private function constructBuilding($id, $tid) { global $database, $village, $session, $logging; - - if($session->access == BANNED) { - header("Location: banned.php"); - exit; - } if($this->allocated < $this->maxConcurrent) { if($tid == 16) $id = 39; @@ -706,128 +681,123 @@ class Building { public function finishAll($redirect_url = '') { global $database, $session, $logging, $village, $bid18, $bid10, $bid11, $technology, $_SESSION; - if ($session->access != BANNED) { - // will be true if we should decrease player's gold by 2 - // for the immediate completion action - $countPlus2Gold = false; - // will be true if we should decrease player's gold by 1 - // for master builder queue - $countMasterGold = false; - // number of jobs to finish - $buildcount = ($this->buildArray ? count($this->buildArray) : 0); - // will be true if the job was successfully finished - $jobFinishSuccess = false; - // IDs of successful jobs to delete - $deletIDs = []; - - foreach ($this->buildArray as $jobs) { - if ($jobs['wid'] == $village->wid) { - $wwvillage = $database->getResourceLevel($jobs['wid']); - if ($wwvillage['f99t'] != 40) { - $level = $jobs['level']; - if ($jobs['type'] != 25 && $jobs['type'] != 26 && $jobs['type'] != 40) { - $resource = $this->resourceRequired($jobs['field'],$jobs['type']); - // master builder involved - if ($jobs['master'] != 0) { - if ($this->meetRequirement($jobs['field'])) { - // don't allow master builder to build anything - // if we only have 2 gold, since that would take us to -1 gold - if ( $session->gold > 2 ) { - $villwood = $database->getVillageField( $jobs['wid'], 'wood' ); - $villclay = $database->getVillageField( $jobs['wid'], 'clay' ); - $villiron = $database->getVillageField( $jobs['wid'], 'iron' ); - $villcrop = $database->getVillageField( $jobs['wid'], 'crop' ); - $type = $jobs['type']; - $buildarray = $GLOBALS[ "bid" . $type ]; - $buildwood = $buildarray[ $level ]['wood']; - $buildclay = $buildarray[ $level ]['clay']; - $buildiron = $buildarray[ $level ]['iron']; - $buildcrop = $buildarray[ $level ]['crop']; - if ( $buildwood < $villwood && $buildclay < $villclay && $buildiron < $villiron && $buildcrop < $villcrop ) { - $jobFinishSuccess = true; - $countMasterGold = true; - $enought_res = 1; - // we need to subtract resources for this, if another 2 jobs are active, - // as we'd never subtract those otherwise - if ( $buildcount > 2 ) { - $database->setVillageField( $jobs['wid'], - ['wood', 'clay', 'iron', 'crop'], - [( $villwood - $buildwood ), ( $villclay - $buildclay ), ( $villiron - $buildiron ), ( $villcrop - $buildcrop )]); - } + // will be true if we should decrease player's gold by 2 + // for the immediate completion action + $countPlus2Gold = false; + // will be true if we should decrease player's gold by 1 + // for master builder queue + $countMasterGold = false; + // number of jobs to finish + $buildcount = ($this->buildArray ? count($this->buildArray) : 0); + // will be true if the job was successfully finished + $jobFinishSuccess = false; + // IDs of successful jobs to delete + $deletIDs = []; + + foreach ($this->buildArray as $jobs) { + if ($jobs['wid'] == $village->wid) { + $wwvillage = $database->getResourceLevel($jobs['wid']); + if ($wwvillage['f99t'] != 40) { + $level = $jobs['level']; + if ($jobs['type'] != 25 && $jobs['type'] != 26 && $jobs['type'] != 40) { + $resource = $this->resourceRequired($jobs['field'],$jobs['type']); + // master builder involved + if ($jobs['master'] != 0) { + if ($this->meetRequirement($jobs['field'])) { + // don't allow master builder to build anything + // if we only have 2 gold, since that would take us to -1 gold + if ( $session->gold > 2 ) { + $villwood = $database->getVillageField( $jobs['wid'], 'wood' ); + $villclay = $database->getVillageField( $jobs['wid'], 'clay' ); + $villiron = $database->getVillageField( $jobs['wid'], 'iron' ); + $villcrop = $database->getVillageField( $jobs['wid'], 'crop' ); + $type = $jobs['type']; + $buildarray = $GLOBALS[ "bid" . $type ]; + $buildwood = $buildarray[ $level ]['wood']; + $buildclay = $buildarray[ $level ]['clay']; + $buildiron = $buildarray[ $level ]['iron']; + $buildcrop = $buildarray[ $level ]['crop']; + if ( $buildwood < $villwood && $buildclay < $villclay && $buildiron < $villiron && $buildcrop < $villcrop ) { + $jobFinishSuccess = true; + $countMasterGold = true; + $enought_res = 1; + // we need to subtract resources for this, if another 2 jobs are active, + // as we'd never subtract those otherwise + if ( $buildcount > 2 ) { + $database->setVillageField( $jobs['wid'], + ['wood', 'clay', 'iron', 'crop'], + [( $villwood - $buildwood ), ( $villclay - $buildclay ), ( $villiron - $buildiron ), ( $villcrop - $buildcrop )]); } - } else { - // if we only have 2 gold, we need to cancel this job, as there will never - // be enough gold now in our account to finish this up - $exclude_master = true; - $deletIDs[] = (int) $jobs['id']; } - } - } else { - // non-master builder build, we should count +2 gold for it - $countPlus2Gold = true; - $jobFinishSuccess = true; - } - - // update build level in the database - if ($jobFinishSuccess) { - $q = "UPDATE ".TB_PREFIX."fdata set f".$jobs['field']." = ".$jobs['level'].", f".$jobs['field']."t = ".$jobs['type']." where vref = ".$jobs['wid']; - } - - if (!isset($exclude_master) && $database->query($q) && ($enought_res == 1 || $jobs['master'] == 0)) { - $database->modifyPop($jobs['wid'],$resource['pop'],0); - $database->addCP($jobs['wid'],$resource['cp']); - $deletIDs[] = (int) $jobs['id']; - if($jobs['type'] == 18) { - $owner = $database->getVillageField($jobs['wid'],"owner"); - $max = $bid18[$level]['attri']; - $q = "UPDATE ".TB_PREFIX."alidata set max = $max where leader = $owner"; - $database->query($q); + } else { + // if we only have 2 gold, we need to cancel this job, as there will never + // be enough gold now in our account to finish this up + $exclude_master = true; + $deletIDs[] = (int) $jobs['id']; } } - - if (($jobs['field'] >= 19 && ($session->tribe == 1 || ALLOW_ALL_TRIBE)) || (!ALLOW_ALL_TRIBE && $session->tribe != 1)) { - $innertimestamp = $jobs['timestamp']; + } else { + // non-master builder build, we should count +2 gold for it + $countPlus2Gold = true; + $jobFinishSuccess = true; + } + + // update build level in the database + if ($jobFinishSuccess) { + $q = "UPDATE ".TB_PREFIX."fdata set f".$jobs['field']." = ".$jobs['level'].", f".$jobs['field']."t = ".$jobs['type']." where vref = ".$jobs['wid']; + } + + if (!isset($exclude_master) && $database->query($q) && ($enought_res == 1 || $jobs['master'] == 0)) { + $database->modifyPop($jobs['wid'],$resource['pop'],0); + $database->addCP($jobs['wid'],$resource['cp']); + $deletIDs[] = (int) $jobs['id']; + if($jobs['type'] == 18) { + $owner = $database->getVillageField($jobs['wid'],"owner"); + $max = $bid18[$level]['attri']; + $q = "UPDATE ".TB_PREFIX."alidata set max = $max where leader = $owner"; + $database->query($q); } } + + if (($jobs['field'] >= 19 && ($session->tribe == 1 || ALLOW_ALL_TRIBE)) || (!ALLOW_ALL_TRIBE && $session->tribe != 1)) { + $innertimestamp = $jobs['timestamp']; + } } } - - // reset the flag for the next job - $jobFinishSuccess = false; } - - if (count($deletIDs)) { - $database->query("DELETE FROM " . TB_PREFIX . "bdata WHERE id IN(" . implode(', ', $deletIDs) . ")"); - } - - $demolition = $database->finishDemolition($village->wid); - $tech = $technology->finishTech(); - if ($demolition > 0 || $tech > 0) { - $countPlus2Gold = true; - $logging->goldFinLog($village->wid); - } - - // deduct the right amount of gold - if ($countMasterGold || $countPlus2Gold) { - $newgold = $session->gold - (($countMasterGold && $countPlus2Gold) ? 3 : 2); - $database->updateUserField($session->uid, "gold", $newgold, 1); - } - - $stillbuildingarray = $database->getJobs($village->wid); - if (count($stillbuildingarray) == 1) { - if($stillbuildingarray[0]['loopcon'] == 1) { - //$q = "UPDATE ".TB_PREFIX."bdata SET loopcon=0,timestamp=".(time()+$stillbuildingarray[0]['timestamp']-$innertimestamp)." WHERE id=".$stillbuildingarray[0]['id']; - $q = "UPDATE ".TB_PREFIX."bdata SET loopcon=0 WHERE id=".(int) $stillbuildingarray[0]['id']; - $database->query($q); - } - } - - header("Location: ".($redirect_url ? $redirect_url : $session->referrer)); - exit; - } else { - header("Location: banned.php"); - exit; + + // reset the flag for the next job + $jobFinishSuccess = false; } + + if (count($deletIDs)) { + $database->query("DELETE FROM " . TB_PREFIX . "bdata WHERE id IN(" . implode(', ', $deletIDs) . ")"); + } + + $demolition = $database->finishDemolition($village->wid); + $tech = $technology->finishTech(); + if ($demolition > 0 || $tech > 0) { + $countPlus2Gold = true; + $logging->goldFinLog($village->wid); + } + + // deduct the right amount of gold + if ($countMasterGold || $countPlus2Gold) { + $newgold = $session->gold - (($countMasterGold && $countPlus2Gold) ? 3 : 2); + $database->updateUserField($session->uid, "gold", $newgold, 1); + } + + $stillbuildingarray = $database->getJobs($village->wid); + if (count($stillbuildingarray) == 1) { + if($stillbuildingarray[0]['loopcon'] == 1) { + //$q = "UPDATE ".TB_PREFIX."bdata SET loopcon=0,timestamp=".(time()+$stillbuildingarray[0]['timestamp']-$innertimestamp)." WHERE id=".$stillbuildingarray[0]['id']; + $q = "UPDATE ".TB_PREFIX."bdata SET loopcon=0 WHERE id=".(int) $stillbuildingarray[0]['id']; + $database->query($q); + } + } + + header("Location: ".($redirect_url ? $redirect_url : $session->referrer)); + exit; } public function resourceRequired($id, $tid, $plus = 1) { diff --git a/GameEngine/Market.php b/GameEngine/Market.php index cfe972c5..175a9e88 100755 --- a/GameEngine/Market.php +++ b/GameEngine/Market.php @@ -94,6 +94,7 @@ class Market $ctrans = str_replace("-", "", $ctrans); $itrans = str_replace("-", "", $itrans); $crtrans = str_replace("-", "", $crtrans); + // preload all village data, since we're retrieving some of those separately below $database->getVillage($village->wid); @@ -101,15 +102,11 @@ class Market $availableClay = $database->getClayAvailable($village->wid); $availableIron = $database->getIronAvailable($village->wid); $availableCrop = $database->getCropAvailable($village->wid); - //check if vacation mode: + + //check if on vacation: if($database->getvacmodexy($id)) $form->addError("error", USER_ON_VACATION); - if($session->access == BANNED) - { - header("Location: banned.php"); - exit; - } - elseif(!$database->checkVilExist($post['getwref'])) $form->addError("error", NO_COORDINATES_SELECTED); + if(!$database->checkVilExist($post['getwref'])) $form->addError("error", NO_COORDINATES_SELECTED); elseif($post['getwref'] == $village->wid) $form->addError("error", CANNOT_SEND_RESOURCES); elseif($post['send3'] < 1 || $post['send3'] > 3 || ($post['send3'] > 1 && !$session->goldclub)) $form->addError("error", INVALID_MERCHANTS_REPETITION); elseif($availableWood >= $post['r1'] && $availableClay >= $post['r2'] && $availableIron >= $post['r3'] && $availableCrop >= $post['r4']) @@ -190,13 +187,7 @@ class Market $availableIron = $database->getIronAvailable($village->wid); $availableCrop = $database->getCropAvailable($village->wid); - if($session->access == BANNED) - { - header("Location: banned.php"); - exit; - } - - elseif($availableWood >= $wood && $availableClay >= $clay && $availableIron >= $iron && $availableCrop >= $crop) + if($availableWood >= $wood && $availableClay >= $clay && $availableIron >= $iron && $availableCrop >= $crop) { $reqMerc = 1; @@ -355,18 +346,10 @@ class Market global $session,$database,$village; $wwvillage = $database->getResourceLevel($village->wid); - if($wwvillage['f99t'] != 40) - { - if($session->userinfo['gold'] >= 3) - { - //check if there are too many resources - if($session->access == BANNED) - { - header("Location: banned.php"); - exit; - } - else if (($post['m2'][0]+$post['m2'][1]+$post['m2'][2]+$post['m2'][3])<=(round($village->awood)+round($village->aclay)+round($village->airon)+round($village->acrop))) - { + if($wwvillage['f99t'] != 40){ + if($session->userinfo['gold'] >= 3){ + //Check if there are too many resources + if(($post['m2'][0]+$post['m2'][1]+$post['m2'][2]+$post['m2'][3])<=(round($village->awood)+round($village->aclay)+round($village->airon)+round($village->acrop))){ $database->setVillageField( $village->wid, ["wood", "clay", "iron", "crop"], @@ -375,15 +358,11 @@ class Market $database->modifyGold($session->uid, 3, 0); header("Location: build.php?id=".$post['id']."&t=3&c");; exit; - } - else - { + }else{ header("Location: build.php?id=".$post['id']."&t=3"); exit; } - } - else - { + }else{ header("Location: build.php?id=".$post['id']."&t=3"); exit; } diff --git a/GameEngine/Profile.php b/GameEngine/Profile.php index 8ce71aa9..c1d59266 100755 --- a/GameEngine/Profile.php +++ b/GameEngine/Profile.php @@ -11,15 +11,9 @@ class Profile { - public function procProfile($post) { global $session; - if($session->access == BANNED){ - header("Location: banned.php"); - exit; - } - if(isset($post['ft'])) { switch($post['ft']) { case "p1" : @@ -40,11 +34,6 @@ class Profile { public function procSpecial($get) { global $session; - if($session->access == BANNED){ - header("Location: banned.php"); - exit; - } - if(isset($get['e'])) { switch($get['e']) { case 2 : diff --git a/GameEngine/Session.php b/GameEngine/Session.php index aee6d035..080abf4a 100755 --- a/GameEngine/Session.php +++ b/GameEngine/Session.php @@ -172,7 +172,7 @@ class Session { $admin = true; } - if($user && ($admin || isset($_SESSION['sessid']))) { + if($user && ($admin || isset($_SESSION['sessid']))) { $this->maintenance(); $this->isWinner(); @@ -187,6 +187,10 @@ class Session { //Get and Populate Data $this->PopulateVar(); + + //Check if the player is banned + $this->isBanned(); + //update database $database->updateActiveUser($user, $this->time); return true; @@ -194,6 +198,18 @@ class Session { else return false; } + /** + * Called if the player is banned + * + */ + + function isBanned(){ + if($this->access == BANNED && !in_array(basename($_SERVER['PHP_SELF']), ['banned.php', 'nachrichten.php', 'rules.php'])){ + header('Location: banned.php'); + exit; + } + } + /** * Called when the server is under maintenance * diff --git a/GameEngine/Technology.php b/GameEngine/Technology.php index 45d6bf8a..6c6fd9e6 100755 --- a/GameEngine/Technology.php +++ b/GameEngine/Technology.php @@ -370,46 +370,42 @@ class Technology { private function procTrain($post, $great = false) { global $session; - if($session->access != BANNED){ - // first of all, check if we're not trying to train chieftain - // and settlers together - which we cannot, since that can result - // in 1 chieftain and 3 settlers, then conquering a village, then - // founding a new one, all with only 1 available slot - if ( - !( - (!empty($post['t9']) && !empty($post['t10'])) || - (!empty($post['t19']) && !empty($post['t20'])) || - (!empty($post['t29']) && !empty($post['t30'])) || - (!empty($post['t39']) && !empty($post['t40'])) || - (!empty($post['t49']) && !empty($post['t50'])) - ) - ) { - $start = ($session->tribe - 1) * 10 + 1; - $end = ($session->tribe * 10); - for ($i = $start; $i <= $end; $i ++ ) { - if (isset($post['t'.$i]) && $post['t'.$i] != 0) { - $amt = intval($post['t'.$i]); - if ($amt < 0) $amt = 1; - $this->trainUnit($i, $amt, $great); - } - } - - if($session->tribe == 3) - { - if (isset($post['t99']) && $post['t99'] != 0) { - $amt = intval($post['t99']); - if ($amt < 0) $amt = 1; - $this->trainUnit(99, $amt, $great); - } - } - - header( "Location: build.php?id=" . $post['id'] ); - exit; - } - }else{ - header("Location: banned.php"); - exit; - } + + // first of all, check if we're not trying to train chieftain + // and settlers together - which we cannot, since that can result + // in 1 chieftain and 3 settlers, then conquering a village, then + // founding a new one, all with only 1 available slot + if ( + !( + (!empty($post['t9']) && !empty($post['t10'])) || + (!empty($post['t19']) && !empty($post['t20'])) || + (!empty($post['t29']) && !empty($post['t30'])) || + (!empty($post['t39']) && !empty($post['t40'])) || + (!empty($post['t49']) && !empty($post['t50'])) + ) + ) { + $start = ($session->tribe - 1) * 10 + 1; + $end = ($session->tribe * 10); + for ($i = $start; $i <= $end; $i ++ ) { + if (isset($post['t'.$i]) && $post['t'.$i] != 0) { + $amt = intval($post['t'.$i]); + if ($amt < 0) $amt = 1; + $this->trainUnit($i, $amt, $great); + } + } + + if($session->tribe == 3) + { + if (isset($post['t99']) && $post['t99'] != 0) { + $amt = intval($post['t99']); + if ($amt < 0) $amt = 1; + $this->trainUnit(99, $amt, $great); + } + } + + header( "Location: build.php?id=" . $post['id'] ); + exit; + } } public function getUpkeep($array, $type, $vid = 0, $prisoners = 0) { diff --git a/GameEngine/Units.php b/GameEngine/Units.php index 08d28b19..80f1e13e 100755 --- a/GameEngine/Units.php +++ b/GameEngine/Units.php @@ -253,278 +253,264 @@ class Units { } } - if ($data['u11'] > $village->unitarray['hero']) $form->addError("error", "You can't send more units than you have"); - if ($data['u11'] < 0) $form->addError("error", "You can't send negative units."); + if($data['u11'] > $village->unitarray['hero']) $form->addError("error", "You can't send more units than you have"); + if($data['u11'] < 0) $form->addError("error", "You can't send negative units."); if($data['type'] != 1 && $post['spy'] != 0) $post['spy'] = 0; - if ($form->returnErrors() > 0) { + if($form->returnErrors() > 0){ $_SESSION['errorarray'] = $form->getErrors(); $_SESSION['valuearray'] = $_POST; header( "Location: a2b.php" ); exit; - } else { - if ($session->access != BANNED) { - $u = ($session->tribe == 1) ? "" : $session->tribe - 1; - - $database->modifyUnit( - $village->wid, - [ - $u . "1", - $u . "2", - $u . "3", - $u . "4", - $u . "5", - $u . "6", - $u . "7", - $u . "8", - $u . "9", - $u . $session->tribe . "0", - "hero" - ], - [ - $data['u1'], - $data['u2'], - $data['u3'], - $data['u4'], - $data['u5'], - $data['u6'], - $data['u7'], - $data['u8'], - $data['u9'], - $data['u10'], - $data['u11'] - ], - [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] + }else{ + $u = ($session->tribe == 1) ? "" : $session->tribe - 1; + + $database->modifyUnit( + $village->wid, + [ + $u . "1", + $u . "2", + $u . "3", + $u . "4", + $u . "5", + $u . "6", + $u . "7", + $u . "8", + $u . "9", + $u . $session->tribe . "0", + "hero" + ], + [ + $data['u1'], + $data['u2'], + $data['u3'], + $data['u4'], + $data['u5'], + $data['u6'], + $data['u7'], + $data['u8'], + $data['u9'], + $data['u10'], + $data['u11'] + ], + [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] ); - - $troopsTime = $this->getWalkingTroopsTime($village->wid, $data['to_vid'], $session->uid, $session->tribe, $data, 1, 'u'); - $time = $database->getArtifactsValueInfluence($session->uid, $village->wid, 2, $troopsTime); - - // Check if have WW owner have artefact Rivals great confusion or Artefact of the unique fool with that effect - // If is a WW village you can target on WW , if is not a WW village catapults will target randomly. - // Like it says : Exceptions are the WW which can always be targeted and the treasure chamber which can always be targeted, except with the unique artifact. - // Fixed by Advocaite and Shadow - Optimized by iopietro - - $to_owner = $database->getVillageField($data['to_vid'], "owner"); - $rivalsGreatConfusion = $database->getArtifactsSumByKind($to_owner, $data['to_vid'], 7); - - $rallyPointLevel = ($village->resarray)['f39']; - $invalidBuildings = []; - - // fill the array with the invalid buildings - if($rallyPointLevel >= 3 && $rallyPointLevel < 5){ - for($i = 1; $i <= 37; $i++){ - if(!in_array($i, [10, 11])) $invalidBuildings[] = $i; - } + + $troopsTime = $this->getWalkingTroopsTime($village->wid, $data['to_vid'], $session->uid, $session->tribe, $data, 1, 'u'); + $time = $database->getArtifactsValueInfluence($session->uid, $village->wid, 2, $troopsTime); + + // Check if have WW owner have artefact Rivals great confusion or Artefact of the unique fool with that effect + // If is a WW village you can target on WW , if is not a WW village catapults will target randomly. + // Like it says : Exceptions are the WW which can always be targeted and the treasure chamber which can always be targeted, except with the unique artifact. + // Fixed by Advocaite and Shadow - Optimized by iopietro + + $to_owner = $database->getVillageField($data['to_vid'], "owner"); + $rivalsGreatConfusion = $database->getArtifactsSumByKind($to_owner, $data['to_vid'], 7); + + $rallyPointLevel = ($village->resarray)['f39']; + $invalidBuildings = []; + + // fill the array with the invalid buildings + if($rallyPointLevel >= 3 && $rallyPointLevel < 5){ + for($i = 1; $i <= 37; $i++){ + if(!in_array($i, [10, 11])) $invalidBuildings[] = $i; } - else if($rallyPointLevel >= 5 && $rallyPointLevel < 10){ - for($i = 12; $i <= 37; $i++) $invalidBuildings[] = $i; + } + else if($rallyPointLevel >= 5 && $rallyPointLevel < 10){ + for($i = 12; $i <= 37; $i++) $invalidBuildings[] = $i; + } + else if($rallyPointLevel >= 10){ + $invalidBuildings = [23, 31, 32, 33, 34, 36]; + } + + if(isset($post['ctar1']) && $post['ctar1'] != 0){ + // check if the player has selected a valid building + if($rallyPointLevel < 3 || $data['u8'] == 0 || in_array($post['ctar1'], $invalidBuildings) || $post['ctar1'] < 0 || $post['ctar1'] > 40){ + $post['ctar1'] = 0; } - else if($rallyPointLevel >= 10){ - $invalidBuildings = [23, 31, 32, 33, 34, 36]; - } - - if(isset($post['ctar1']) && $post['ctar1'] != 0){ + } + + if(isset($post['ctar2']) && $post['ctar2'] != 0){ + // check if there are atleast 20 catapults + if($data['u8'] < 20 || $rallyPointLevel != 20){ + $post['ctar2'] = 0; + }else{ // check if the player has selected a valid building - if($rallyPointLevel < 3 || $data['u8'] == 0 || in_array($post['ctar1'], $invalidBuildings) || $post['ctar1'] < 0 || $post['ctar1'] > 40){ - $post['ctar1'] = 0; + if(in_array($post['ctar2'], $invalidBuildings) || ($post['ctar2'] < 0 || $post['ctar2'] > 40 && $post['ctar2'] != 99)){ + $post['ctar2'] = 99; } } - - if(isset($post['ctar2']) && $post['ctar2'] != 0){ - // check if there are atleast 20 catapults - if($data['u8'] < 20 || $rallyPointLevel != 20){ - $post['ctar2'] = 0; - }else{ - // check if the player has selected a valid building - if(in_array($post['ctar2'], $invalidBuildings) || ($post['ctar2'] < 0 || $post['ctar2'] > 40 && $post['ctar2'] != 99)){ + } + + if(isset($post['ctar1'])) { + //Is the Brewery built? + if($session->tribe != 2 || $database->getFieldLevelInVillage($village->wid, 35) == 0){ + if($rivalsGreatConfusion['totals'] > 0) { + if($post['ctar1'] != 40 && ($post['ctar1'] != 27 || ($post['ctar1'] == 27 && $rivalsGreatConfusion['unique'] > 0))) { + $post['ctar1'] = 0; + } + } + } + else $post['ctar1'] = 0; + } + else $post['ctar1'] = 0; + + if(isset($post['ctar2']) && $post['ctar2'] > 0) { + //Is the Brewery built? + if($session->tribe != 2 || $database->getFieldLevelInVillage($village->wid, 35) == 0){ + if($rivalsGreatConfusion['totals'] > 0) { + if ($post['ctar2'] != 40 && ($post['ctar2'] != 27 || ($post['ctar2'] == 27 && $rivalsGreatConfusion['unique'] > 0))) { $post['ctar2'] = 99; } } } - - if(isset($post['ctar1'])) { - //Is the Brewery built? - if($session->tribe != 2 || $database->getFieldLevelInVillage($village->wid, 35) == 0){ - if($rivalsGreatConfusion['totals'] > 0) { - if($post['ctar1'] != 40 && ($post['ctar1'] != 27 || ($post['ctar1'] == 27 && $rivalsGreatConfusion['unique'] > 0))) { - $post['ctar1'] = 0; - } - } - } - else $post['ctar1'] = 0; - } - else $post['ctar1'] = 0; - - if(isset($post['ctar2']) && $post['ctar2'] > 0) { - //Is the Brewery built? - if($session->tribe != 2 || $database->getFieldLevelInVillage($village->wid, 35) == 0){ - if($rivalsGreatConfusion['totals'] > 0) { - if ($post['ctar2'] != 40 && ($post['ctar2'] != 27 || ($post['ctar2'] == 27 && $rivalsGreatConfusion['unique'] > 0))) { - $post['ctar2'] = 99; - } - } - } - else $post['ctar2'] = 99; + else $post['ctar2'] = 99; + } + else $post['ctar2'] = 0; + + if(!isset($post['spy'])) $post['spy'] = 0; + + $abdata = $database->getABTech($village->wid); + $reference = $database->addAttack(($village->wid), $data['u1'], $data['u2'], $data['u3'], $data['u4'], $data['u5'], $data['u6'], $data['u7'], $data['u8'], $data['u9'], $data['u10'], $data['u11'], $data['type'], $post['ctar1'], $post['ctar2'], $post['spy'], $abdata['b1'], $abdata['b2'], $abdata['b3'], $abdata['b4'], $abdata['b5'], $abdata['b6'], $abdata['b7'], $abdata['b8']); + $checkexist = $database->checkVilExist($data['to_vid']); + $checkoexist = $database->checkOasisExist($data['to_vid']); + if($checkexist || $checkoexist) { + $database->addMovement(3, $village->wid, $data['to_vid'], $reference, time(), ($time + time())); + if ($database->hasBeginnerProtection($village->wid) == 1 && $checkexist) { + mysqli_query($database->dblink, "UPDATE " . TB_PREFIX . "users SET protect = 0 WHERE id = ".(int) $session->uid); } - else $post['ctar2'] = 0; - - if(!isset($post['spy'])) $post['spy'] = 0; - - $abdata = $database->getABTech($village->wid); - $reference = $database->addAttack(($village->wid), $data['u1'], $data['u2'], $data['u3'], $data['u4'], $data['u5'], $data['u6'], $data['u7'], $data['u8'], $data['u9'], $data['u10'], $data['u11'], $data['type'], $post['ctar1'], $post['ctar2'], $post['spy'], $abdata['b1'], $abdata['b2'], $abdata['b3'], $abdata['b4'], $abdata['b5'], $abdata['b6'], $abdata['b7'], $abdata['b8']); - $checkexist = $database->checkVilExist($data['to_vid']); - $checkoexist = $database->checkOasisExist($data['to_vid']); - if($checkexist || $checkoexist) { - $database->addMovement(3, $village->wid, $data['to_vid'], $reference, time(), ($time + time())); - if ($database->hasBeginnerProtection($village->wid) == 1 && $checkexist) { - mysqli_query($database->dblink, "UPDATE " . TB_PREFIX . "users SET protect = 0 WHERE id = ".(int) $session->uid); - } - } - - if($form->returnErrors() > 0) { - $_SESSION['errorarray'] = $form->getErrors(); - $_SESSION['valuearray'] = $_POST; - header("Location: a2b.php" ); - exit; - } - - // prevent re-use of the same attack via re-POSTing the same data - $database->remA2b($data['id']); - - header("Location: build.php?id=39"); - exit; - } else { - header("Location: banned.php"); + } + + if($form->returnErrors() > 0) { + $_SESSION['errorarray'] = $form->getErrors(); + $_SESSION['valuearray'] = $_POST; + header("Location: a2b.php" ); exit; } + + // prevent re-use of the same attack via re-POSTing the same data + $database->remA2b($data['id']); + + header("Location: build.php?id=39"); + exit; } } private function sendTroopsBack($post) { global $form, $database, $village, $session, $technology; - if ( $session->access != BANNED ) { - $enforce = $database->getEnforceArray( $post['ckey'], 0 ); - $enforceoasis = $database->getOasisEnforceArray( $post['ckey'], 0 ); - if ( ( $enforce['from'] == $village->wid ) || ( $enforce['vref'] == $village->wid ) || ( $enforceoasis['conqured'] == $village->wid ) ) { - $to = $database->getVillage( $enforce['from'] ); - $Gtribe = ($ownerTribe = $database->getUserField( $to['owner'], 'tribe', 0)) == 1 ? "" : $ownerTribe - 1; - for ( $i = 1; $i < 10; $i ++ ) { - if ( isset( $post[ 't' . $i ] ) ) { - if ( $i != 10 ) { - if ( $post[ 't' . $i ] > $enforce[ 'u' . $Gtribe . $i ] ) { - $form->addError( "error", "You can't send back more units than you have" ); - break; - } - - if ( $post[ 't' . $i ] < 0 ) { - $form->addError( "error", "You can't send back negative units." ); - break; - } + $enforce = $database->getEnforceArray( $post['ckey'], 0 ); + $enforceoasis = $database->getOasisEnforceArray( $post['ckey'], 0 ); + if ( ( $enforce['from'] == $village->wid ) || ( $enforce['vref'] == $village->wid ) || ( $enforceoasis['conqured'] == $village->wid ) ) { + $to = $database->getVillage( $enforce['from'] ); + $Gtribe = ($ownerTribe = $database->getUserField( $to['owner'], 'tribe', 0)) == 1 ? "" : $ownerTribe - 1; + + for ( $i = 1; $i < 10; $i ++ ) { + if ( isset( $post[ 't' . $i ] ) ) { + if ( $i != 10 ) { + if ( $post[ 't' . $i ] > $enforce[ 'u' . $Gtribe . $i ] ) { + $form->addError( "error", "You can't send back more units than you have" ); + break; + } + + if ( $post[ 't' . $i ] < 0 ) { + $form->addError( "error", "You can't send back negative units." ); + break; } - } else { - $post[ 't' . $i . '' ] = '0'; - } - } - if ( isset( $post['t11'] ) ) { - if ( $post['t11'] > $enforce['hero'] ) { - $form->addError( "error", "You can't send back more units than you have" ); - } - - if ( $post['t11'] < 0 ) { - $form->addError( "error", "You can't send back negative units." ); } } else { - $post['t11'] = '0'; + $post[ 't' . $i . '' ] = '0'; } - - if ( $form->returnErrors() > 0 ) { - $_SESSION['errorarray'] = $form->getErrors(); - $_SESSION['valuearray'] = $_POST; - header( "Location: a2b.php" ); - exit; - } else { - - //change units - $tribe = $database->getUserField($to['owner'], 'tribe', 0); - $start = ($tribe - 1 ) * 10 + 1; - $end = $tribe * 10 ; - - $units = []; - $amounts = []; - $modes = []; - - $j = 1; - for ( $i = $start; $i <= $end; $i ++ ) { - $units[] = $i; - $amounts[] = $post[ 't' . $j . '' ]; - $modes[] = 0; - $j ++; - } - - $units[] = 'hero'; - $amounts[] = $post['t11']; + } + if ( isset( $post['t11'] ) ) { + if ( $post['t11'] > $enforce['hero'] ) { + $form->addError( "error", "You can't send back more units than you have" ); + } + + if ( $post['t11'] < 0 ) { + $form->addError( "error", "You can't send back negative units." ); + } + } else { + $post['t11'] = '0'; + } + + if ( $form->returnErrors() > 0 ) { + $_SESSION['errorarray'] = $form->getErrors(); + $_SESSION['valuearray'] = $_POST; + header( "Location: a2b.php" ); + exit; + } else { + + //change units + $tribe = $database->getUserField($to['owner'], 'tribe', 0); + $start = ($tribe - 1 ) * 10 + 1; + $end = $tribe * 10 ; + + $units = []; + $amounts = []; + $modes = []; + + $j = 1; + for ( $i = $start; $i <= $end; $i ++ ) { + $units[] = $i; + $amounts[] = $post[ 't' . $j . '' ]; $modes[] = 0; - - $database->modifyEnforce($post['ckey'], $units, $amounts, $modes); - $j++; - - $troopsTime = $this->getWalkingTroopsTime($enforce['from'], $enforce['vref'], $to['owner'], $tribe, $post, 1, 't'); - $time = $database->getArtifactsValueInfluence($session->uid, $village->wid, 2, $troopsTime); - - $reference = $database->addAttack($enforce['from'], $post['t1'], $post['t2'], $post['t3'], $post['t4'], $post['t5'], $post['t6'], $post['t7'], $post['t8'], $post['t9'], $post['t10'], $post['t11'], 2, 0, 0, 0, 0); - $database->addMovement(4, $village->wid, $enforce['from'], $reference, time(), ($time + time())); - $technology->checkReinf($post['ckey'], false); - - header("Location: build.php?id=39&refresh=1"); - exit(); - } - }else{ - $form->addError("error", "You cant change someones troops."); - if($form->returnErrors() > 0){ - $_SESSION['errorarray'] = $form->getErrors(); - $_SESSION['valuearray'] = $_POST; - header("Location: a2b.php"); - exit(); - } - } - }else{ - header("Location: banned.php"); - exit(); - } + $j ++; + } + + $units[] = 'hero'; + $amounts[] = $post['t11']; + $modes[] = 0; + + $database->modifyEnforce($post['ckey'], $units, $amounts, $modes); + $j++; + + $troopsTime = $this->getWalkingTroopsTime($enforce['from'], $enforce['vref'], $to['owner'], $tribe, $post, 1, 't'); + $time = $database->getArtifactsValueInfluence($session->uid, $village->wid, 2, $troopsTime); + + $reference = $database->addAttack($enforce['from'], $post['t1'], $post['t2'], $post['t3'], $post['t4'], $post['t5'], $post['t6'], $post['t7'], $post['t8'], $post['t9'], $post['t10'], $post['t11'], 2, 0, 0, 0, 0); + $database->addMovement(4, $village->wid, $enforce['from'], $reference, time(), ($time + time())); + $technology->checkReinf($post['ckey'], false); + + header("Location: build.php?id=39&refresh=1"); + exit(); + } + }else{ + $form->addError("error", "You cant change someones troops."); + if($form->returnErrors() > 0){ + $_SESSION['errorarray'] = $form->getErrors(); + $_SESSION['valuearray'] = $_POST; + header("Location: a2b.php"); + exit(); + } + } } public function Settlers($post) { global $form, $database, $village, $session; - - if ($session->access != BANNED) { - $mode = CP; - $total = count($database->getProfileVillages($session->uid)); - $need_cps = ${'cp'.$mode}[$total + 1]; - $cps = $session->cp; - $rallypoint = $database->getResourceLevel($village->wid); - //-- Prevent user from founding a new village if there are not enough settlers or the player put an invalid village ID or an already occupied one - //-- fix by AL-Kateb - Semplified and additions by iopietro - if ($rallypoint['f39'] > 0 && $village->unitarray['u'.$session->tribe.'0'] >= 3 && isset($post['s']) && ($newvillage = $database->getMInfo($post['s']))['id'] > 0 && $newvillage['occupied'] == 0 && $newvillage['oasistype'] == 0) { - if ($cps >= $need_cps) { - $troopsTime = $this->getWalkingTroopsTime($village->wid, $newvillage['id'], 0, 0, [300], 0); - $time = $database->getArtifactsValueInfluence($session->uid, $village->wid, 2, $troopsTime); - - $unit = ($session->tribe * 10); - $database->modifyResource($village->wid, 750, 750, 750, 750, 0); - $database->modifyUnit($village->wid, [$unit], [3], [0]); - $database->addMovement(5, $village->wid, $post['s'], 0, time(), time() + $time); - } - header("Location: build.php?id=39"); - exit; - } else { - header("Location: dorf1.php"); - exit; + $mode = CP; + $total = count($database->getProfileVillages($session->uid)); + $need_cps = ${'cp'.$mode}[$total + 1]; + $cps = $session->cp; + $rallypoint = $database->getResourceLevel($village->wid); + + //-- Prevent user from founding a new village if there are not enough settlers or the player put an invalid village ID or an already occupied one + //-- fix by AL-Kateb - Semplified and additions by iopietro + if ($rallypoint['f39'] > 0 && $village->unitarray['u'.$session->tribe.'0'] >= 3 && isset($post['s']) && ($newvillage = $database->getMInfo($post['s']))['id'] > 0 && $newvillage['occupied'] == 0 && $newvillage['oasistype'] == 0) { + if ($cps >= $need_cps) { + $troopsTime = $this->getWalkingTroopsTime($village->wid, $newvillage['id'], 0, 0, [300], 0); + $time = $database->getArtifactsValueInfluence($session->uid, $village->wid, 2, $troopsTime); + + $unit = ($session->tribe * 10); + $database->modifyResource($village->wid, 750, 750, 750, 750, 0); + $database->modifyUnit($village->wid, [$unit], [3], [0]); + $database->addMovement(5, $village->wid, $post['s'], 0, time(), time() + $time); } + header("Location: build.php?id=39"); + exit; } else { - header("Location: banned.php"); + header("Location: dorf1.php"); exit; } } diff --git a/Templates/Alliance/Forum/forum_1.tpl b/Templates/Alliance/Forum/forum_1.tpl index 150b08d9..93688ac0 100644 --- a/Templates/Alliance/Forum/forum_1.tpl +++ b/Templates/Alliance/Forum/forum_1.tpl @@ -5,10 +5,6 @@ ## FIX BY RONIX ## ## TRAVIANZ ## ############################################################ -if($session->access == BANNED){ - header("Location: banned.php"); - exit; -} if($session->access != ADMIN && ($session->alliance == 0 || ($session->alliance > 0 && !$opt['opt5']))) $alliance->redirect($_GET); diff --git a/Templates/Alliance/Forum/forum_10.tpl b/Templates/Alliance/Forum/forum_10.tpl index ad95a16d..ec8316d7 100644 --- a/Templates/Alliance/Forum/forum_10.tpl +++ b/Templates/Alliance/Forum/forum_10.tpl @@ -5,10 +5,6 @@ // # FIX BY RONIX ## // # TRAVIANZ ## // ########################################################### -if($session->access == BANNED){ - header("Location: banned.php"); - exit(); -} $topic_id = $_GET['tid']; $post_id = $_GET['pod']; diff --git a/Templates/Alliance/Forum/forum_2.tpl b/Templates/Alliance/Forum/forum_2.tpl index 9d59b3fc..c4fa118d 100644 --- a/Templates/Alliance/Forum/forum_2.tpl +++ b/Templates/Alliance/Forum/forum_2.tpl @@ -5,10 +5,6 @@ // # FIX BY RONIX ## // # TRAVIANZ ## // ########################################################### -if($session->access == BANNED){ - header("Location: banned.php"); - exit(); -} $opt = $database->getAlliPermissions($session->uid, $aid); $displayarray = $database->getUserArray($session->uid, 1); diff --git a/Templates/Alliance/Forum/forum_3.tpl b/Templates/Alliance/Forum/forum_3.tpl index 442f0f7d..9f160301 100644 --- a/Templates/Alliance/Forum/forum_3.tpl +++ b/Templates/Alliance/Forum/forum_3.tpl @@ -5,10 +5,6 @@ ## FIX BY RONIX ## ## TRAVIANZ ## ############################################################ -if($session->access == BANNED){ - header("Location: banned.php"); - exit; -} $topicID = $_GET['idt']; $showTopic = reset($database->ShowTopic($topicID)); diff --git a/Templates/Alliance/Forum/forum_4.tpl b/Templates/Alliance/Forum/forum_4.tpl index 5215ad56..d1965da2 100644 --- a/Templates/Alliance/Forum/forum_4.tpl +++ b/Templates/Alliance/Forum/forum_4.tpl @@ -5,10 +5,6 @@ ## FIX BY RONIX ## ## TRAVIANZ ## ############################################################ -if($session->access == BANNED){ - header("Location: banned.php"); - exit; -} $cat_id = $_GET['fid']; $forumInfo = $database->ForumCatEdit($cat_id); diff --git a/Templates/Alliance/Forum/forum_5.tpl b/Templates/Alliance/Forum/forum_5.tpl index e0086758..b67d73ba 100644 --- a/Templates/Alliance/Forum/forum_5.tpl +++ b/Templates/Alliance/Forum/forum_5.tpl @@ -5,10 +5,6 @@ ## FIX BY RONIX ## ## TRAVIANZ ## ############################################################ -if($session->access == BANNED){ - header("Location: banned.php"); - exit; -} $cat_id = $_GET['fid']; $forumData = reset($database->ForumCatEdit($cat_id)); diff --git a/Templates/Alliance/Forum/forum_6.tpl b/Templates/Alliance/Forum/forum_6.tpl index d1bc4be4..48f75915 100644 --- a/Templates/Alliance/Forum/forum_6.tpl +++ b/Templates/Alliance/Forum/forum_6.tpl @@ -5,10 +5,6 @@ // # FIX BY RONIX ## // # TRAVIANZ ## // ########################################################### -if($session->access == BANNED){ - header("Location: banned.php"); - exit(); -} $tid = $_GET['tid']; $topics = $database->ShowTopic($tid); diff --git a/Templates/Alliance/Forum/forum_7.tpl b/Templates/Alliance/Forum/forum_7.tpl index 4653275d..5a0ab6cc 100644 --- a/Templates/Alliance/Forum/forum_7.tpl +++ b/Templates/Alliance/Forum/forum_7.tpl @@ -1,9 +1,5 @@ access == BANNED){ - header("Location: banned.php"); - exit; -} $tid = $_GET['tid']; $topic = reset($database->ShowTopic($tid)); diff --git a/Templates/Alliance/Forum/forum_8.tpl b/Templates/Alliance/Forum/forum_8.tpl index 0da6cea4..8c0a5a13 100644 --- a/Templates/Alliance/Forum/forum_8.tpl +++ b/Templates/Alliance/Forum/forum_8.tpl @@ -5,10 +5,6 @@ ## FIX BY RONIX ## ## TRAVIANZ ## ############################################################ -if($session->access == BANNED){ - header("Location: banned.php"); - exit; -} $forumData = reset($database->ForumCatEdit($_GET['idf'])); if(empty($forumData) || ($forumData['alliance'] == 0 && $session->access != ADMIN) || diff --git a/Templates/Alliance/Forum/forum_9.tpl b/Templates/Alliance/Forum/forum_9.tpl index b28f5d04..232e4cbc 100644 --- a/Templates/Alliance/Forum/forum_9.tpl +++ b/Templates/Alliance/Forum/forum_9.tpl @@ -5,10 +5,6 @@ ## FIX BY RONIX ## ## TRAVIANZ ## ############################################################ -if($session->access == BANNED){ - header("Location: banned.php"); - exit; -} $topic_id = $_GET['idt']; $topics = $database->ShowTopic($topic_id); diff --git a/Templates/Alliance/assignpos.tpl b/Templates/Alliance/assignpos.tpl index 1b7e9821..14421da1 100644 --- a/Templates/Alliance/assignpos.tpl +++ b/Templates/Alliance/assignpos.tpl @@ -5,8 +5,7 @@ $allianceinfo = $database->getAlliance($aid); $memberlist = $database->getAllMember($aid); echo "

".$allianceinfo['tag']." - ".$allianceinfo['name']."

"; -include("alli_menu.tpl"); -if($session->access!=BANNED){ +include("alli_menu.tpl"); ?>
@@ -41,9 +40,3 @@ if($session->access!=BANNED){

- diff --git a/Templates/Build/15_1.tpl b/Templates/Build/15_1.tpl index 9c72bb39..3940231b 100644 --- a/Templates/Build/15_1.tpl +++ b/Templates/Build/15_1.tpl @@ -1,39 +1,25 @@ access != BANNED){ $database->delDemolition($village->wid); header("Location: build.php?gid=15&ty=$ty&cancel=0&demolish=0"); exit; -}else{ - header("Location: banned.php"); - exit; -} } -if ($session->alliance) { - $memberCount = $database->countAllianceMembers($session->alliance); -} else { - $memberCount = 0; -} +if($session->alliance) $memberCount = $database->countAllianceMembers($session->alliance); +else $memberCount = 0; if(!empty($_REQUEST["demolish"]) && $_REQUEST["c"] == $session->mchecker) { -if($session->access != BANNED){ if($_REQUEST["type"] != null && ($_REQUEST["type"] >= 19 && $_REQUEST["type"] <= 40 || $_REQUEST["type"] == 99)) { $type = $_REQUEST['type']; $demolish_permitted = $database->addDemolition($village->wid,$type); if ($demolish_permitted === true) { - $session->changeChecker(); - header("Location: build.php?gid=15&ty=$type&cancel=0&demolish=0"); - } else { - header("Location: build.php?gid=15&ty=$type&nodemolish=".$demolish_permitted); - } - exit; + $session->changeChecker(); + header("Location: build.php?gid=15&ty=$type&cancel=0&demolish=0"); + } + else header("Location: build.php?gid=15&ty=$type&nodemolish=".$demolish_permitted); + exit; } -}else{ - header("Location: banned.php"); - exit; -} } if($village->resarray['f'.$id] >= DEMOLISH_LEVEL_REQ) { @@ -46,13 +32,9 @@ if($village->resarray['f'.$id] >= DEMOLISH_LEVEL_REQ) { echo "cancel "; echo "".DEMOLITION_OF." ".$building->procResType($VillageResourceLevels['f'.$Demolition['buildnumber'].'t']).": ".$generator->getTimeFormat($Demolition['timetofinish']-time()).""; if($session->gold >= 2) { - if($session->access!=BANNED){ - ?> Finish all construction and research orders in this village immediately for 2 Gold? + ?> + Finish all construction and research orders in this village immediately for 2 Gold?Finish all construction and research orders in this village immediately for 2 Gold? - "; } else { diff --git a/Templates/Build/37_hero.tpl b/Templates/Build/37_hero.tpl index d5120a3e..04daae61 100644 --- a/Templates/Build/37_hero.tpl +++ b/Templates/Build/37_hero.tpl @@ -38,16 +38,8 @@ if (isset($_POST['name']) && !empty($_POST['name'])) { @@ -58,16 +50,8 @@ if (isset($_POST['name']) && !empty($_POST['name'])) { @@ -78,17 +62,8 @@ if (isset($_POST['name']) && !empty($_POST['name'])) { @@ -99,17 +74,8 @@ if (isset($_POST['name']) && !empty($_POST['name'])) { @@ -120,17 +86,8 @@ if (isset($_POST['name']) && !empty($_POST['name'])) { diff --git a/Templates/Build/37_land.tpl b/Templates/Build/37_land.tpl index ed10a776..f86daf43 100644 --- a/Templates/Build/37_land.tpl +++ b/Templates/Build/37_land.tpl @@ -4,14 +4,9 @@ $oasisarray = $database->getOasis($village->wid); if(isset($_GET['gid']) && $_GET['gid'] == 37 && isset($_GET['del']) && $database->getOasisField($_GET['del'], 'owner') == $session->uid){ -if($session->access != BANNED){ $database->removeOases($_GET['del']); header("Location: build.php?id=".$id."&land"); exit; -}else{ - header("Location: banned.php"); - exit; -} } ?>
<?php echo $hero_info['atk']; ?> 0 && $hero_info['attack'] < 100){ - if($session->access != BANNED){ - echo "(+)"; - }else{ - header("Location: banned.php"); - exit; - } - }else { - echo "(+)"; - } + if($hero_info['points'] > 0 && $hero_info['attack'] < 100) echo "(+)"; + else echo "(+)"; ?> <?php echo ($hero_info['di']) . " title="" /> 0 && $hero_info['defence'] < 100){ - if($session->access != BANNED){ - echo "(+)"; - }else{ - header("Location: banned.php"); - exit; - } - }else { - echo "(+)"; - } + if($hero_info['points'] > 0 && $hero_info['defence'] < 100) echo "(+)"; + else echo "(+)"; ?> <?php echo ($hero_info['ob']-1)*100; ?>% 0 && $hero_info['attackbonus'] < 100){ - if($session->access != BANNED){ - echo "(+)"; - }else{ - header("Location: banned.php"); - exit; - } - - }else { - echo "(+)"; - } + if($hero_info['points'] > 0 && $hero_info['attackbonus'] < 100) echo "(+)"; + else echo "(+)"; ?> <?php echo ($hero_info['db']-1)*100; ?>% 0 && $hero_info['defencebonus'] < 100){ - if($session->access != BANNED){ - echo "(+)"; - }else{ - header("Location: banned.php"); - exit; - } - - }else { - echo "(+)"; - } + if($hero_info['points'] > 0 && $hero_info['defencebonus'] < 100) echo "(+)"; + else echo "(+)"; ?> <?php echo ($hero_info['regeneration']*5*SPEED); ?>%/Day 0 && $hero_info['regeneration'] < 100){ - if($session->access != BANNED){ - echo "(+)"; - }else{ - header("Location: banned.php"); - exit; - } - - }else { - echo "(+)"; - } + if($hero_info['points'] > 0 && $hero_info['regeneration'] < 100) echo "(+)"; + else echo "(+)"; ?>
diff --git a/Templates/Build/37_revive.tpl b/Templates/Build/37_revive.tpl index ed2e4b5b..c4542b62 100644 --- a/Templates/Build/37_revive.tpl +++ b/Templates/Build/37_revive.tpl @@ -141,15 +141,10 @@ } if(isset($_GET['revive']) && $_GET['revive'] == 1 && isset($_GET['hid']) && $_GET['hid'] == $hero_datarow['heroid'] && $hero_datarow['inrevive'] == 0 && $hero_datarow['intraining'] == 0 && $hero_datarow['dead'] == 1){ - if($session->access != BANNED){ - mysqli_query($database->dblink,"UPDATE ".TB_PREFIX."hero SET `inrevive` = '1', `trainingtime` = '".(int) $training_time2."', `wref` = '".(int) $village->wid."' WHERE `heroid` = ".(int) $_GET['hid']." AND `uid` = '".(int) $session->uid."'"); - $database->modifyResource($village->wid, $wood, $clay, $iron, $crop, 0); - header("Location: build.php?id=".$id.""); - exit; - } else { - header("Location: banned.php"); - exit; - } + mysqli_query($database->dblink,"UPDATE ".TB_PREFIX."hero SET `inrevive` = '1', `trainingtime` = '".(int) $training_time2."', `wref` = '".(int) $village->wid."' WHERE `heroid` = ".(int) $_GET['hid']." AND `uid` = '".(int) $session->uid."'"); + $database->modifyResource($village->wid, $wood, $clay, $iron, $crop, 0); + header("Location: build.php?id=".$id.""); + exit; } } ?> diff --git a/Templates/Build/37_train.tpl b/Templates/Build/37_train.tpl index c810f67c..e582ae30 100644 --- a/Templates/Build/37_train.tpl +++ b/Templates/Build/37_train.tpl @@ -647,12 +647,11 @@ $output.=" // check for a valid unit value if (in_array($_GET['train'], $validationArray)) { - if($session->access != BANNED){ - if($count_hero < 3){ - $unitID = $_GET['train']; - mysqli_query($database->dblink,"INSERT INTO ".TB_PREFIX."hero (`uid`, `wref`, `regeneration`, `unit`, `name`, `level`, `points`, `experience`, `dead`, `health`, `attack`, `defence`, `attackbonus`, `defencebonus`, `trainingtime`, `autoregen`, `intraining`) VALUES (".$database->escape($session->uid).", " . (int) $village->wid . ", 0, ".$unitID.", '".$database->escape($session->username)."', 0, 5, 0, 0, 100, 0, 0, 0, 0, ".round((time() + (${'u'.$unitID}['time'] / SPEED)*3)).", 50, 1)"); - mysqli_query($database->dblink,"UPDATE " . TB_PREFIX . "units SET `u$unitID` = `u$unitID` - 1 WHERE `vref` = " . (int) $village->wid); - mysqli_query($database->dblink," + if($count_hero < 3){ + $unitID = $_GET['train']; + mysqli_query($database->dblink,"INSERT INTO ".TB_PREFIX."hero (`uid`, `wref`, `regeneration`, `unit`, `name`, `level`, `points`, `experience`, `dead`, `health`, `attack`, `defence`, `attackbonus`, `defencebonus`, `trainingtime`, `autoregen`, `intraining`) VALUES (".$database->escape($session->uid).", " . (int) $village->wid . ", 0, ".$unitID.", '".$database->escape($session->username)."', 0, 5, 0, 0, 100, 0, 0, 0, 0, ".round((time() + (${'u'.$unitID}['time'] / SPEED)*3)).", 50, 1)"); + mysqli_query($database->dblink,"UPDATE " . TB_PREFIX . "units SET `u$unitID` = `u$unitID` - 1 WHERE `vref` = " . (int) $village->wid); + mysqli_query($database->dblink," UPDATE " . TB_PREFIX . "vdata SET `wood` = `wood` - ".(int) ${'u'.$unitID}['wood'].", @@ -661,13 +660,9 @@ $output.=" `crop` = `crop` - ".(int) ${'u'.$unitID}['crop']." WHERE `wref` = " . (int) $village->wid); - } - header("Location: build.php?id=".$id.""); - exit; - }else{ - header("Location: banned.php"); - exit; } + header("Location: build.php?id=".$id.""); + exit; } } diff --git a/Templates/Building.tpl b/Templates/Building.tpl index 052b324f..57392072 100644 --- a/Templates/Building.tpl +++ b/Templates/Building.tpl @@ -17,29 +17,23 @@ $building->loadBuilding(); gold >= 2) { - if($session->access!=BANNED){ - ?> Finish all construction and research orders in this village immediately for 2 Gold? - Finish all construction and research orders in this village immediately for 2 Gold? - + Finish all construction and research orders in this village immediately for 2 Gold? + buildArray as $jobs) { if($jobs['master'] == 0){ echo ""; diff --git a/Templates/Plus/10.tpl b/Templates/Plus/10.tpl index 7378ba70..42528183 100644 --- a/Templates/Plus/10.tpl +++ b/Templates/Plus/10.tpl @@ -1,6 +1,6 @@ access != BANNED && $session->gold >= 5){ +if($session->gold >= 5){ $MyGold = mysqli_query($database->dblink,"SELECT gold, b2 FROM ".TB_PREFIX."users WHERE `id`='".$session->uid."'") or die(mysqli_error($database->dblink)); $golds = mysqli_fetch_array($MyGold); if($session->sit == 0) { @@ -24,8 +24,5 @@ if($session->access != BANNED && $session->gold >= 5){ } header("Location: plus.php?id=3"); exit; -} else { - header("Location: banned.php"); - exit; } ?> \ No newline at end of file diff --git a/Templates/Plus/11.tpl b/Templates/Plus/11.tpl index dd0c20a1..a66df829 100644 --- a/Templates/Plus/11.tpl +++ b/Templates/Plus/11.tpl @@ -1,6 +1,6 @@ access != BANNED && $session->gold >= 5){ +if($session->gold >= 5){ $MyGold = mysqli_query($database->dblink,"SELECT gold, b3 FROM ".TB_PREFIX."users WHERE `id`='".$session->uid."'") or die(mysqli_error($database->dblink)); $golds = mysqli_fetch_array($MyGold); if($session->sit == 0) { @@ -24,8 +24,5 @@ if($session->access != BANNED && $session->gold >= 5){ } header("Location: plus.php?id=3"); exit; -} else { - header("Location: banned.php"); - exit; } ?> \ No newline at end of file diff --git a/Templates/Plus/12.tpl b/Templates/Plus/12.tpl index c6305c94..2ea41910 100644 --- a/Templates/Plus/12.tpl +++ b/Templates/Plus/12.tpl @@ -1,6 +1,6 @@ access != BANNED && $session->gold >= 5){ +if($session->gold >= 5){ $MyGold = mysqli_query($database->dblink,"SELECT gold, b4 FROM ".TB_PREFIX."users WHERE `id`='".$session->uid."'") or die(mysqli_error($database->dblink)); $golds = mysqli_fetch_array($MyGold); if($session->sit == 0) { @@ -24,8 +24,5 @@ if($session->access != BANNED && $session->gold >= 5){ } header("Location: plus.php?id=3"); exit; -} else { - header("Location: banned.php"); - exit; } ?> \ No newline at end of file diff --git a/Templates/Plus/14.tpl b/Templates/Plus/14.tpl index b9f287fc..b2dafa54 100644 --- a/Templates/Plus/14.tpl +++ b/Templates/Plus/14.tpl @@ -1,6 +1,6 @@ access != BANNED){ + $MyVilId = mysqli_query($database->dblink,"SELECT * FROM ".TB_PREFIX."vdata WHERE `wref`='".$village->wid."'") or die(mysqli_error($database->dblink)); $uuVilid = mysqli_fetch_array($MyVilId); @@ -25,8 +25,5 @@ echo "failed"; header("Location: plus.php?id=3"); exit; -}else{ -header("Location: banned.php"); -exit; -} + ?> \ No newline at end of file diff --git a/Templates/Plus/15.tpl b/Templates/Plus/15.tpl index 29c5d665..01e27972 100644 --- a/Templates/Plus/15.tpl +++ b/Templates/Plus/15.tpl @@ -1,14 +1,8 @@ access != BANNED){ if($session->gold >= 100 && $session->sit == 0 && $session->goldclub == 0) { -mysqli_query($database->dblink,"UPDATE ".TB_PREFIX."users set goldclub = 1, gold = gold - 100 where `id`='".$session->uid."'"); + mysqli_query($database->dblink,"UPDATE ".TB_PREFIX."users set goldclub = 1, gold = gold - 100 where `id`='".$session->uid."'"); } header("Location: plus.php?id=3"); exit; - -}else{ -header("Location: banned.php"); -exit; -} - ?> \ No newline at end of file +?> \ No newline at end of file diff --git a/Templates/Plus/3.tpl b/Templates/Plus/3.tpl index 6ed48ab2..0641bfb0 100644 --- a/Templates/Plus/3.tpl +++ b/Templates/Plus/3.tpl @@ -1,22 +1,19 @@ dblink,"SELECT * FROM ".TB_PREFIX."users WHERE `id`='".$session->uid."'") or die(mysqli_error($database->dblink)); - $golds = mysqli_fetch_array($MyGold); +$MyGold = mysqli_query($database->dblink,"SELECT * FROM ".TB_PREFIX."users WHERE `id`='".$session->uid."'") or die(mysqli_error($database->dblink)); +$golds = mysqli_fetch_array($MyGold); include("Templates/Plus/pmenu.tpl"); - $MyGold = mysqli_query($database->dblink,"SELECT * FROM ".TB_PREFIX."users WHERE `id`='".$session->uid."'") or die(mysqli_error($database->dblink)); - $golds = mysqli_fetch_array($MyGold); +$MyGold = mysqli_query($database->dblink,"SELECT * FROM ".TB_PREFIX."users WHERE `id`='".$session->uid."'") or die(mysqli_error($database->dblink)); +$golds = mysqli_fetch_array($MyGold); - $today = date("mdHi"); +$today = date("mdHi"); -if (mysqli_num_rows($MyGold)) { - if($session->gold == 0) { - echo "

You currently don't own gold.

"; -} else { - echo "

You currently have $session->gold gold

"; -} +if(mysqli_num_rows($MyGold)){ + if($session->gold == 0) echo "

You currently don't own gold.

"; + else echo "

You currently have $session->gold gold

"; } ?> @@ -44,24 +41,25 @@ if (mysqli_num_rows($MyGold)) { Plus Account
"; - }else - if ($datetimep <= $date2) { - print "Your PLUS advantage has ended.
"; -mysqli_query($database->dblink,"UPDATE ".TB_PREFIX."users set plus = '0' where `id`='".$session->uid."'") or die(mysqli_error($database->dblink)); - } else { +if ($datetimep == 0) echo "get PLUS
"; +else +{ + if ($datetimep <= $date2) { + print "Your PLUS advantage has ended.
"; + mysqli_query($database->dblink,"UPDATE ".TB_PREFIX."users set plus = '0' where `id`='".$session->uid."'") or die(mysqli_error($database->dblink)); + } else { $holdtotmin=(($datetimep-$date2)/60); $holdtothr=(($datetimep-$date2)/3600); diff --git a/Templates/Plus/5.tpl b/Templates/Plus/5.tpl index 746e205f..ee48f569 100644 --- a/Templates/Plus/5.tpl +++ b/Templates/Plus/5.tpl @@ -12,12 +12,7 @@ include("Templates/Plus/pmenu.tpl");

How is it done?

1) Invite your friends via Email

-access != BANNED){ ?>

» Invite by e-mail

- - -

» Invite by e-mail

-

2) Copy your personal REF-Link and share it!

Your personal REF Link:
anmelden.php?uid=ref_uid; ?> diff --git a/Templates/Plus/7.tpl b/Templates/Plus/7.tpl index 5553a9be..df055223 100644 --- a/Templates/Plus/7.tpl +++ b/Templates/Plus/7.tpl @@ -1,9 +1,4 @@ - access!=BANNED){ - $building->finishAll('plus.php?id=3'); - exit; - }else{ - header("Location: banned.php"); - exit; - } +finishAll('plus.php?id=3'); +exit; ?> diff --git a/Templates/Plus/8.tpl b/Templates/Plus/8.tpl index ee3a540d..acd0674c 100644 --- a/Templates/Plus/8.tpl +++ b/Templates/Plus/8.tpl @@ -1,6 +1,6 @@ access != BANNED && $session->gold >= 10){ +if($session->gold >= 10){ $MyGold = mysqli_query($database->dblink,"SELECT gold, plus FROM ".TB_PREFIX."users WHERE `id`='".$session->uid."'") or die(mysqli_error($database->dblink)); $golds = mysqli_fetch_array($MyGold); if($session->sit == 0) { @@ -24,8 +24,5 @@ if($session->access != BANNED && $session->gold >= 10){ } header("Location: plus.php?id=3"); exit; -} else { - header("Location: banned.php"); - exit; } ?> \ No newline at end of file diff --git a/Templates/Plus/9.tpl b/Templates/Plus/9.tpl index fece2414..71826d30 100644 --- a/Templates/Plus/9.tpl +++ b/Templates/Plus/9.tpl @@ -1,6 +1,6 @@ access != BANNED && $session->gold >= 5){ +if($session->gold >= 5){ $MyGold = mysqli_query($database->dblink,"SELECT gold, b1 FROM ".TB_PREFIX."users WHERE `id`='".$session->uid."'") or die(mysqli_error($database->dblink)); $golds = mysqli_fetch_array($MyGold); if($session->sit == 0) { @@ -24,8 +24,5 @@ if($session->access != BANNED && $session->gold >= 5){ } header("Location: plus.php?id=3"); exit; -} else { - header("Location: banned.php"); - exit; } ?> \ No newline at end of file diff --git a/Templates/Plus/invite.tpl b/Templates/Plus/invite.tpl index 1c1b0296..cef79d28 100644 --- a/Templates/Plus/invite.tpl +++ b/Templates/Plus/invite.tpl @@ -12,7 +12,6 @@ include("Templates/Plus/pmenu.tpl");

How is it done?

1) Invite your friends via Email

-access != BANNED){ ?>

Own text:

@@ -21,9 +20,6 @@ hi, please use this link. anmelden.php?uid=ref_uid; ?>

- -

» Invite by e-mail

-

2) Copy your personal REF-Link and share it!

Your personal REF Link:
anmelden.php?uid=ref_uid; ?> diff --git a/Templates/Profile/preference.tpl b/Templates/Profile/preference.tpl index c0ca4c81..a612e45d 100644 --- a/Templates/Profile/preference.tpl +++ b/Templates/Profile/preference.tpl @@ -20,75 +20,68 @@ if(isset($_GET['del']) && is_numeric($_GET['del'])){ ################################################################################# // Save new link or just edit a link if($_POST) { - $links = array(); + $links = []; // let's do some complicated code x'D foreach($_POST as $key => $value) { - if(substr($key, 0, 2) == 'nr') { - $i = substr($key, 2); - $links[$i]['nr'] = mysqli_real_escape_string($database->dblink, $value); - } - - if(substr($key, 0, 2) == 'id') { - $i = substr($key, 2); - $links[$i]['id'] = mysqli_real_escape_string($database->dblink, $value); - } - - if(substr($key, 0, 8) == 'linkname') { - $i = substr($key, 8); - $links[$i]['linkname'] = mysqli_real_escape_string($database->dblink, $value); - } - - if(substr($key, 0, 8) == 'linkziel') { - $i = substr($key, 8); - $links[$i]['linkziel'] = mysqli_real_escape_string($database->dblink, $value); - } + if(substr($key, 0, 2) == 'nr') { + $i = substr($key, 2); + $links[$i]['nr'] = mysqli_real_escape_string($database->dblink, $value); + } + + if(substr($key, 0, 2) == 'id') { + $i = substr($key, 2); + $links[$i]['id'] = mysqli_real_escape_string($database->dblink, $value); + } + + if(substr($key, 0, 8) == 'linkname') { + $i = substr($key, 8); + $links[$i]['linkname'] = mysqli_real_escape_string($database->dblink, $value); + } + + if(substr($key, 0, 8) == 'linkziel') { + $i = substr($key, 8); + $links[$i]['linkziel'] = mysqli_real_escape_string($database->dblink, $value); + } } // Save foreach($links as $link) { - settype($link['nr'], 'int'); - - if(trim($link['nr']) != '' AND trim($link['linkname']) != '' AND trim($link['linkziel']) != '' AND trim($link['id']) == '') { - // Add new link - $userid = (int) $session->uid; - if($session->access!=BANNED){ - $query = mysqli_query($database->dblink,'INSERT INTO `' . TB_PREFIX . 'links` (`userid`, `name`, `url`, `pos`) VALUES (' . $userid . ', \'' . $link['linkname'] . '\', \'' . $link['linkziel'] . '\', ' . $link['nr'] . ')'); - }else{ - header("Location: banned.php"); - exit; - } - } elseif(trim($link['nr']) != '' AND trim($link['linkname']) != '' AND trim($link['linkziel']) != '' AND trim($link['id']) != '') { - // Update link - $query = mysqli_query($database->dblink,'SELECT userid FROM `' . TB_PREFIX . 'links` WHERE `id` = ' . $link['id']); - $data = mysqli_fetch_assoc($query); - - // May the user update this entry? - if($data['userid'] == $session->uid) { - $query2 = mysqli_query($database->dblink,'UPDATE `' . TB_PREFIX . 'links` SET `name` = \'' . $link['linkname'] . '\', `url` = \'' . $link['linkziel'] . '\', `pos` = ' . $link['nr'] . ' WHERE `id` = ' . $link['id']); - } - } elseif(trim($link['nr']) == '' AND trim($link['linkname']) == '' AND trim($link['linkziel']) == '' AND trim($link['id']) != '') { - // Delete entry - $query = mysqli_query($database->dblink,'SELECT userid FROM `' . TB_PREFIX . 'links` WHERE `id` = ' . $link['id']); - $data = mysqli_fetch_assoc($query); - - // May the user delete this entry? - if($data['userid'] == $session->uid) { - $query2 = mysqli_query($database->dblink,'DELETE FROM `' . TB_PREFIX . 'links` WHERE `id` = ' . $link['id']); - } - } + settype($link['nr'], 'int'); + + if(trim($link['nr']) != '' AND trim($link['linkname']) != '' AND trim($link['linkziel']) != '' AND trim($link['id']) == '') { + // Add new link + $userid = (int) $session->uid; + $query = mysqli_query($database->dblink,'INSERT INTO `' . TB_PREFIX . 'links` (`userid`, `name`, `url`, `pos`) VALUES (' . $userid . ', \'' . $link['linkname'] . '\', \'' . $link['linkziel'] . '\', ' . $link['nr'] . ')'); + + } elseif(trim($link['nr']) != '' AND trim($link['linkname']) != '' AND trim($link['linkziel']) != '' AND trim($link['id']) != '') { + // Update link + $query = mysqli_query($database->dblink,'SELECT userid FROM `' . TB_PREFIX . 'links` WHERE `id` = ' . $link['id']); + $data = mysqli_fetch_assoc($query); + + // May the user update this entry? + if($data['userid'] == $session->uid) { + $query2 = mysqli_query($database->dblink,'UPDATE `' . TB_PREFIX . 'links` SET `name` = \'' . $link['linkname'] . '\', `url` = \'' . $link['linkziel'] . '\', `pos` = ' . $link['nr'] . ' WHERE `id` = ' . $link['id']); + } + } elseif(trim($link['nr']) == '' AND trim($link['linkname']) == '' AND trim($link['linkziel']) == '' AND trim($link['id']) != '') { + // Delete entry + $query = mysqli_query($database->dblink,'SELECT userid FROM `' . TB_PREFIX . 'links` WHERE `id` = ' . $link['id']); + $data = mysqli_fetch_assoc($query); + + // May the user delete this entry? + if($data['userid'] == $session->uid) { + $query2 = mysqli_query($database->dblink,'DELETE FROM `' . TB_PREFIX . 'links` WHERE `id` = ' . $link['id']); + } + } } - - print ''; + echo ''; } // Fetch all links $query = mysqli_query($database->dblink,'SELECT * FROM `' . TB_PREFIX . 'links` WHERE `userid` = ' . (int) $session->uid . ' ORDER BY `pos` ASC') or die(mysqli_error($database->dblink)); -$links = array(); -while($data = mysqli_fetch_assoc($query)) { - $links[] = $data; -} +$links = []; +while($data = mysqli_fetch_assoc($query)) $links[] = $data; ?>

Player profile

diff --git a/build.php b/build.php index 5d607a95..6a5239af 100644 --- a/build.php +++ b/build.php @@ -71,120 +71,94 @@ if ($session->goldclub == 1 && count($session->villages) > 1) { if (isset($_POST['routeid'])) $routeid = $_POST['routeid']; if (isset($_POST['action']) && $_POST['action'] == 'addRoute') { - if ($session->access != BANNED) { - if ($session->gold >= 2 && $session->goldclub == 1) { - for ($i = 1; $i <= 4; $i ++) { - if (empty($_POST['r'.$i])) { - $_POST['r'.$i] = 0; - } - } - - $totalres = preg_replace("/[^0-9]/", "", $_POST['r1']) + preg_replace("/[^0-9]/", "", $_POST['r2']) + preg_replace("/[^0-9]/", "", $_POST['r3']) + preg_replace("/[^0-9]/", "", $_POST['r4']); - $reqMerc = ceil(($totalres - 0.1) / $market->maxcarry); - $second = date("s"); - $minute = date("i"); - $hour = date("G") - $_POST['start']; - - if (date("G") > $_POST['start']) $day = 1; - else $day = 0; - - $timestamp = strtotime("-$hour hours -$second second -$minute minutes +$day day"); - - if ($totalres > 0 && $_POST['tvillage'] != $village->wid && in_array($_POST['tvillage'], $session->villages) && ($_POST['start'] >= 0 && $_POST['start'] <= 23) && ($_POST['deliveries'] >= 1 && $_POST['deliveries'] <= 3)) { - $database->createTradeRoute($session->uid, $_POST['tvillage'], $village->wid, $_POST['r1'], $_POST['r2'], $_POST['r3'], $_POST['r4'], $_POST['start'], $_POST['deliveries'], $reqMerc, $timestamp); - $route = 1; - header("Location: build.php?gid=17&t=4"); - exit; - } else { - $route = 1; - header("Location: build.php?gid=17&t=4&create"); - exit; - } + if ($session->gold >= 2 && $session->goldclub == 1) { + for ($i = 1; $i <= 4; $i ++) { + if (empty($_POST['r'.$i])) $_POST['r'.$i] = 0; + } + + $totalres = preg_replace("/[^0-9]/", "", $_POST['r1']) + preg_replace("/[^0-9]/", "", $_POST['r2']) + preg_replace("/[^0-9]/", "", $_POST['r3']) + preg_replace("/[^0-9]/", "", $_POST['r4']); + $reqMerc = ceil(($totalres - 0.1) / $market->maxcarry); + $second = date("s"); + $minute = date("i"); + $hour = date("G") - $_POST['start']; + + if (date("G") > $_POST['start']) $day = 1; + else $day = 0; + + $timestamp = strtotime("-$hour hours -$second second -$minute minutes +$day day"); + + if ($totalres > 0 && $_POST['tvillage'] != $village->wid && in_array($_POST['tvillage'], $session->villages) && ($_POST['start'] >= 0 && $_POST['start'] <= 23) && ($_POST['deliveries'] >= 1 && $_POST['deliveries'] <= 3)) { + $database->createTradeRoute($session->uid, $_POST['tvillage'], $village->wid, $_POST['r1'], $_POST['r2'], $_POST['r3'], $_POST['r4'], $_POST['start'], $_POST['deliveries'], $reqMerc, $timestamp); + $route = 1; + header("Location: build.php?gid=17&t=4"); + exit; + } else { + $route = 1; + header("Location: build.php?gid=17&t=4&create"); + exit; } - } else { - $route = 0; - header("Location: banned.php"); - exit; } } if (isset($_POST['routeid']) && isset($_POST['action']) && $_POST['action'] == 'extendRoute') { - if ($session->access != BANNED) { - if ($session->gold >= 2 && $session->goldclub == 1) { - $traderoute = $database->getTradeRouteUid($_POST['routeid']); - if ($traderoute == $session->uid) { - $database->editTradeRoute($_POST['routeid'], "timeleft", 604800, 1); - $newgold = $session->gold - 2; - $database->updateUserField($session->uid, 'gold', $newgold, 1); + if ($session->gold >= 2 && $session->goldclub == 1) { + $traderoute = $database->getTradeRouteUid($_POST['routeid']); + if ($traderoute == $session->uid) { + $database->editTradeRoute($_POST['routeid'], "timeleft", 604800, 1); + $newgold = $session->gold - 2; + $database->updateUserField($session->uid, 'gold', $newgold, 1); + } + } + $route = 1; + unset($routeid); + header("Location: build.php?gid=17&t=4"); + exit; + } + + if (isset($_POST['routeid']) && isset($_POST['action']) && $_POST['action'] == 'editRoute2') { + if($session->goldclub == 1){ + for ($i = 1; $i <= 4; $i ++) { + if (empty($_POST['r'.$i])) { + $_POST['r'.$i] = 0; } - } + } + $totalres = preg_replace("/[^0-9]/", "", $_POST['r1']) + preg_replace("/[^0-9]/", "", $_POST['r2']) + preg_replace("/[^0-9]/", "", $_POST['r3']) + preg_replace("/[^0-9]/", "", $_POST['r4']); + $reqMerc = ceil(($totalres - 0.1) / $market->maxcarry); + + $traderoute = $database->getTradeRouteUid($_POST['routeid']); + if ($totalres > 0 && $traderoute == $session->uid && ($_POST['start'] >= 0 && $_POST['start'] <= 23) && ($_POST['deliveries'] >= 1 && $_POST['deliveries'] <= 3)) { + $database->editTradeRoute($_POST['routeid'], "wood", $_POST['r1'], 0); + $database->editTradeRoute($_POST['routeid'], "clay", $_POST['r2'], 0); + $database->editTradeRoute($_POST['routeid'], "iron", $_POST['r3'], 0); + $database->editTradeRoute($_POST['routeid'], "crop", $_POST['r4'], 0); + $database->editTradeRoute($_POST['routeid'], "start", $_POST['start'], 0); + $database->editTradeRoute($_POST['routeid'], "deliveries", $_POST['deliveries'], 0); + $database->editTradeRoute($_POST['routeid'], "merchant", $reqMerc, 0); + $second = date("s"); + $minute = date("i"); + $hour = date("G") - $_POST['start']; + if (date("G") > $_POST['start']) $day = 1; + else $day = 0; + $timestamp = strtotime("-$hour hours -$second seconds -$minute minutes +$day day"); + $database->editTradeRoute($_POST['routeid'], "timestamp", $timestamp, 0); + } + $route = 1; unset($routeid); header("Location: build.php?gid=17&t=4"); exit; - } else { - $route = 0; - header("Location: banned.php"); - exit; - } - } - - if (isset($_POST['routeid']) && isset($_POST['action']) && $_POST['action'] == 'editRoute2') { - if ($session->access != BANNED) { - if($session->goldclub == 1){ - for ($i = 1; $i <= 4; $i ++) { - if (empty($_POST['r'.$i])) { - $_POST['r'.$i] = 0; - } - } - $totalres = preg_replace("/[^0-9]/", "", $_POST['r1']) + preg_replace("/[^0-9]/", "", $_POST['r2']) + preg_replace("/[^0-9]/", "", $_POST['r3']) + preg_replace("/[^0-9]/", "", $_POST['r4']); - $reqMerc = ceil(($totalres - 0.1) / $market->maxcarry); - - $traderoute = $database->getTradeRouteUid($_POST['routeid']); - if ($totalres > 0 && $traderoute == $session->uid && ($_POST['start'] >= 0 && $_POST['start'] <= 23) && ($_POST['deliveries'] >= 1 && $_POST['deliveries'] <= 3)) { - $database->editTradeRoute($_POST['routeid'], "wood", $_POST['r1'], 0); - $database->editTradeRoute($_POST['routeid'], "clay", $_POST['r2'], 0); - $database->editTradeRoute($_POST['routeid'], "iron", $_POST['r3'], 0); - $database->editTradeRoute($_POST['routeid'], "crop", $_POST['r4'], 0); - $database->editTradeRoute($_POST['routeid'], "start", $_POST['start'], 0); - $database->editTradeRoute($_POST['routeid'], "deliveries", $_POST['deliveries'], 0); - $database->editTradeRoute($_POST['routeid'], "merchant", $reqMerc, 0); - $second = date("s"); - $minute = date("i"); - $hour = date("G") - $_POST['start']; - if (date("G") > $_POST['start']) $day = 1; - else $day = 0; - $timestamp = strtotime("-$hour hours -$second seconds -$minute minutes +$day day"); - $database->editTradeRoute($_POST['routeid'], "timestamp", $timestamp, 0); - } - - $route = 1; - unset($routeid); - header("Location: build.php?gid=17&t=4"); - exit; - } else { - $route = 0; - header("Location: banned.php"); - exit; - } } } if (isset($_POST['routeid']) && isset($_POST['action']) && $_POST['action'] == 'delRoute') { - if ($session->access != BANNED ) { - if($session->goldclub == 1){ - $traderoute = $database->getTradeRouteUid($_POST['routeid']); - if ($traderoute == $session->uid) $database->deleteTradeRoute($_POST['routeid']); - $route = 1; - unset($routeid); - header("Location: build.php?gid=17&t=4"); - exit; - } else { - $route = 0; - header("Location: banned.php"); - exit; - } - } + if($session->goldclub == 1){ + $traderoute = $database->getTradeRouteUid($_POST['routeid']); + if ($traderoute == $session->uid) $database->deleteTradeRoute($_POST['routeid']); + $route = 1; + unset($routeid); + header("Location: build.php?gid=17&t=4"); + exit; + } } } @@ -212,14 +186,7 @@ if ($session->goldclub == 1) { exit; } - if(isset($_POST['action']) && $_POST['action'] == 'startRaid') { - if($session->access != BANNED) $units->startRaidList($_POST); - else - { - header( "Location: banned.php"); - exit; - } - } + if(isset($_POST['action']) && $_POST['action'] == 'startRaid') $units->startRaidList($_POST); if(isset($_GET['slid']) && is_numeric($_GET['slid'])) { $FLData = $database->getFLData($_GET['slid']); @@ -243,37 +210,25 @@ if ($session->goldclub == 1) { } else $create = 0; -if(isset($_POST['a']) == 533374 && isset($_POST['id']) == 39) { - if($session->access != BANNED) $units->Settlers($_POST); - else - { - header( "Location: banned.php" ); - exit; - } -} +if(isset($_POST['a']) == 533374 && isset($_POST['id']) == 39) $units->Settlers($_POST); if(isset($_GET['mode']) && $_GET['mode'] == 'troops' && isset($_GET['cancel']) && $_GET['cancel'] == 1){ - if($session->access != BANNED){ - $oldmovement = $database->getMovementById($_GET['moveid']); - $now = time(); - if(($now - $oldmovement[0]['starttime']) < 90 && $oldmovement[0]['from'] == $village->wid){ - $qc = "SELECT Count(*) as Total FROM " . TB_PREFIX . "movement where proc = 0 and moveid = " . $database->escape((int)$_GET['moveid']); - $resultc = mysqli_fetch_array(mysqli_query($database->dblink, $qc), MYSQLI_ASSOC); - if($resultc['Total'] == 1){ - $q = "UPDATE " . TB_PREFIX . "movement set proc = 1 where proc = 0 and moveid = " . $database->escape((int)$_GET['moveid']); - $database->query($q); - $end = $now + ($now - $oldmovement[0]['starttime']); - $q2 = "SELECT id FROM " . TB_PREFIX . "send ORDER BY id DESC"; - $lastid = mysqli_fetch_array(mysqli_query($database->dblink, $q2)); - $database->addMovement(4, $oldmovement[0]['to'], $oldmovement[0]['from'], $oldmovement[0]['ref'], $now, $end); - } - } - header("Location: " . $_SERVER['PHP_SELF'] . "?id=" . $_GET['id']); - exit(); - }else{ - header("Location: banned.php"); - exit(); - } + $oldmovement = $database->getMovementById($_GET['moveid']); + $now = time(); + if(($now - $oldmovement[0]['starttime']) < 90 && $oldmovement[0]['from'] == $village->wid){ + $qc = "SELECT Count(*) as Total FROM " . TB_PREFIX . "movement where proc = 0 and moveid = " . $database->escape((int)$_GET['moveid']); + $resultc = mysqli_fetch_array(mysqli_query($database->dblink, $qc), MYSQLI_ASSOC); + if($resultc['Total'] == 1){ + $q = "UPDATE " . TB_PREFIX . "movement set proc = 1 where proc = 0 and moveid = " . $database->escape((int)$_GET['moveid']); + $database->query($q); + $end = $now + ($now - $oldmovement[0]['starttime']); + $q2 = "SELECT id FROM " . TB_PREFIX . "send ORDER BY id DESC"; + $lastid = mysqli_fetch_array(mysqli_query($database->dblink, $q2)); + $database->addMovement(4, $oldmovement[0]['to'], $oldmovement[0]['from'], $oldmovement[0]['ref'], $now, $end); + } + } + header("Location: " . $_SERVER['PHP_SELF'] . "?id=" . $_GET['id']); + exit(); } ?> diff --git a/packages.php b/packages.php index 0ff89303..523b331a 100644 --- a/packages.php +++ b/packages.php @@ -5,7 +5,7 @@ $start_timer = $generator->pageLoadTimeStart(); ################################################################################# ## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ## ## --------------------------------------------------------------------------- ## -## Filename banned.php ## +## Filename packages.php ## ## Developed by: yi12345 ## ## Copyright: TravianX (c) 2010-2011. All rights reserved. ## ## ## @@ -17,7 +17,6 @@ include_once("GameEngine/Village.php"); AccessLogger::logRequest(); $id = $_GET['id']; -if($session->access != BANNED){ ?> @@ -111,7 +110,4 @@ echo round(($generator->pageLoadTimeEnd()-$start_timer)*1000);
- - + \ No newline at end of file
checker\">"; echo "\"cancel\""; echo Building::procResType($jobs['type'])." (Level ".$jobs['level'].")"; - if($jobs['loopcon'] == 0) { $BuildingList[] = $jobs['field']; } - if($jobs['loopcon'] == 1) { - echo " (waiting loop)"; - } + + if($jobs['loopcon'] == 1) echo " (waiting loop)"; + echo "in timer."\">"; echo $generator->getTimeFormat($jobs['timestamp']-time()); echo " hrs.