diff --git a/Admin/Templates/Notice/10.tpl b/Admin/Templates/Notice/10.tpl index 58b03e98..b17023a6 100644 --- a/Admin/Templates/Notice/10.tpl +++ b/Admin/Templates/Notice/10.tpl @@ -30,7 +30,7 @@ $date = $generator->procMtime($rep[0]['time']); ?> - +
 > from the village from the village
Resources diff --git a/Admin/Templates/Notice/11.tpl b/Admin/Templates/Notice/11.tpl index 339dce01..314efa85 100644 --- a/Admin/Templates/Notice/11.tpl +++ b/Admin/Templates/Notice/11.tpl @@ -30,7 +30,7 @@ $date = $generator->procMtime($rep[0]['time']); ?>
- +
 > from the village from the village
Resources diff --git a/Admin/Templates/Notice/12.tpl b/Admin/Templates/Notice/12.tpl index 58b03e98..b17023a6 100644 --- a/Admin/Templates/Notice/12.tpl +++ b/Admin/Templates/Notice/12.tpl @@ -30,7 +30,7 @@ $date = $generator->procMtime($rep[0]['time']); ?>
- +
 > from the village from the village
Resources diff --git a/Admin/Templates/Notice/13.tpl b/Admin/Templates/Notice/13.tpl index 58b03e98..b17023a6 100644 --- a/Admin/Templates/Notice/13.tpl +++ b/Admin/Templates/Notice/13.tpl @@ -30,7 +30,7 @@ $date = $generator->procMtime($rep[0]['time']); ?>
- + + + + + +
 > from the village from the village
Resources diff --git a/Admin/Templates/Notice/14.tpl b/Admin/Templates/Notice/14.tpl index 58b03e98..b17023a6 100644 --- a/Admin/Templates/Notice/14.tpl +++ b/Admin/Templates/Notice/14.tpl @@ -30,7 +30,7 @@ $date = $generator->procMtime($rep[0]['time']); ?>
- + + + + +
 > from the village from the village
Resources diff --git a/Admin/Templates/config.tpl b/Admin/Templates/config.tpl index 2e03c971..d3e7bb00 100644 --- a/Admin/Templates/config.tpl +++ b/Admin/Templates/config.tpl @@ -398,6 +398,10 @@ if($_SESSION['access'] < 9) die(ACCESS_DENIED_ADMIN); Include Support Messages in Admin Mailbox Enabled"; } else if(ADMIN_RECEIVE_SUPPORT_MESSAGES == false){ echo "Disabled"; } ?>
Allow Administrative Accounts to be Raided and AttackedYes"; } else if(ADMIN_ALLOW_INCOMING_RAIDS == false){ echo "No"; } ?>
Include Support Messages in Admin Mailbox:
Allow Administrative Accounts to be Raided and Attacked: + +

diff --git a/GameEngine/Admin/Mods/constant_format.tpl b/GameEngine/Admin/Mods/constant_format.tpl index f2166b5c..026d87ce 100755 --- a/GameEngine/Admin/Mods/constant_format.tpl +++ b/GameEngine/Admin/Mods/constant_format.tpl @@ -274,6 +274,9 @@ define("ADMIN_NAME", "%ANAME%"); // ***** Show Support Messages in Admin define("ADMIN_RECEIVE_SUPPORT_MESSAGES", %ASUPPMSGS%); +// ***** Allow Admin accounts to be raided and attacked +define("ADMIN_ALLOW_INCOMING_RAIDS", %ARAIDS%); + ////////////////////////////////////////// diff --git a/GameEngine/Admin/Mods/editAdminInfo.php b/GameEngine/Admin/Mods/editAdminInfo.php index 8777db2d..4cb12b81 100755 --- a/GameEngine/Admin/Mods/editAdminInfo.php +++ b/GameEngine/Admin/Mods/editAdminInfo.php @@ -100,6 +100,7 @@ $fh = fopen($myFile, 'w') or die("


Can't open file: GameEngine\con $text = preg_replace("'%AEMAIL%'", $_POST['aemail'], $text); $text = preg_replace("'%ANAME%'", $_POST['aname'], $text); $text = preg_replace("'%ASUPPMSGS%'", ($_POST['admin_support_msgs'] == 'True' ? 'true' : 'false'), $text); + $text = preg_replace("'%ARAIDS%'", ($_POST['admin_raidable'] == 'True' ? 'true' : 'false'), $text); $text = preg_replace("'%UTRACK%'", "", $text); $text = preg_replace("'%UTOUT%'", "", $text); $text = preg_replace("'%DOMAIN%'", DOMAIN, $text); diff --git a/GameEngine/Admin/Mods/editExtraSet.php b/GameEngine/Admin/Mods/editExtraSet.php index 12fcd0be..0593e3b4 100755 --- a/GameEngine/Admin/Mods/editExtraSet.php +++ b/GameEngine/Admin/Mods/editExtraSet.php @@ -37,6 +37,7 @@ $fh = fopen($myFile, 'w') or die("


Can't open file: GameEngine\con $LOG_ILLEGAL=(LOG_ILLEGAL==false)? "false":"true"; $INCLUDE_ADMIN=(INCLUDE_ADMIN==false)? "false":"true"; $SUPPORT_MSGS_IN_ADMIN = (ADMIN_RECEIVE_SUPPORT_MESSAGES == false ? 'false' : 'true'); + $ADMINS_RAIDABLE = (ADMIN_ALLOW_INCOMING_RAIDS == false ? 'false' : 'true'); $text = file_get_contents("constant_format.tpl"); $text = preg_replace("'%ERRORREPORT%'", ERROR_REPORT, $text); @@ -96,6 +97,7 @@ $fh = fopen($myFile, 'w') or die("


Can't open file: GameEngine\con $text = preg_replace("'%AEMAIL%'", ADMIN_EMAIL, $text); $text = preg_replace("'%ANAME%'", ADMIN_NAME, $text); $text = preg_replace("'%ASUPPMSGS%'", $SUPPORT_MSGS_IN_ADMIN, $text); + $text = preg_replace("'%ARAIDS%'", $ADMINS_RAIDABLE, $text); $text = preg_replace("'%UTRACK%'", "TRACK_USR", $text); // not in use, text only in a comment $text = preg_replace("'%UTOUT%'", "USER_TIMEOUT", $text); // not in use, text only in a comment $text = preg_replace("'%DOMAIN%'", DOMAIN, $text); diff --git a/GameEngine/Admin/Mods/editLogSet.php b/GameEngine/Admin/Mods/editLogSet.php index 504c1020..713fd6c6 100755 --- a/GameEngine/Admin/Mods/editLogSet.php +++ b/GameEngine/Admin/Mods/editLogSet.php @@ -33,6 +33,7 @@ $fh = fopen($myFile, 'w') or die("


Can't open file: GameEngine\con $LIMIT_MAILBOX=(LIMIT_MAILBOX==false)? "false":"true"; $INCLUDE_ADMIN=(INCLUDE_ADMIN==false)? "false":"true"; $SUPPORT_MSGS_IN_ADMIN = (ADMIN_RECEIVE_SUPPORT_MESSAGES == false ? 'false' : 'true'); + $ADMINS_RAIDABLE = (ADMIN_ALLOW_INCOMING_RAIDS == false ? 'false' : 'true'); $text = file_get_contents("constant_format.tpl"); $text = preg_replace("'%ERRORREPORT%'", $ERRORREPORT, $text); @@ -96,6 +97,7 @@ $fh = fopen($myFile, 'w') or die("


Can't open file: GameEngine\con $text = preg_replace("'%AEMAIL%'", ADMIN_EMAIL, $text); $text = preg_replace("'%ANAME%'", ADMIN_NAME, $text); $text = preg_replace("'%ASUPPMSGS%'", $SUPPORT_MSGS_IN_ADMIN, $text); + $text = preg_replace("'%ARAIDS%'", $ADMINS_RAIDABLE, $text); $text = preg_replace("'%UTRACK%'", "", $text); $text = preg_replace("'%UTOUT%'", "", $text); $text = preg_replace("'%DOMAIN%'", DOMAIN, $text); diff --git a/GameEngine/Admin/Mods/editNewsboxSet.php b/GameEngine/Admin/Mods/editNewsboxSet.php index dfde541e..63bd6f4c 100755 --- a/GameEngine/Admin/Mods/editNewsboxSet.php +++ b/GameEngine/Admin/Mods/editNewsboxSet.php @@ -40,6 +40,7 @@ $fh = fopen($myFile, 'w') or die("


Can't open file: GameEngine\con $LIMIT_MAILBOX=(LIMIT_MAILBOX==false)? "false":"true"; $INCLUDE_ADMIN=(INCLUDE_ADMIN==false)? "false":"true"; $SUPPORT_MSGS_IN_ADMIN = (ADMIN_RECEIVE_SUPPORT_MESSAGES == false ? 'false' : 'true'); + $ADMINS_RAIDABLE = (ADMIN_ALLOW_INCOMING_RAIDS == false ? 'false' : 'true'); $text = file_get_contents("constant_format.tpl"); $text = preg_replace("'%ERRORREPORT%'", $ERRORREPORT, $text); @@ -103,6 +104,7 @@ $fh = fopen($myFile, 'w') or die("


Can't open file: GameEngine\con $text = preg_replace("'%AEMAIL%'", ADMIN_EMAIL, $text); $text = preg_replace("'%ANAME%'", ADMIN_NAME, $text); $text = preg_replace("'%ASUPPMSGS%'", $SUPPORT_MSGS_IN_ADMIN, $text); + $text = preg_replace("'%ARAIDS%'", $ADMINS_RAIDABLE, $text); $text = preg_replace("'%UTRACK%'", "", $text); $text = preg_replace("'%UTOUT%'", "", $text); $text = preg_replace("'%DOMAIN%'", DOMAIN, $text); diff --git a/GameEngine/Admin/Mods/editPlusSet.php b/GameEngine/Admin/Mods/editPlusSet.php index 6caa567f..6bb63030 100644 --- a/GameEngine/Admin/Mods/editPlusSet.php +++ b/GameEngine/Admin/Mods/editPlusSet.php @@ -21,6 +21,7 @@ $fh = fopen($myFile, 'w') or die("


Can't open file: GameEngine\con $text = file_get_contents("constant_format.tpl"); $SUPPORT_MSGS_IN_ADMIN = (ADMIN_RECEIVE_SUPPORT_MESSAGES == false ? 'false' : 'true'); + $ADMINS_RAIDABLE = (ADMIN_ALLOW_INCOMING_RAIDS == false ? 'false' : 'true'); // SERVER SETTINGS - we need to keep these intact $text = preg_replace("'%ERRORREPORT%'", ERROR_REPORT, $text); @@ -80,6 +81,7 @@ $fh = fopen($myFile, 'w') or die("


Can't open file: GameEngine\con $text = preg_replace("'%AEMAIL%'", ADMIN_EMAIL, $text); $text = preg_replace("'%ANAME%'", ADMIN_NAME, $text); $text = preg_replace("'%ASUPPMSGS%'", $SUPPORT_MSGS_IN_ADMIN, $text); + $text = preg_replace("'%ARAIDS%'", $ADMINS_RAIDABLE, $text); $text = preg_replace("'%UTRACK%'", "TRACK_USR", $text); // not in use, text only in a comment $text = preg_replace("'%UTOUT%'", "USER_TIMEOUT", $text); // not in use, text only in a comment $text = preg_replace("'%DOMAIN%'", DOMAIN, $text); diff --git a/GameEngine/Admin/Mods/editServerSet.php b/GameEngine/Admin/Mods/editServerSet.php index b8d55b28..f35fef2b 100755 --- a/GameEngine/Admin/Mods/editServerSet.php +++ b/GameEngine/Admin/Mods/editServerSet.php @@ -32,6 +32,7 @@ $fh = fopen($myFile, 'w') or die("


Can't open file: GameEngine\con $LIMIT_MAILBOX=(LIMIT_MAILBOX==false)? "false":"true"; $INCLUDE_ADMIN=(INCLUDE_ADMIN==false)? "false":"true"; $SUPPORT_MSGS_IN_ADMIN = (ADMIN_RECEIVE_SUPPORT_MESSAGES == false ? 'false' : 'true'); + $ADMINS_RAIDABLE = (ADMIN_ALLOW_INCOMING_RAIDS == false ? 'false' : 'true'); $text = file_get_contents("constant_format.tpl"); $text = preg_replace("'%ERRORREPORT%'", $_POST['error'], $text); @@ -90,6 +91,7 @@ $fh = fopen($myFile, 'w') or die("


Can't open file: GameEngine\con $text = preg_replace("'%ARANK%'", $INCLUDE_ADMIN, $text); $text = preg_replace("'%AEMAIL%'", ADMIN_EMAIL, $text); $text = preg_replace("'%ASUPPMSGS%'", $SUPPORT_MSGS_IN_ADMIN, $text); + $text = preg_replace("'%ARAIDS%'", $ADMINS_RAIDABLE, $text); $text = preg_replace("'%ANAME%'", ADMIN_NAME, $text); $text = preg_replace("'%UTRACK%'", "", $text); $text = preg_replace("'%UTOUT%'", "", $text); diff --git a/GameEngine/Market.php b/GameEngine/Market.php index c090badd..ed2bc019 100755 --- a/GameEngine/Market.php +++ b/GameEngine/Market.php @@ -77,10 +77,10 @@ class Market $this->onmarket = $database->getMarket($village->wid,0); $this->maxcarry = ($session->tribe == 1)? 500 : (($session->tribe == 2)? 1000 : 750); $this->maxcarry *= TRADER_CAPACITY; - if($building->getTypeLevel(28) != 0) + if($building->getTypeLevel(28) != 0) { $this->maxcarry *= $bid28[$building->getTypeLevel(28)]['attri'] / 100; - } + } } private function sendResource($post) diff --git a/GameEngine/Units.php b/GameEngine/Units.php index 0bd10971..222c62ea 100755 --- a/GameEngine/Units.php +++ b/GameEngine/Units.php @@ -182,7 +182,7 @@ class Units { //check if banned/admin: $villageOwner = $database->getVillageField($id,'owner'); $userAccess = $database->getUserField($villageOwner,'access',0); - if($userAccess == '0' or $userAccess == '8' or $userAccess == '9'){ + if($userAccess == '0' or $userAccess == '8' or (!ADMIN_ALLOW_INCOMING_RAIDS && $userAccess == '9')){ $form->addError("error","Player is Banned. You can't attack him"); //break; } diff --git a/README b/README index c340fed8..e26f7abd 100644 --- a/README +++ b/README @@ -53,6 +53,8 @@ martinambrus changes: 41. NPC links added to units in Hero Mansion 42. fixed random attacks attacker tribe (Natars) when building Wonder of the World 43. players who post in an Alliance forum are now notified of each subsequent post in that topic via messages +44. editing troops in Admin now saves them when Enter is used instead of clicking on "Save" as well +45. added option into Admin config to allow Administrative accounts to be raided and attacked (which also permits trading with them via Market) Shadowss changes: diff --git a/Templates/Build/17.tpl b/Templates/Build/17.tpl index 9445bb85..ce2c6b00 100644 --- a/Templates/Build/17.tpl +++ b/Templates/Build/17.tpl @@ -14,7 +14,7 @@ var carry = maxcarry; ?>; //--> 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))){ ?>
@@ -213,7 +213,7 @@ if(isset($_POST['ft'])=='check'){ $error = ''.NO_COORDINATES_SELECTED.''; }elseif($getwref == $village->wid){ $error = ''.CANNOT_SEND_RESOURCES.''; - }elseif($userAccess == '0' or $userAccess == '8' or $userAccess == '9'){ + }elseif($userAccess == '0' or $userAccess == '8' or (!ADMIN_ALLOW_INCOMING_RAIDS && $userAccess == '9')){ $error = ''.BANNED_CANNOT_SEND_RESOURCES.'.'; }elseif($_POST['r1']==0 && $_POST['r2']==0 && $_POST['r3']==0 && $_POST['r4']==0){ $error = ''.RESOURCES_NO_SELECTED.'.'; diff --git a/Templates/Map/vilview.tpl b/Templates/Map/vilview.tpl index 68ee8fe2..15f9b611 100644 --- a/Templates/Map/vilview.tpl +++ b/Templates/Map/vilview.tpl @@ -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 "» ".SENDTROOP." (".BAN.")"; } else if($data2['vac_mode']=='1') { echo "» Send troops. (Vacation mode on)"; @@ -530,7 +530,7 @@ if($type==18 or $type==19 or $type==20 or $type==21){
getVillageField($dataarray[1],'name')!="??") {
- +
 > from the village from the village
Resources diff --git a/Templates/Notice/11.tpl b/Templates/Notice/11.tpl index 33736687..95f0e1b1 100644 --- a/Templates/Notice/11.tpl +++ b/Templates/Notice/11.tpl @@ -30,7 +30,7 @@ if($database->getVillageField($dataarray[1],'name')!="??") {
- +
 > from the village from the village
Resources diff --git a/Templates/Notice/12.tpl b/Templates/Notice/12.tpl index 07ce581a..32ccece1 100644 --- a/Templates/Notice/12.tpl +++ b/Templates/Notice/12.tpl @@ -30,7 +30,7 @@ if($database->getVillageField($dataarray[1],'name')!="??") {
- +
 > from the village from the village
Resources diff --git a/Templates/Notice/13.tpl b/Templates/Notice/13.tpl index 07ce581a..32ccece1 100644 --- a/Templates/Notice/13.tpl +++ b/Templates/Notice/13.tpl @@ -30,7 +30,7 @@ if($database->getVillageField($dataarray[1],'name')!="??") {
- +
 > from the village from the village
Resources diff --git a/Templates/Notice/14.tpl b/Templates/Notice/14.tpl index 07ce581a..32ccece1 100644 --- a/Templates/Notice/14.tpl +++ b/Templates/Notice/14.tpl @@ -30,7 +30,7 @@ if($database->getVillageField($dataarray[1],'name')!="??") {
- + + + + +
 > from the village from the village
Resources diff --git a/Templates/a2b/startRaid.tpl b/Templates/a2b/startRaid.tpl index 67759c82..ed109835 100644 --- a/Templates/a2b/startRaid.tpl +++ b/Templates/a2b/startRaid.tpl @@ -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"; } diff --git a/install/data/constant_format.tpl b/install/data/constant_format.tpl index f2166b5c..026d87ce 100644 --- a/install/data/constant_format.tpl +++ b/install/data/constant_format.tpl @@ -274,6 +274,9 @@ define("ADMIN_NAME", "%ANAME%"); // ***** Show Support Messages in Admin define("ADMIN_RECEIVE_SUPPORT_MESSAGES", %ASUPPMSGS%); +// ***** Allow Admin accounts to be raided and attacked +define("ADMIN_ALLOW_INCOMING_RAIDS", %ARAIDS%); + ////////////////////////////////////////// diff --git a/install/templates/config.tpl b/install/templates/config.tpl index 669084ce..ea474f0f 100644 --- a/install/templates/config.tpl +++ b/install/templates/config.tpl @@ -269,6 +269,15 @@ echo "
Error creating constant.php
Allow Administrative Accounts to be Raided and Attacked: + +

diff --git a/todo.txt b/todo.txt index 4ea3e4a5..5aecf3b7 100644 --- a/todo.txt +++ b/todo.txt @@ -1,5 +1,4 @@ - normalize forum tables - varchar is used for numeric values and is joined with int field -- make an option for admin to be raidable (in profile?) - finish parts in Admin that are unfinished (mostly delete -X- buttons and Alliance settings) - add batching logic to mehods which get called too frequently and multiple times (example - Message::sendMessage() now that is sends messages for each forum post) - add PayPal listener to verify gold transactions imediatelly \ No newline at end of file