feat: Admins can be attacked, raided and traded with via config option

This commit is contained in:
Martin Ambrus
2017-10-22 20:28:03 +02:00
parent d1ff824278
commit 53f54ce9e9
28 changed files with 61 additions and 20 deletions
+3 -3
View File
@@ -14,7 +14,7 @@ var carry = <?php echo $market->maxcarry; ?>;
//-->
</script>
<?php
$allres = $_POST['r1']+$_POST['r2']+$_POST['r3']+$_POST['r4'];
$allres = (int) $_POST['r1'] + (int) $_POST['r2'] + (int) $_POST['r3'] + (int) $_POST['r4'];
if($_POST['x']!="" && $_POST['y']!="" && is_numeric($_POST['x']) && is_numeric($_POST['y'])){
$getwref = $database->getVilWref($_POST['x'],$_POST['y']);
$checkexist = $database->checkVilExist($getwref);
@@ -29,7 +29,7 @@ $userAccess = $database->getUserField($villageOwner,'access',0);
}
$maxcarry = $market->maxcarry;
$maxcarry *= $market->merchantAvail();
if(isset($_POST['ft'])=='check' && $allres!=0 && $allres <= $maxcarry && ($_POST['x']!="" && $_POST['y']!="" or $_POST['dname']!="") && $checkexist && $userAccess == 2){
if(isset($_POST['ft'])=='check' && $allres!=0 && $allres <= $maxcarry && ($_POST['x']!="" && $_POST['y']!="" or $_POST['dname']!="") && $checkexist && ($userAccess == 2 || (ADMIN_ALLOW_INCOMING_RAIDS && $userAccess == 9))){
?>
<form method="POST" name="snd" action="build.php">
<input type="hidden" name="ft" value="mk1">
@@ -213,7 +213,7 @@ if(isset($_POST['ft'])=='check'){
$error = '<span class="error"><b>'.NO_COORDINATES_SELECTED.'</b></span>';
}elseif($getwref == $village->wid){
$error = '<span class="error"><b>'.CANNOT_SEND_RESOURCES.'</b></span>';
}elseif($userAccess == '0' or $userAccess == '8' or $userAccess == '9'){
}elseif($userAccess == '0' or $userAccess == '8' or (!ADMIN_ALLOW_INCOMING_RAIDS && $userAccess == '9')){
$error = '<span class="error"><b>'.BANNED_CANNOT_SEND_RESOURCES.'.</b></span>';
}elseif($_POST['r1']==0 && $_POST['r2']==0 && $_POST['r3']==0 && $_POST['r4']==0){
$error = '<span class="error"><b>'.RESOURCES_NO_SELECTED.'.</b></span>';
+2 -2
View File
@@ -515,7 +515,7 @@ if($type==18 or $type==19 or $type==20 or $type==21){
$data1 = mysqli_fetch_assoc($query1);
$query2 = mysqli_query($GLOBALS['link'],'SELECT * FROM `' . TB_PREFIX . 'users` WHERE `id` = ' . $data1['owner']);
$data2 = mysqli_fetch_assoc($query2);
if($data2['access']=='0' or $data2['access']=='8' or $data2['access']=='9') {
if($data2['access']=='0' or $data2['access']=='8' or (!ADMIN_ALLOW_INCOMING_RAIDS && $data2['access']=='9')) {
echo "&raquo; ".SENDTROOP." (".BAN.")";
} else if($data2['vac_mode']=='1') {
echo "&raquo; Send troops. (Vacation mode on)";
@@ -530,7 +530,7 @@ if($type==18 or $type==19 or $type==20 or $type==21){
<tr>
<td class="none">
<?php
if($data2['access']=='0' or $data2['access']=='8' or $data2['access']=='9') {
if($data2['access']=='0' or $data2['access']=='8' or (!ADMIN_ALLOW_INCOMING_RAIDS && $data2['access']=='9')) {
echo "&raquo; ".SENDMERC." (".BAN.")";
} else if($data2['vac_mode']=='1') {
echo "&raquo; Send merchant(s). (Vacation mode on)";
+1 -1
View File
@@ -30,7 +30,7 @@ if($database->getVillageField($dataarray[1],'name')!="??") {
<tr><td colspan="2" class="report_content">
<table cellpadding="1" cellspacing="1" id="trade"><thead><tr>
<td>&nbsp;</td>
<td>><?php echo $user_url;?> from the village <?php echo $from_url;?></td>
<td><?php echo $user_url;?> from the village <?php echo $from_url;?></td>
</tr></thead><tbody><tr>
<th>Resources</th>
<td>
+1 -1
View File
@@ -30,7 +30,7 @@ if($database->getVillageField($dataarray[1],'name')!="??") {
<tr><td colspan="2" class="report_content">
<table cellpadding="1" cellspacing="1" id="trade"><thead><tr>
<td>&nbsp;</td>
<td>><?php echo $user_url;?> from the village <?php echo $from_url;?></td>
<td><?php echo $user_url;?> from the village <?php echo $from_url;?></td>
</tr></thead><tbody><tr>
<th>Resources</th>
<td>
+1 -1
View File
@@ -30,7 +30,7 @@ if($database->getVillageField($dataarray[1],'name')!="??") {
<tr><td colspan="2" class="report_content">
<table cellpadding="1" cellspacing="1" id="trade"><thead><tr>
<td>&nbsp;</td>
<td>><?php echo $user_url;?> from the village <?php echo $from_url;?></td>
<td><?php echo $user_url;?> from the village <?php echo $from_url;?></td>
</tr></thead><tbody><tr>
<th>Resources</th>
<td>
+1 -1
View File
@@ -30,7 +30,7 @@ if($database->getVillageField($dataarray[1],'name')!="??") {
<tr><td colspan="2" class="report_content">
<table cellpadding="1" cellspacing="1" id="trade"><thead><tr>
<td>&nbsp;</td>
<td>><?php echo $user_url;?> from the village <?php echo $from_url;?></td>
<td><?php echo $user_url;?> from the village <?php echo $from_url;?></td>
</tr></thead><tbody><tr>
<th>Resources</th>
<td>
+1 -1
View File
@@ -30,7 +30,7 @@ if($database->getVillageField($dataarray[1],'name')!="??") {
<tr><td colspan="2" class="report_content">
<table cellpadding="1" cellspacing="1" id="trade"><thead><tr>
<td>&nbsp;</td>
<td>><?php echo $user_url;?> from the village <?php echo $from_url;?></td>
<td><?php echo $user_url;?> from the village <?php echo $from_url;?></td>
</tr></thead><tbody><tr>
<th>Resources</th>
<td>
+1 -1
View File
@@ -15,7 +15,7 @@
$t11 = 0;
$villageOwner = $database->getVillageField($wref,'owner');
$userAccess = $database->getUserField($villageOwner,'access',0);
if($userAccess != '0' && $userAccess != '8' && $userAccess != '9'){
if($userAccess != '0' && $userAccess != '8' && ($userAccess != '9' || (ADMIN_ALLOW_INCOMING_RAIDS && $userAccess == '9'))){
if($tribe == 1){ $uname = "u"; } elseif($tribe == 2){ $uname = "u1"; } elseif($tribe == 3){ $uname = "u2"; }elseif($tribe == 4){ $uname = "u3"; }else {$uname = "u4"; }
if($tribe == 1){ $uname1 = "u1"; } elseif($tribe == 2){ $uname1 = "u2"; } elseif($tribe == 3){ $uname1 = "u3"; }elseif($tribe == 4){ $uname1 = "u4"; }else {$uname1 = "u5"; }
if($tribe == 1){ $uname2 = ""; } elseif($tribe == 2){ $uname2 = "1"; } elseif($tribe == 3){ $uname2 = "2"; }elseif($tribe == 4){ $uname2 = "3"; }else {$uname2 = "4"; }