mirror of
https://github.com/Shadowss/TravianZ.git
synced 2026-06-29 00:54:31 +00:00
fixes by songeriux + minor changes
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ##
|
||||
## --------------------------------------------------------------------------- ##
|
||||
## Filename Account.php ##
|
||||
## Developed by: Dzoki ##
|
||||
## Developed by: Songer & Dzoki ##
|
||||
## License: TravianX Project ##
|
||||
## Copyright: TravianX (c) 2010-2011. All rights reserved. ##
|
||||
## ##
|
||||
@@ -57,7 +57,9 @@ class Account {
|
||||
}
|
||||
else if($database->checkExist_activate($_POST['name'],0)) {
|
||||
$form->addError("name",USRNM_TAKEN);
|
||||
}
|
||||
} elseif(preg_replace("/[a-zA-Z0-9_-]/","",$_POST['name'])){
|
||||
$form->addError("name","Unusable simbols. Allowed text format: a-z, A-Z, 0-9 and _ -");
|
||||
}
|
||||
|
||||
}
|
||||
if(!isset($_POST['pw']) || $_POST['pw'] == "") {
|
||||
@@ -69,7 +71,10 @@ class Account {
|
||||
}
|
||||
else if($_POST['pw'] == $_POST['name']) {
|
||||
$form->addError("pw",PW_INSECURE);
|
||||
}
|
||||
|
||||
} elseif(preg_replace("/[a-zA-Z0-9]/","",$_POST['pw'])){
|
||||
$form->addError("name","Unusable simbols. Allowed text format: a-z, A-Z, 0-9");
|
||||
}
|
||||
}
|
||||
if(!isset($_POST['email'])) {
|
||||
$form->addError("email",EMAIL_EMPTY);
|
||||
|
||||
+115
-187
@@ -243,7 +243,7 @@ class Automation {
|
||||
}
|
||||
}
|
||||
if(file_exists("GameEngine/Prevention/loyalty.txt")) {
|
||||
@unlink("GameEngine/Prevention/loyalty.txt");
|
||||
unlink("GameEngine/Prevention/loyalty.txt");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -308,8 +308,8 @@ class Automation {
|
||||
|
||||
private function clearDeleting() {
|
||||
global $database;
|
||||
$ourFileHandle = @fopen("GameEngine/Prevention/cleardeleting.txt", 'w');
|
||||
@fclose($ourFileHandle);
|
||||
$ourFileHandle = fopen("GameEngine/Prevention/cleardeleting.txt", 'w');
|
||||
fclose($ourFileHandle);
|
||||
$needDelete = $database->getNeedDelete();
|
||||
if(count($needDelete) > 0) {
|
||||
foreach($needDelete as $need) {
|
||||
@@ -351,7 +351,7 @@ class Automation {
|
||||
}
|
||||
}
|
||||
if(file_exists("GameEngine/Prevention/cleardeleting.txt")) {
|
||||
@unlink("GameEngine/Prevention/cleardeleting.txt");
|
||||
unlink("GameEngine/Prevention/cleardeleting.txt");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -423,14 +423,14 @@ class Automation {
|
||||
|
||||
private function culturePoints() {
|
||||
global $database,$session;
|
||||
$time = time()-600;
|
||||
$time = time()-600; // 10minutes
|
||||
$array = array();
|
||||
$q = "SELECT id, lastupdate FROM ".TB_PREFIX."users WHERE lastupdate < $time";
|
||||
$array = $database->query_return($q);
|
||||
|
||||
foreach($array as $indi) {
|
||||
if($indi['lastupdate'] <= $time && $indi['lastupdate'] > 0){
|
||||
$cp = $database->getVSumField($indi['id'], 'cp') * (time()-$indi['lastupdate'])/86400;
|
||||
$cp = $database->getVSumField($indi['id'], 'cp') * (time()-$indi['lastupdate'])/86400; // 24 hours
|
||||
|
||||
$newupdate = time();
|
||||
$q = "UPDATE ".TB_PREFIX."users set cp = cp + $cp, lastupdate = $newupdate where id = '".$indi['id']."'";
|
||||
@@ -438,7 +438,7 @@ class Automation {
|
||||
}
|
||||
}
|
||||
if(file_exists("GameEngine/Prevention/culturepoints.txt")) {
|
||||
@unlink("GameEngine/Prevention/culturepoints.txt");
|
||||
unlink("GameEngine/Prevention/culturepoints.txt");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -522,7 +522,7 @@ class Automation {
|
||||
}
|
||||
}
|
||||
if(file_exists("GameEngine/Prevention/build.txt")) {
|
||||
@unlink("GameEngine/Prevention/build.txt");
|
||||
unlink("GameEngine/Prevention/build.txt");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -703,8 +703,8 @@ class Automation {
|
||||
|
||||
private function marketComplete() {
|
||||
global $database;
|
||||
$ourFileHandle = @fopen("GameEngine/Prevention/market.txt", 'w');
|
||||
@fclose($ourFileHandle);
|
||||
$ourFileHandle = fopen("GameEngine/Prevention/market.txt", 'w');
|
||||
fclose($ourFileHandle);
|
||||
$time = time();
|
||||
$q = "SELECT * FROM ".TB_PREFIX."movement, ".TB_PREFIX."send where ".TB_PREFIX."movement.ref = ".TB_PREFIX."send.id and ".TB_PREFIX."movement.proc = 0 and sort_type = 0 and endtime < $time";
|
||||
$dataarray = $database->query_return($q);
|
||||
@@ -740,7 +740,7 @@ class Automation {
|
||||
}
|
||||
}
|
||||
if(file_exists("GameEngine/Prevention/market.txt")) {
|
||||
@unlink("GameEngine/Prevention/market.txt");
|
||||
unlink("GameEngine/Prevention/market.txt");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -780,8 +780,8 @@ class Automation {
|
||||
|
||||
private function sendunitsComplete() {
|
||||
global $bid23,$bid34,$database,$battle,$village,$technology,$logging;
|
||||
$ourFileHandle = @fopen("GameEngine/Prevention/sendunits.txt", 'w');
|
||||
@fclose($ourFileHandle);
|
||||
$ourFileHandle = fopen("GameEngine/Prevention/sendunits.txt", 'w');
|
||||
fclose($ourFileHandle);
|
||||
$time = time();
|
||||
$q = "SELECT * FROM ".TB_PREFIX."movement, ".TB_PREFIX."attacks where ".TB_PREFIX."movement.ref = ".TB_PREFIX."attacks.id and ".TB_PREFIX."movement.proc = '0' and ".TB_PREFIX."movement.sort_type = '3' and ".TB_PREFIX."attacks.attack_type != '2' and endtime < $time ORDER BY endtime ASC";
|
||||
$dataarray = $database->query_return($q);
|
||||
@@ -809,24 +809,6 @@ class Automation {
|
||||
$toF = $database->getVillage($data['to']);
|
||||
$fromF = $database->getVillage($data['from']);
|
||||
|
||||
|
||||
/*--------------------------------
|
||||
// Battle part
|
||||
--------------------------------*/
|
||||
|
||||
//get defence units
|
||||
/* $q = "SELECT * FROM ".TB_PREFIX."units WHERE vref='".$data['to']."'";
|
||||
$unitlist = $database->query_return($q);
|
||||
|
||||
$Defender = array();
|
||||
$start = ($targettribe == 1)? 1 : (($targettribe == 2)? 11: 21);
|
||||
$end = ($targettribe == 1)? 10 : (($targettribe == 2)? 20: 30);
|
||||
for($i=$start;$i<=$end;$i++) {
|
||||
if($unitlist)
|
||||
$Defender['u'.$i] = $unitlist[0]['u'.$i];
|
||||
else
|
||||
$Defender['u'.$i] = '';
|
||||
}*/
|
||||
//get defence units
|
||||
$Defender = array(); $rom = $ger = $gal = $nat = $natar = 0;
|
||||
$Defender = $database->getUnit($data['to']);
|
||||
@@ -961,50 +943,6 @@ class Automation {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//choose a building to attack
|
||||
/* if($catp > 0 and $type=='3'){
|
||||
if($toF['pop']>'1'){
|
||||
for ($i=1; $i<2; $i++){
|
||||
//$rand=rand(1,39);
|
||||
$basearray = $database->getMInfo($data['to']);
|
||||
$resarray = $database->getResourceLevel($basearray['wref']);
|
||||
if($data['ctar1'] == 0){
|
||||
$rand = 0;
|
||||
for($j=19;$j<=40;$j++) {
|
||||
if($resarray['f'.$j.'t'] != 0 ) {
|
||||
$rand = $j;
|
||||
}
|
||||
}
|
||||
}else{
|
||||
//$resarray = $database->getResourceLevel($data['to']);
|
||||
$rand = 0;
|
||||
for($j=19;$j<=40;$j++) {
|
||||
if($resarray['f'.$j.'t'] == $data['ctar1']) {
|
||||
|
||||
$rand = $j;
|
||||
}
|
||||
}
|
||||
}
|
||||
if ($rand == 0){
|
||||
for($j=19;$j<=40;$j++) {
|
||||
if($resarray['f'.$j.'t'] != 0 ) {
|
||||
$rand = $j;
|
||||
}
|
||||
}
|
||||
}
|
||||
//$rand=$data['ctar1'];
|
||||
if ($database->getFieldLevel($basearray['wref'],$rand)!='0'){
|
||||
$tblevel = $database->getFieldLevel($basearray['wref'],$rand);
|
||||
$tbgid = $database->getFieldLevel($basearray['wref'],"".$rand."t");
|
||||
$tbid = $rand;
|
||||
$i="4";
|
||||
} else { $i--; }
|
||||
}
|
||||
} else { $empty='1'; }
|
||||
} else { $tblevel = '0'; }
|
||||
$stonemason = "1"; */
|
||||
|
||||
$tblevel = '1';
|
||||
$stonemason = "1";
|
||||
|
||||
@@ -1031,6 +969,7 @@ class Automation {
|
||||
$Defender = array(); $rom = $ger = $gal = $nat = $natar = 0;
|
||||
$Defender = $database->getUnit($data['to']);
|
||||
$enforcementarray = $database->getEnforceVillage($data['to'],0);
|
||||
|
||||
if(count($enforcementarray) > 0) {
|
||||
foreach($enforcementarray as $enforce) {
|
||||
for($i=1;$i<=50;$i++) {
|
||||
@@ -1175,11 +1114,19 @@ class Automation {
|
||||
$unitssend_deff[4] = '?,?,?,?,?,?,?,?,?,?,';
|
||||
$unitssend_deff[5] = '?,?,?,?,?,?,?,?,?,?,';
|
||||
//how many troops died? for battleraport
|
||||
|
||||
#################################################
|
||||
################FIXED BY SONGER################
|
||||
#################################################
|
||||
|
||||
for($i=1;$i<=11;$i++){
|
||||
if($battlepart['casualties_attacker'][$i] <= 0) { ${dead.$i} = 0; }elseif($battlepart['casualties_attacker'][$i] > $data['t'.$i]){
|
||||
${dead.$i}=$data['t'.$i];
|
||||
}else { ${dead.$i} = $battlepart['casualties_attacker'][$i]; }
|
||||
}
|
||||
|
||||
#################################################
|
||||
|
||||
$heroAttackDead=$dead11;
|
||||
//kill own defence
|
||||
$q = "SELECT * FROM ".TB_PREFIX."units WHERE vref='".$data['to']."'";
|
||||
@@ -1280,18 +1227,7 @@ class Automation {
|
||||
|
||||
$totaldead_alldef = $totaldead_alldef[1]+$totaldead_alldef[2]+$totaldead_alldef[3]+$totaldead_alldef[4]+$totaldead_alldef[5]+$deadhero;
|
||||
$totalattackdead += $totaldead_alldef;
|
||||
/*
|
||||
if($battlepart['casualties_defender'][1] == 0) { $dead11 = 0; } else { $dead11 = $battlepart['casualties_defender'][1]; }
|
||||
if($battlepart['casualties_defender'][2] == 0) { $dead12 = 0; } else { $dead12 = $battlepart['casualties_defender'][2]; }
|
||||
if($battlepart['casualties_defender'][3] == 0) { $dead13 = 0; } else { $dead13 = $battlepart['casualties_defender'][3]; }
|
||||
if($battlepart['casualties_defender'][4] == 0) { $dead14 = 0; } else { $dead14 = $battlepart['casualties_defender'][4]; }
|
||||
if($battlepart['casualties_defender'][5] == 0) { $dead15 = 0; } else { $dead15 = $battlepart['casualties_defender'][5]; }
|
||||
if($battlepart['casualties_defender'][6] == 0) { $dead16 = 0; } else { $dead16 = $battlepart['casualties_defender'][6]; }
|
||||
if($battlepart['casualties_defender'][7] == 0) { $dead17 = 0; } else { $dead17 = $battlepart['casualties_defender'][7]; }
|
||||
if($battlepart['casualties_defender'][8] == 0) { $dead18 = 0; } else { $dead18 = $battlepart['casualties_defender'][8]; }
|
||||
if($battlepart['casualties_defender'][9] == 0) { $dead19 = 0; } else { $dead19 = $battlepart['casualties_defender'][9]; }
|
||||
if($battlepart['casualties_defender'][10] == 0) { $dead20 = 0; } else { $dead20 = $battlepart['casualties_defender'][10]; }
|
||||
*/
|
||||
|
||||
|
||||
// Set units returning from attack
|
||||
$database->modifyAttack($data['ref'],1,$dead1);
|
||||
@@ -2369,57 +2305,71 @@ $crannyimg = "<img src=\"".GP_LOCATE."img/g/g23.gif\" height=\"20\" width=\"15\"
|
||||
$database->addNotice($from['owner'],$to['wref'],$ownally,22,''.addslashes($from['name']).' attacks '.addslashes($to['name']).'',$data2,time());
|
||||
$database->addNotice($to['owner'],$to['wref'],$targetally,22,''.addslashes($from['name']).' attacks '.addslashes($to['name']).'',$data2,time());
|
||||
}
|
||||
unset($Attacker);
|
||||
unset($Defender);
|
||||
unset($enforce);
|
||||
unset($unitssend_att);
|
||||
unset($unitssend_def);
|
||||
unset($battlepart);
|
||||
unset($unitsdead_def);
|
||||
unset($dead);
|
||||
unset($steal);
|
||||
unset($from);
|
||||
unset($data);
|
||||
unset($data2);
|
||||
unset($to);
|
||||
unset($artifact);
|
||||
unset($artifactBig);
|
||||
unset($canclaim);
|
||||
unset($data_fail);
|
||||
unset($owntribe);
|
||||
unset($unitsdead_att);
|
||||
unset($herosend_def);
|
||||
unset($deadhero);
|
||||
unset($heroxp);
|
||||
unset($AttackerID);
|
||||
unset($DefenderID);
|
||||
unset($totalsend_alldef);
|
||||
unset($totaldead_att);
|
||||
unset($totaldead_def);
|
||||
unset($unitsdead_att_check);
|
||||
unset($totalattackdead);
|
||||
unset($Defender1);
|
||||
unset($enforce1);
|
||||
unset($defheroowner);
|
||||
unset($enforceowner);
|
||||
unset($defheroxp);
|
||||
unset($reinfheroxp);
|
||||
unset($AttackerWref);
|
||||
unset($DefenderWref);
|
||||
unset($troopsdead1);
|
||||
unset($troopsdead2);
|
||||
unset($troopsdead3);
|
||||
unset($troopsdead4);
|
||||
unset($troopsdead5);
|
||||
unset($troopsdead6);
|
||||
unset($troopsdead7);
|
||||
unset($troopsdead8);
|
||||
unset($troopsdead9);
|
||||
unset($troopsdead10);
|
||||
unset($troopsdead11);
|
||||
|
||||
#################################################
|
||||
################FIXED BY SONGER################
|
||||
#################################################
|
||||
|
||||
################################################################################
|
||||
##############ISUE: Lag, fixed3####################################################
|
||||
#### PHP.NET manual: unset() destroy more than one variable unset($foo1, $foo2, $foo3);######
|
||||
################################################################################
|
||||
|
||||
unset(
|
||||
$Attacker
|
||||
,$Defender
|
||||
,$enforce
|
||||
,$unitssend_att
|
||||
,$unitssend_def
|
||||
,$battlepart
|
||||
,$unitsdead_def
|
||||
,$dead
|
||||
,$steal
|
||||
,$from
|
||||
,$data
|
||||
,$data2
|
||||
,$to
|
||||
,$artifact
|
||||
,$artifactBig
|
||||
,$canclaim
|
||||
,$data_fail
|
||||
,$owntribe
|
||||
,$unitsdead_att
|
||||
,$herosend_def
|
||||
,$deadhero
|
||||
,$heroxp
|
||||
,$AttackerID
|
||||
,$DefenderID
|
||||
,$totalsend_alldef
|
||||
,$totaldead_att
|
||||
,$totaldead_def
|
||||
,$unitsdead_att_check
|
||||
,$totalattackdead
|
||||
,$Defender1
|
||||
,$enforce1
|
||||
,$defheroowner
|
||||
,$enforceowner
|
||||
,$defheroxp
|
||||
,$reinfheroxp
|
||||
,$AttackerWref
|
||||
,$DefenderWref
|
||||
,$troopsdead1
|
||||
,$troopsdead2
|
||||
,$troopsdead3
|
||||
,$troopsdead4
|
||||
,$troopsdead5
|
||||
,$troopsdead6
|
||||
,$troopsdead7
|
||||
,$troopsdead8
|
||||
,$troopsdead9
|
||||
,$troopsdead10
|
||||
,$troopsdead11);
|
||||
|
||||
#################################################
|
||||
|
||||
}
|
||||
if(file_exists("GameEngine/Prevention/sendunits.txt")) {
|
||||
@unlink("GameEngine/Prevention/sendunits.txt");
|
||||
unlink("GameEngine/Prevention/sendunits.txt");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2542,8 +2492,8 @@ $crannyimg = "<img src=\"".GP_LOCATE."img/g/g23.gif\" height=\"20\" width=\"15\"
|
||||
private function sendreinfunitsComplete() {
|
||||
global $bid23,$database,$battle;
|
||||
$time = time();
|
||||
$ourFileHandle = @fopen("GameEngine/Prevention/sendreinfunits.txt", 'w');
|
||||
@fclose($ourFileHandle);
|
||||
$ourFileHandle = fopen("GameEngine/Prevention/sendreinfunits.txt", 'w');
|
||||
fclose($ourFileHandle);
|
||||
$q = "SELECT * FROM ".TB_PREFIX."movement, ".TB_PREFIX."attacks where ".TB_PREFIX."movement.ref = ".TB_PREFIX."attacks.id and ".TB_PREFIX."movement.proc = '0' and ".TB_PREFIX."movement.sort_type = '3' and ".TB_PREFIX."attacks.attack_type = '2' and endtime < $time";
|
||||
$dataarray = $database->query_return($q);
|
||||
foreach($dataarray as $data) {
|
||||
@@ -2606,14 +2556,14 @@ $crannyimg = "<img src=\"".GP_LOCATE."img/g/g23.gif\" height=\"20\" width=\"15\"
|
||||
}
|
||||
}
|
||||
if(file_exists("GameEngine/Prevention/sendreinfunits.txt")) {
|
||||
@unlink("GameEngine/Prevention/sendreinfunits.txt");
|
||||
unlink("GameEngine/Prevention/sendreinfunits.txt");
|
||||
}
|
||||
}
|
||||
|
||||
private function returnunitsComplete() {
|
||||
global $database;
|
||||
$ourFileHandle = @fopen("GameEngine/Prevention/returnunits.txt", 'w');
|
||||
@fclose($ourFileHandle);
|
||||
$ourFileHandle = fopen("GameEngine/Prevention/returnunits.txt", 'w');
|
||||
fclose($ourFileHandle);
|
||||
$time = time();
|
||||
$q = "SELECT * FROM ".TB_PREFIX."movement, ".TB_PREFIX."attacks where ".TB_PREFIX."movement.ref = ".TB_PREFIX."attacks.id and ".TB_PREFIX."movement.proc = '0' and ".TB_PREFIX."movement.sort_type = '4' and endtime < $time";
|
||||
$dataarray = $database->query_return($q);
|
||||
@@ -2653,14 +2603,14 @@ $crannyimg = "<img src=\"".GP_LOCATE."img/g/g23.gif\" height=\"20\" width=\"15\"
|
||||
|
||||
|
||||
if(file_exists("GameEngine/Prevention/returnunits.txt")) {
|
||||
@unlink("GameEngine/Prevention/returnunits.txt");
|
||||
unlink("GameEngine/Prevention/returnunits.txt");
|
||||
}
|
||||
}
|
||||
|
||||
private function sendSettlersComplete() {
|
||||
global $database, $building;
|
||||
$ourFileHandle = @fopen("GameEngine/Prevention/settlers.txt", 'w');
|
||||
@fclose($ourFileHandle);
|
||||
$ourFileHandle = fopen("GameEngine/Prevention/settlers.txt", 'w');
|
||||
fclose($ourFileHandle);
|
||||
$time = time();
|
||||
$q = "SELECT * FROM ".TB_PREFIX."movement where proc = 0 and sort_type = 5 and endtime < $time";
|
||||
$dataarray = $database->query_return($q);
|
||||
@@ -2701,14 +2651,14 @@ $crannyimg = "<img src=\"".GP_LOCATE."img/g/g23.gif\" height=\"20\" width=\"15\"
|
||||
}
|
||||
}
|
||||
if(file_exists("GameEngine/Prevention/settlers.txt")) {
|
||||
@unlink("GameEngine/Prevention/settlers.txt");
|
||||
unlink("GameEngine/Prevention/settlers.txt");
|
||||
}
|
||||
}
|
||||
|
||||
private function researchComplete() {
|
||||
global $database;
|
||||
$ourFileHandle = @fopen("GameEngine/Prevention/research.txt", 'w');
|
||||
@fclose($ourFileHandle);
|
||||
$ourFileHandle = fopen("GameEngine/Prevention/research.txt", 'w');
|
||||
fclose($ourFileHandle);
|
||||
$time = time();
|
||||
$q = "SELECT * FROM ".TB_PREFIX."research where timestamp < $time";
|
||||
$dataarray = $database->query_return($q);
|
||||
@@ -2728,7 +2678,7 @@ $crannyimg = "<img src=\"".GP_LOCATE."img/g/g23.gif\" height=\"20\" width=\"15\"
|
||||
$database->query($q);
|
||||
}
|
||||
if(file_exists("GameEngine/Prevention/research.txt")) {
|
||||
@unlink("GameEngine/Prevention/research.txt");
|
||||
unlink("GameEngine/Prevention/research.txt");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2762,20 +2712,6 @@ $crannyimg = "<img src=\"".GP_LOCATE."img/g/g23.gif\" height=\"20\" width=\"15\"
|
||||
$this->bountyocounter = $this->bountysortOasis();
|
||||
$this->bountypop = $this->bountyinfoarray['pop'];
|
||||
|
||||
//$unitarray = $database->getUnit($bountywid);
|
||||
//if(count($unitarray) > 0) {
|
||||
// for($i=1;$i<=50;$i++) {
|
||||
// $this->bountyunitall['u'.$i] = $unitarray['u'.$i];
|
||||
// }
|
||||
//}
|
||||
//$enforcearray = $database->getEnforceVillage($bountywid,0);
|
||||
//if(count($enforcearray) > 0) {
|
||||
// foreach($enforcearray as $enforce) {
|
||||
// for($i=1;$i<=50;$i++) {
|
||||
// $this->bountyunitall['u'.$i] += $enforce['u'.$i];
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
}
|
||||
|
||||
private function bountysortOasis() {
|
||||
@@ -2944,7 +2880,6 @@ $crannyimg = "<img src=\"".GP_LOCATE."img/g/g23.gif\" height=\"20\" width=\"15\"
|
||||
if($this->bountyocounter[0] != 0) {
|
||||
$wood += $wood*0.25*$this->bountyocounter[0];
|
||||
}
|
||||
// $wood += $wood*$this->bountyocounter[0]*0.25;
|
||||
$wood *= SPEED;
|
||||
return round($wood);
|
||||
}
|
||||
@@ -2995,7 +2930,6 @@ $crannyimg = "<img src=\"".GP_LOCATE."img/g/g23.gif\" height=\"20\" width=\"15\"
|
||||
if($this->bountyocounter[1] != 0) {
|
||||
$clay += $clay*0.25*$this->bountyocounter[1];
|
||||
}
|
||||
// $clay += $clay*$this->bountyocounter[1]*0.25;
|
||||
$clay *= SPEED;
|
||||
return round($clay);
|
||||
}
|
||||
@@ -3019,7 +2953,6 @@ $crannyimg = "<img src=\"".GP_LOCATE."img/g/g23.gif\" height=\"20\" width=\"15\"
|
||||
if($this->bountyocounter[2] != 0) {
|
||||
$iron += $iron*0.25*$this->bountyocounter[2];
|
||||
}
|
||||
// $iron += $iron*$this->bountyocounter[2]*0.25;
|
||||
$iron *= SPEED;
|
||||
return round($iron);
|
||||
}
|
||||
@@ -3049,16 +2982,14 @@ $crannyimg = "<img src=\"".GP_LOCATE."img/g/g23.gif\" height=\"20\" width=\"15\"
|
||||
if($this->bountyocounter[3] != 0) {
|
||||
$crop += $crop*0.25*$this->bountyocounter[3];
|
||||
}
|
||||
|
||||
// $crop += $crop*$this->bountyocounter[3]*0.25;
|
||||
$crop *= SPEED;
|
||||
return round($crop);
|
||||
}
|
||||
|
||||
private function trainingComplete() {
|
||||
global $database;
|
||||
$ourFileHandle = @fopen("GameEngine/Prevention/training.txt", 'w');
|
||||
@fclose($ourFileHandle);
|
||||
$ourFileHandle = fopen("GameEngine/Prevention/training.txt", 'w');
|
||||
fclose($ourFileHandle);
|
||||
$trainlist = $database->getTrainingList();
|
||||
if(count($trainlist) > 0) {
|
||||
foreach($trainlist as $train) {
|
||||
@@ -3088,7 +3019,7 @@ $crannyimg = "<img src=\"".GP_LOCATE."img/g/g23.gif\" height=\"20\" width=\"15\"
|
||||
}
|
||||
}
|
||||
if(file_exists("GameEngine/Prevention/training.txt")) {
|
||||
@unlink("GameEngine/Prevention/training.txt");
|
||||
unlink("GameEngine/Prevention/training.txt");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3161,11 +3092,12 @@ $crannyimg = "<img src=\"".GP_LOCATE."img/g/g23.gif\" height=\"20\" width=\"15\"
|
||||
}
|
||||
}
|
||||
else {
|
||||
for($i=0;$i<=$element-1;$i++) {
|
||||
/*for($i=0;$i<=$element-1;$i++) {
|
||||
//if($resarray['f'.$keyholder[$i]] != $this->getsort_typeMaxLevel($tid)) {
|
||||
// $target = $i;
|
||||
//}
|
||||
}
|
||||
*/
|
||||
}
|
||||
}
|
||||
else if($element == 1) {
|
||||
@@ -3184,8 +3116,8 @@ $crannyimg = "<img src=\"".GP_LOCATE."img/g/g23.gif\" height=\"20\" width=\"15\"
|
||||
|
||||
private function celebrationComplete() {
|
||||
global $database;
|
||||
$ourFileHandle = @fopen("GameEngine/Prevention/celebration.txt", 'w');
|
||||
@fclose($ourFileHandle);
|
||||
$ourFileHandle = fopen("GameEngine/Prevention/celebration.txt", 'w');
|
||||
fclose($ourFileHandle);
|
||||
|
||||
$varray = $database->getCel();
|
||||
foreach($varray as $vil){
|
||||
@@ -3197,14 +3129,14 @@ $crannyimg = "<img src=\"".GP_LOCATE."img/g/g23.gif\" height=\"20\" width=\"15\"
|
||||
$database->setCelCp($user,$cp);
|
||||
}
|
||||
if(file_exists("GameEngine/Prevention/celebration.txt")) {
|
||||
@unlink("GameEngine/Prevention/celebration.txt");
|
||||
unlink("GameEngine/Prevention/celebration.txt");
|
||||
}
|
||||
}
|
||||
|
||||
private function demolitionComplete() {
|
||||
global $building,$database;
|
||||
$ourFileHandle = @fopen("GameEngine/Prevention/demolition.txt", 'w');
|
||||
@fclose($ourFileHandle);
|
||||
$ourFileHandle = fopen("GameEngine/Prevention/demolition.txt", 'w');
|
||||
fclose($ourFileHandle);
|
||||
|
||||
$varray = $database->getDemolition();
|
||||
foreach($varray as $vil) {
|
||||
@@ -3233,7 +3165,7 @@ $crannyimg = "<img src=\"".GP_LOCATE."img/g/g23.gif\" height=\"20\" width=\"15\"
|
||||
}
|
||||
}
|
||||
if(file_exists("GameEngine/Prevention/demolition.txt")) {
|
||||
@unlink("GameEngine/Prevention/demolition.txt");
|
||||
unlink("GameEngine/Prevention/demolition.txt");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3260,13 +3192,13 @@ $crannyimg = "<img src=\"".GP_LOCATE."img/g/g23.gif\" height=\"20\" width=\"15\"
|
||||
}
|
||||
}
|
||||
if(file_exists("GameEngine/Prevention/updatehero.txt")) {
|
||||
@unlink("GameEngine/Prevention/updatehero.txt");
|
||||
unlink("GameEngine/Prevention/updatehero.txt");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
// by SlimShady95, aka Manuel Mannhardt < manuel_mannhardt@web.de >
|
||||
// by SlimShady95, aka Manuel Mannhardt < manuel_mannhardt@web.de > UPDATED FROM songeriux < haroldas.snei@gmail.com >
|
||||
private function updateStore() {
|
||||
global $bid10, $bid38, $bid11, $bid39;
|
||||
|
||||
@@ -3413,8 +3345,8 @@ $crannyimg = "<img src=\"".GP_LOCATE."img/g/g23.gif\" height=\"20\" width=\"15\"
|
||||
|
||||
private function starvation() {
|
||||
global $database;
|
||||
$ourFileHandle = @fopen("GameEngine/Prevention/starvation.txt", 'w');
|
||||
@fclose($ourFileHandle);
|
||||
$ourFileHandle = fopen("GameEngine/Prevention/starvation.txt", 'w');
|
||||
fclose($ourFileHandle);
|
||||
$starvcost = array(
|
||||
|
||||
'1'=>30,
|
||||
@@ -3609,15 +3541,11 @@ $crannyimg = "<img src=\"".GP_LOCATE."img/g/g23.gif\" height=\"20\" width=\"15\"
|
||||
$database->setVillageField($starv['wref'], 'crop', $newcrop);
|
||||
}
|
||||
}
|
||||
unset ($starv);
|
||||
unset ($unitarray);
|
||||
unset ($enforcearray);
|
||||
unset ($enforce);
|
||||
unset ($starvarray);
|
||||
unset ($starv,$unitarray,$enforcearray,$enforce,$starvarray);
|
||||
}
|
||||
|
||||
if(file_exists("GameEngine/Prevention/starvation.txt")) {
|
||||
@unlink("GameEngine/Prevention/starvation.txt");
|
||||
unlink("GameEngine/Prevention/starvation.txt");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+5
-33
@@ -533,20 +533,14 @@ class Battle {
|
||||
$total_att_units = count($units['Att_unit']);
|
||||
$start = intval(($att_tribe-1)*10+1);
|
||||
$end = intval(($att_tribe*10));
|
||||
//exit($start."|".$end."|".$att_tribe);
|
||||
//$y=1;
|
||||
|
||||
for($i=$start;$i <= $end;$i++)
|
||||
{
|
||||
$y = $i-(($att_tribe-1)*10);
|
||||
//exit(intval("$y"));
|
||||
$result['casualties_attacker'][$y] = round($result[1]*$units['Att_unit'][$i]);
|
||||
//$y++;
|
||||
//exit($result['casualties_attacker'][$y]);
|
||||
|
||||
}
|
||||
//$result['casualties_attacker']['11'] = 0;
|
||||
//exit($result['casualties_attacker']['2']);
|
||||
//$_hero=11;
|
||||
|
||||
if ($units['Att_unit']['hero']>0)
|
||||
{
|
||||
|
||||
@@ -568,18 +562,9 @@ class Battle {
|
||||
mysql_query("update " . TB_PREFIX . "hero set `health`=`health`-".$damage_health." where `heroid`='".$hero_id."'");
|
||||
}
|
||||
}
|
||||
unset($_result);
|
||||
unset($fdb);
|
||||
unset($hero_id);
|
||||
unset($hero_health);
|
||||
unset($damage_health);
|
||||
unset($_result,$fdb,$hero_id,$hero_health,$damage_health);
|
||||
|
||||
//exit($result['casualties_attacker']['11']);
|
||||
//$result['casualties_attacker'][11] = round($result[1]*$units['Att_unit']['hero']);
|
||||
|
||||
//$result['casualties_defender']['11'] = 0;
|
||||
//exit($result['casualties_defender']['2']);
|
||||
//$_hero=11;
|
||||
if ($units['Def_unit']['hero']>0)
|
||||
{
|
||||
|
||||
@@ -588,7 +573,6 @@ class Battle {
|
||||
$hero_id=$fdb['heroid'];
|
||||
$hero_health=$fdb['health'];
|
||||
$damage_health=round(100*$result[2]);
|
||||
//exit($damage_health."|".$hero_health."|".$defhero['heroid']);
|
||||
if ($hero_health<=$damage_health or $damage_health>90)
|
||||
{
|
||||
//hero die
|
||||
@@ -601,11 +585,7 @@ class Battle {
|
||||
$result['deadherodef'] = 0;
|
||||
mysql_query("update " . TB_PREFIX . "hero set `health`=`health`-".$damage_health." where `heroid`='".$hero_id."'");
|
||||
}
|
||||
unset($_result);
|
||||
unset($fdb);
|
||||
unset($hero_id);
|
||||
unset($hero_health);
|
||||
unset($damage_health);
|
||||
unset($_result,$fdb,$hero_id,$hero_health,$damage_health);
|
||||
|
||||
$DefendersAll = $database->getEnforceVillage($DefenderWref,0);
|
||||
if(!empty($DefendersAll)){
|
||||
@@ -619,7 +599,6 @@ class Battle {
|
||||
$hero_id=$fdb['heroid'];
|
||||
$hero_health=$fdb['health'];
|
||||
$damage_health=round(100*$result[2]);
|
||||
//exit($damage_health."|".$hero_health."|".$defhero['heroid']);
|
||||
if ($hero_health<=$damage_health or $damage_health>90)
|
||||
{
|
||||
//hero die
|
||||
@@ -637,14 +616,7 @@ class Battle {
|
||||
}
|
||||
|
||||
}
|
||||
unset($_result);
|
||||
unset($fdb);
|
||||
unset($hero_id);
|
||||
unset($hero_health);
|
||||
unset($damage_health);
|
||||
|
||||
//exit($result['casualties_defender']['11']);
|
||||
//$result['casualties_defender'][11] = round($result[1]*$units['Def_unit']['hero']);
|
||||
unset($_result,$fdb,$hero_id,$hero_health,$damage_health);
|
||||
|
||||
|
||||
// Work out bounty
|
||||
|
||||
@@ -268,9 +268,9 @@ define("CHOOSE","Please choose a server.");
|
||||
define("STARTED"," The server started ". round((time()-COMMENCE)/86400) ." days ago.");
|
||||
|
||||
//ANMELDEN.php
|
||||
define("NICKNAME","Nickname");
|
||||
define("NICKNAME","Nickname [a-z, A-Z, 0-9 , _, -]");
|
||||
define("EMAIL","Email");
|
||||
define("PASSWORD","Password");
|
||||
define("PASSWORD","Password [a-z, A-Z, 0-9]");
|
||||
define("ROMANS","Romans");
|
||||
define("TEUTONS","Teutons");
|
||||
define("GAULS","Gauls");
|
||||
@@ -356,4 +356,4 @@ define("MASS_SENT","Mass IGM was sent");
|
||||
$lang['login'] = "Login";
|
||||
|
||||
|
||||
?>
|
||||
?>
|
||||
@@ -9,11 +9,11 @@
|
||||
| Copyright: TravianX Project All rights reserved |
|
||||
\** --------------------------------------------------- **/
|
||||
|
||||
$tribe1 = mysql_query("SELECT SQL_CACHE * FROM ".TB_PREFIX."users WHERE tribe = 1");
|
||||
$tribe2 = mysql_query("SELECT SQL_CACHE * FROM ".TB_PREFIX."users WHERE tribe = 2");
|
||||
$tribe3 = mysql_query("SELECT SQL_CACHE * FROM ".TB_PREFIX."users WHERE tribe = 3");
|
||||
$tribe1 = mysql_query("SELECT * FROM ".TB_PREFIX."users WHERE tribe = 1");
|
||||
$tribe2 = mysql_query("SELECT * FROM ".TB_PREFIX."users WHERE tribe = 2");
|
||||
$tribe3 = mysql_query("SELECT * FROM ".TB_PREFIX."users WHERE tribe = 3");
|
||||
$tribes = array(mysql_num_rows($tribe1), mysql_num_rows($tribe2), mysql_num_rows($tribe3));
|
||||
$users = mysql_num_rows(mysql_query("SELECT SQL_CACHE * FROM ".TB_PREFIX."users")) - 4; ?>
|
||||
$users = mysql_num_rows(mysql_query("SELECT * FROM " . TB_PREFIX . "users WHERE tribe!=0 AND tribe!=4 AND tribe!=5")); ?>
|
||||
|
||||
<table cellpadding="1" cellspacing="1" id="world_player" class="world">
|
||||
<thead>
|
||||
@@ -34,7 +34,7 @@
|
||||
<th>Active players</th>
|
||||
|
||||
<td><?php
|
||||
$active = mysql_num_rows(mysql_query("SELECT * FROM ".TB_PREFIX."users WHERE ".time()."-timestamp < (3600*24)"));
|
||||
$active = mysql_num_rows(mysql_query("SELECT * FROM ".TB_PREFIX."users WHERE ".time()."-timestamp < (3600*24) AND tribe!=0 AND tribe!=4 AND tribe!=5"));
|
||||
echo $active; ?></td>
|
||||
</tr>
|
||||
|
||||
@@ -42,7 +42,7 @@
|
||||
<th>Players online</th>
|
||||
|
||||
<td><?php
|
||||
$online = mysql_num_rows(mysql_query("SELECT * FROM ".TB_PREFIX."users WHERE ".time()."-timestamp < (60*5)"));
|
||||
$online = mysql_num_rows(mysql_query("SELECT * FROM ".TB_PREFIX."users WHERE ".time()."-timestamp < (60*30) AND tribe!=0 AND tribe!=4 AND tribe!=5"));
|
||||
echo $online; ?></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
|
||||
@@ -132,7 +132,7 @@ include ("GameEngine/Lang/".LANG.".php");
|
||||
|
||||
<td><?php
|
||||
|
||||
$online = mysql_num_rows(mysql_query("SELECT * FROM " . TB_PREFIX . "users WHERE " . time() . "-timestamp < (60*5) AND tribe!=0 AND tribe!=4 AND tribe!=5"));
|
||||
$online = mysql_num_rows(mysql_query("SELECT * FROM " . TB_PREFIX . "users WHERE " . time() . "-timestamp < (60*30) AND tribe!=0 AND tribe!=4 AND tribe!=5"));
|
||||
echo $online;
|
||||
|
||||
?></td>
|
||||
|
||||
@@ -127,7 +127,7 @@ echo "<div class=\"headline\"><span class=\"f10 c5\">Error creating constant.php
|
||||
<td><span class="f9 c6">Prefix:</span></td><td><input type="text" name="prefix" id="prefix" value="s1_" size="5"></td></tr>
|
||||
<td><span class="f9 c6">Type:</span></td><td><select name="connectt">
|
||||
<option value="0" selected="selected">MYSQL</option>
|
||||
<option value="1" disabled="disabled">MYSQLi</option>
|
||||
<option value="1" disabled="disabled">MYSQLi (NOT DONE)</option>
|
||||
</select></td></tr>
|
||||
</table>
|
||||
</p>
|
||||
@@ -180,6 +180,9 @@ echo "<div class=\"headline\"><span class=\"f10 c5\">Error creating constant.php
|
||||
<p>
|
||||
<span class="f10 c">LOG RELATED</span>
|
||||
<table><tr>
|
||||
<td><span style="red"><b>WARNING:</b></span> May increase some preformence (Higher CPU/RAM usage, More lag)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><span class="f9 c6">Log Building:</span></td><td><select name="log_build">
|
||||
<option value="true" selected="selected">Yes</option>
|
||||
<option value="false">No</option>
|
||||
@@ -232,14 +235,14 @@ echo "<div class=\"headline\"><span class=\"f10 c5\">Error creating constant.php
|
||||
<option value="false" selected="selected">No</option>
|
||||
</select></td></tr><tr>
|
||||
<td><span class="f9 c6">Limit Mailbox:</span></td><td><select name="limit_mailbox">
|
||||
<option value="true" selected="selected">Yes</option>
|
||||
<option value="false">No</option>
|
||||
</select></td></tr>
|
||||
<tr><td><span class="f9 c6">Max mails:</span></td><td><input type="text" name="max_mails" id="max_mails" value="30" size="4"></td></tr>
|
||||
<option value="true">Yes</option>
|
||||
<option value="false" selected="selected">No</option>
|
||||
</select> (NOT DONE)</td></tr>
|
||||
<tr><td><span class="f9 c6">Max mails:</span></td><td><input type="text" name="max_mails" id="max_mails" value="30" size="4"> (NOT DONE)</td></tr>
|
||||
<tr>
|
||||
<td><span class="f9 c6">Demolish - lvl required:</span></td><td><select name="demolish">
|
||||
<option value="5">5</option>
|
||||
<option value="10" selected="selected">10</option>
|
||||
<option value="10" selected="selected">10 - Default</option>
|
||||
<option value="15">15</option>
|
||||
<option value="20">20</option>
|
||||
</select></td></tr>
|
||||
|
||||
@@ -19,6 +19,16 @@
|
||||
<li>Last but not least, Enjoy.</li>
|
||||
</ul>
|
||||
|
||||
<ul>
|
||||
|
||||
<li><h4>CHMOD:</h4></li>
|
||||
<li>install to 777</li>
|
||||
<li>GameEngine to 777</li>
|
||||
<li><h4>After CHMOD:</h4></li>
|
||||
<li>Delete install folder</li>
|
||||
<li>Change CHMOD GameEngine back to 644 and CHMOD 777: Prevention, Notes</li>
|
||||
</ul>
|
||||
|
||||
<div class="lbox">
|
||||
TravianX Team
|
||||
</div>
|
||||
|
||||
@@ -150,7 +150,7 @@ if(T4_COMING==true){
|
||||
<a href="../index.php#spielregeln" target="_blank"><?php echo SPIELREGELN; ?></a> |
|
||||
<a href="../index.php#impressum" target="_blank"><?php echo SPIELREGELN; ?></a>
|
||||
<br />
|
||||
© 2011 ZravianX | By <a href="http://zzjhons.com">ZZJHONS</a>
|
||||
© 2012 Travian
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -5,14 +5,14 @@
|
||||
## ##
|
||||
## --------------------------------------------------------------------------- ##
|
||||
## ##
|
||||
## Project: ZravianX ##
|
||||
## Project: ZravianX & TravianZ ##
|
||||
## Version: 2011.11.02 ##
|
||||
## Filename: notification/lang/en.php ##
|
||||
## Developed by: ZZJHONS ##
|
||||
## Developed by: ZZJHONS & Songeriux ##
|
||||
## License: Creative Commons BY-NC-SA 3.0 ##
|
||||
## Copyright: ZravianX (c) 2011 - All rights reserved ##
|
||||
## URLs: http://zravianx.zzjhons.com ##
|
||||
## Source code: http://www.github.com/ZZJHONS/ZravianX ##
|
||||
## Source code: http://www.github.com/songeriux/TravianZ ##
|
||||
## ##
|
||||
#################################################################################
|
||||
|
||||
@@ -23,7 +23,7 @@ $lang['notification']['notify_me'] = "Please notify me when TRAVIAN 4 begins";
|
||||
$lang['notification']['email'] = "Email address";
|
||||
$lang['notification']['send'] = "Send";
|
||||
$lang['notification']['error'] = "Sorry, but this don't work now.";
|
||||
$lang['notification']['i_agree'] = "I agree that ZravianX can inform me about interesting news and game related information.";
|
||||
$lang['notification']['i_agree'] = "I agree that TRAVIAN can inform me about interesting news and game related information.";
|
||||
$lang['notification']['facebook_page'] = "http%3A%2F%2Fwww.facebook.com%2Ftravianx";
|
||||
$lang['notification']['see_features'] = "See the new features of TRAVIAN 4";
|
||||
$lang['notification']['screenshots'] = "Screenshots";
|
||||
|
||||
Reference in New Issue
Block a user