From cc577b9620ad24495f4ad3a280b56acb915b0e69 Mon Sep 17 00:00:00 2001 From: VBoss Date: Tue, 9 Feb 2016 00:30:01 +0100 Subject: [PATCH] Displaying map - navigation --- App/Config/config.neon | 1 + .../Model/VData/VillageService.php | 65 ++-- App/FrontModule/Model/WData/WDataModel.php | 52 ++++ .../Controls/Header/HeaderControl.latte | 2 +- .../Controls/Header/HeaderControl.php | 5 + App/GameModule/DTO/Village.php | 19 ++ .../Model/Diplomacy/DiplomacyModel.php | 74 +++++ App/GameModule/Presenters/MapPresenter.php | 151 +++++++++- App/GameModule/Templates/Map/default.latte | 101 +++++++ App/InstallModule/Model/WorldGenerator.php | 6 +- App/Model/BaseModel.php | 10 + www/Templates/Map/mapview.tpl | 283 ------------------ www/karte.php | 113 +------ 13 files changed, 450 insertions(+), 432 deletions(-) create mode 100644 App/GameModule/Model/Diplomacy/DiplomacyModel.php create mode 100644 App/GameModule/Templates/Map/default.latte delete mode 100644 www/Templates/Map/mapview.tpl diff --git a/App/Config/config.neon b/App/Config/config.neon index 08552965..a41e5f8b 100644 --- a/App/Config/config.neon +++ b/App/Config/config.neon @@ -53,6 +53,7 @@ services: - App\GameModule\Model\Event\ProcessEvents - App\GameModule\Model\Building\BuildingAvailabilityService - App\GameModule\Model\Event\ProcessCulturePoints + - App\GameModule\Model\Diplomacy\DiplomacyModel # commands - diff --git a/App/FrontModule/Model/VData/VillageService.php b/App/FrontModule/Model/VData/VillageService.php index a53f6981..079f8aea 100644 --- a/App/FrontModule/Model/VData/VillageService.php +++ b/App/FrontModule/Model/VData/VillageService.php @@ -81,38 +81,39 @@ public function getVillage($id) /** @var \stdClass $VData */ $VData = $this->VDataModel->getByWId($id); $village = new App\GameModule\DTO\Village(); - - /** @var \stdClass $owner */ - $owner = $this->userModel->get($VData->owner); - $village->setOwner($owner); - - $village->setId($VData->wref); - - $village->setActualWood($VData->wood); - $village->setActualClay($VData->clay); - $village->setActualIron($VData->iron); - $village->setActualCrop($VData->crop); - $village->setStorage($VData->maxstore); - $village->setGranary($VData->maxcrop); - - $village->setUpkeep($VData->pop); - - $village->setName($VData->name); - $village->setLoyalty($VData->loyalty); - $village->setCapital($VData->capital); - - $village->setType($VData->type); - $village->setNatar($VData->natar); - $village->setCulturePoints($VData->cp); - - $FData = $this->FDataModel->getByVref($village->getId())->toArray(); - $village->setFData($FData); - - $village->setProductionWood($this->productionService->getProductionWood($village)); - $village->setProductionClay($this->productionService->getProductionClay($village)); - $village->setProductionIron($this->productionService->getProductionIron($village)); - $village->setProductionCrop($this->productionService->getProductionCrop($village)); - $village->setMaxUpkeep($this->productionService->getProductionCrop($village)); + $village->setId($id); + if ($VData) { + /** @var \stdClass $owner */ + $owner = $this->userModel->get($VData->owner); + $village->setOwner($owner); + + $village->setActualWood($VData->wood); + $village->setActualClay($VData->clay); + $village->setActualIron($VData->iron); + $village->setActualCrop($VData->crop); + $village->setStorage($VData->maxstore); + $village->setGranary($VData->maxcrop); + + $village->setUpkeep($VData->pop); + + $village->setName($VData->name); + $village->setLoyalty($VData->loyalty); + $village->setCapital($VData->capital); + + $village->setType($VData->type); + $village->setNatar($VData->natar); + $village->setCulturePoints($VData->cp); + $village->setPopulation($VData->pop); + + $FData = $this->FDataModel->getByVref($village->getId())->toArray(); + $village->setFData($FData); + + $village->setProductionWood($this->productionService->getProductionWood($village)); + $village->setProductionClay($this->productionService->getProductionClay($village)); + $village->setProductionIron($this->productionService->getProductionIron($village)); + $village->setProductionCrop($this->productionService->getProductionCrop($village)); + $village->setMaxUpkeep($this->productionService->getProductionCrop($village)); + } return $village; } diff --git a/App/FrontModule/Model/WData/WDataModel.php b/App/FrontModule/Model/WData/WDataModel.php index 7729108d..bebcda96 100644 --- a/App/FrontModule/Model/WData/WDataModel.php +++ b/App/FrontModule/Model/WData/WDataModel.php @@ -12,6 +12,58 @@ class WDataModel extends App\Model\BaseModel /** @var int */ private $worldSize; + public static $mapCoordinates = [ + "53, 137, 90, 157, 53, 177, 16, 157", + "89, 117, 126, 137, 89, 157, 52, 137", + "125, 97, 162, 117, 125, 137, 88, 117", + "161, 77, 198, 97, 161, 117, 124, 97", + "197, 57, 234, 77, 197, 97, 160, 77", + "233, 37, 270, 57, 233, 77, 196, 57", + "269, 17, 306, 37, 269, 57, 232, 37", + "90, 157, 127, 177, 90, 197, 53, 177", + "126, 137, 163, 157, 126, 177, 89, 157", + "162, 117, 199, 137, 162, 157, 125, 137", + "198, 97, 235, 117, 198, 137, 161, 117", + "234, 77, 271, 97, 234, 117, 197, 97", + "270, 57, 307, 77, 270, 97, 233, 77", + "306, 37, 343, 57, 306, 77, 269, 57", + "127, 177, 164, 197, 127, 217, 90, 197", + "163, 157, 200, 177, 163, 197, 126, 177", + "199, 137, 236, 157, 199, 177, 162, 157", + "235, 117, 272, 137, 235, 157, 198, 137", + "271, 97, 308, 117, 271, 137, 234, 117", + "307, 77, 344, 97, 307, 117, 270, 97", + "343, 57, 380, 77, 343, 97, 306, 77", + "164, 197, 201, 217, 164, 237, 127, 217", + "200, 177, 237, 197, 200, 217, 163, 197", + "236, 157, 273, 177, 236, 197, 199, 177", + "272, 137, 309, 157, 272, 177, 235, 157", + "308, 117, 345, 137, 308, 157, 271, 137", + "344, 97, 381, 117, 344, 137, 307, 117", + "380, 77, 417, 97, 380, 117, 343, 97", + "201, 217, 238, 237, 201, 257, 164, 237", + "237, 197, 274, 217, 237, 237, 200, 217", + "273, 177, 310, 197, 273, 217, 236, 197", + "309, 157, 346, 177, 309, 197, 272, 177", + "345, 137, 382, 157, 345, 177, 308, 157", + "381, 117, 418, 137, 381, 157, 344, 137", + "417, 97, 454, 117, 417, 137, 380, 117", + "238, 237, 275, 257, 238, 277, 201, 257", + "274, 217, 311, 237, 274, 257, 237, 237", + "310, 197, 347, 217, 310, 237, 273, 217", + "346, 177, 383, 197, 346, 217, 309, 197", + "382, 157, 419, 177, 382, 197, 345, 177", + "418, 137, 455, 157, 418, 177, 381, 157", + "454, 117, 491, 137, 454, 157, 417, 137", + "275, 257, 312, 277, 275, 297, 238, 277", + "311, 237, 348, 257, 311, 277, 274, 257", + "347, 217, 384, 237, 347, 257, 310, 237", + "383, 197, 420, 217, 383, 237, 346, 217", + "419, 177, 456, 197, 419, 217, 382, 197", + "455, 157, 492, 177, 455, 197, 418, 177", + "491, 137, 528, 157, 491, 177, 454, 157", + ]; + public function __construct( $worldSize, diff --git a/App/GameModule/Controls/Header/HeaderControl.latte b/App/GameModule/Controls/Header/HeaderControl.latte index e805b58f..219cfada 100644 --- a/App/GameModule/Controls/Header/HeaderControl.latte +++ b/App/GameModule/Controls/Header/HeaderControl.latte @@ -2,7 +2,7 @@
Village overview Village centre - Map + Map Statistics
+

Map ({$wdata->x}|{$wdata->y})

+ +
+
+ {foreach $fieldData as $key => $field} +
+ {/foreach} +
+ +
+ {foreach $ruler as $key => $value} +
{$value}
+ {/foreach} +
+ + + {foreach $fieldData as $key => $field} + occupied === 1} + alt="({$field->x}|{$field->y}) {$field->village->getName()}
+ Owner: {$field->village->getOwner()->username}
+ Tribe: Teutons
+ Population: {$field->village->getPopulation()}
+ Alliance: -" + {elseif $field->oasistype > 0} + alt="Unoccupied oasis" + {/if} + + href="{link ':Game:Map:detail' $field->id}"> + {/foreach} + + + + +
+ + {if $user->identity->gold} + + + + {/if} + + + + + + + + +
+ {form move} + {$form['x']->caption} + {$form['y']->caption} + + {/form} +
+ + + + + + + + + + + + + + + + + +
details:
Owner: + {if isset($fieldData['3_3']->village)} + {$fieldData['3_3']->village->getOwner()->username} + {else} + - + {/if} +
Population: + {if isset($fieldData['3_3']->village)} + {$fieldData['3_3']->village->getPopulation()} + {else} + - + {/if} +
Alliance: + {if isset($fieldData['3_3']->village) && $fieldData['3_3']->village->getOwner()->alliance != 0} + {$fieldData['3_3']->village->getOwner()->alliance} + {else} + - + {/if} +
+
+
+{/block} \ No newline at end of file diff --git a/App/InstallModule/Model/WorldGenerator.php b/App/InstallModule/Model/WorldGenerator.php index fad63150..7afc9d81 100644 --- a/App/InstallModule/Model/WorldGenerator.php +++ b/App/InstallModule/Model/WorldGenerator.php @@ -43,10 +43,10 @@ public function generate() $field = $this->calculateFieldType(); } - if ($field['oasistype'] === 1) { - $field['image'] = "t" . rand(0, 9) . ""; + if ($field['oasistype'] === 0) { + $field['image'] = "t" . rand(0, 9); } else { - $field['image'] = "o" . $field['oasistype'] . ""; + $field['image'] = "o" . $field['oasistype']; } $field['x'] = $x; diff --git a/App/Model/BaseModel.php b/App/Model/BaseModel.php index eecb9bc4..1734114d 100644 --- a/App/Model/BaseModel.php +++ b/App/Model/BaseModel.php @@ -71,4 +71,14 @@ public function delete($id) ->where('id = %i', $id) ->execute(); } + + public function getMapData($xMax, $xMin, $yMax, $yMin) + { + return $this->database->select('*')->from($this->table) + ->where('x <= %i', $xMax) + ->where('x >= %i', $xMin) + ->where('y <= %i', $yMax) + ->where('y >= %i', $yMin) + ->fetchAll(); + } } \ No newline at end of file diff --git a/www/Templates/Map/mapview.tpl b/www/Templates/Map/mapview.tpl deleted file mode 100644 index 88480ea5..00000000 --- a/www/Templates/Map/mapview.tpl +++ /dev/null @@ -1,283 +0,0 @@ -getCoor($_GET['z']);++$requse2; - $y = $currentcoor['y']; - $x = $currentcoor['x']; - $bigmid = $_GET['z']; -} -else if(isset($_POST['xp']) && isset($_POST['yp'])){ - $x = $_POST['xp']; - $y = $_POST['yp']; - $bigmid = $generator->getBaseID($x,$y); -} -else { - $y = $village->coor['y']; - $x = $village->coor['x']; - $bigmid = $village->wid; -} - -$xm7 = ($x-7) < -WORLD_MAX? $x+WORLD_MAX+WORLD_MAX-6 : $x-7; -$xm3 = ($x-3) < -WORLD_MAX? $x+WORLD_MAX+WORLD_MAX-2 : $x-3; -$xm2 = ($x-2) < -WORLD_MAX? $x+WORLD_MAX+WORLD_MAX-1 : $x-2; -$xm1 = ($x-1) < -WORLD_MAX? $x+WORLD_MAX+WORLD_MAX : $x-1; -$xp1 = ($x+1) > WORLD_MAX? $x-WORLD_MAX-WORLD_MAX : $x+1; -$xp2 = ($x+2) > WORLD_MAX? $x-WORLD_MAX-WORLD_MAX+1 : $x+2; -$xp3 = ($x+3) > WORLD_MAX? $x-WORLD_MAX-WORLD_MAX+2: $x+3; -$xp7 = ($x+7) > WORLD_MAX? $x-WORLD_MAX-WORLD_MAX+6: $x+7; -$ym7 = ($y-7) < -WORLD_MAX? $y+WORLD_MAX+WORLD_MAX-6 : $y-7; -$ym3 = ($y-3) < -WORLD_MAX? $y+WORLD_MAX+WORLD_MAX-2 : $y-3; -$ym2 = ($y-2) < -WORLD_MAX? $y+WORLD_MAX+WORLD_MAX-1 : $y-2; -$ym1 = ($y-1) < -WORLD_MAX? $y+WORLD_MAX+WORLD_MAX : $y-1; -$yp1 = ($y+1) > WORLD_MAX? $y-WORLD_MAX-WORLD_MAX : $y+1; -$yp2 = ($y+2) > WORLD_MAX? $y-WORLD_MAX-WORLD_MAX+1 : $y+2; -$yp3 = ($y+3) > WORLD_MAX? $y-WORLD_MAX-WORLD_MAX+2: $y+3; -$yp7 = ($y+7) > WORLD_MAX? $y-WORLD_MAX-WORLD_MAX+6: $y+7; -$xarray = array($xm3,$xm2,$xm1,$x,$xp1,$xp2,$xp3); -$yarray = array($ym3,$ym2,$ym1,$y,$yp1,$yp2,$yp3); -$maparray = array(); -$xcount = 0; -$maparray = ''; -$maparray2 = ''; -for($i=0; $i<=6; $i++){ - if($xcount != 7){ - $maparray .= '\''.$generator->getBaseID($xarray[$xcount],$yarray[$i]).'\','; - $maparray2 .= $generator->getBaseID($xarray[$xcount],$yarray[$i]).','; - if($i==6){ - $i = -1; - $xcount +=1; - } - } -} - -$maparray = (substr($maparray, 0, -1)); -//echo $maparray; - -$query2 = "SELECT - ".TB_PREFIX."wdata.id AS map_id, - ".TB_PREFIX."wdata.fieldtype AS map_fieldtype, - ".TB_PREFIX."wdata.oasistype AS map_oasis, - ".TB_PREFIX."wdata.x AS map_x, - ".TB_PREFIX."wdata.y AS map_y, - ".TB_PREFIX."wdata.occupied AS map_occupied, - ".TB_PREFIX."wdata.image AS map_image, - - ".TB_PREFIX."odata.conqured AS oasis_conqured, - info_user_oasis.username AS oasis_user, - info_user_oasis.tribe AS oasis_tribe, - info_alliance_oasis.tag AS oasis_alli_name, - - ".TB_PREFIX."vdata.wref AS ville_id, - ".TB_PREFIX."vdata.owner AS ville_user, - ".TB_PREFIX."vdata.name AS ville_name, - ".TB_PREFIX."vdata.capital AS ville_capital, - ".TB_PREFIX."vdata.pop AS ville_pop, - - ".TB_PREFIX."users.id AS user_id, - ".TB_PREFIX."users.username AS user_username, - ".TB_PREFIX."users.tribe AS user_tribe, - ".TB_PREFIX."users.alliance AS user_alliance, - - ".TB_PREFIX."alidata.id AS aliance_id, - ".TB_PREFIX."alidata.tag AS aliance_name - - FROM ((((((".TB_PREFIX."wdata - LEFT JOIN ".TB_PREFIX."vdata ON ".TB_PREFIX."vdata.wref = ".TB_PREFIX."wdata.id ) - LEFT JOIN ".TB_PREFIX."odata ON ".TB_PREFIX."odata.wref = ".TB_PREFIX."wdata.id ) - LEFT JOIN ".TB_PREFIX."users AS info_user_oasis ON info_user_oasis.id = ".TB_PREFIX."odata.owner ) - LEFT JOIN ".TB_PREFIX."alidata AS info_alliance_oasis ON info_alliance_oasis.id = info_user_oasis.alliance ) - LEFT JOIN ".TB_PREFIX."users ON ".TB_PREFIX."users.id = ".TB_PREFIX."vdata.owner ) - LEFT JOIN ".TB_PREFIX."alidata ON ".TB_PREFIX."alidata.id = ".TB_PREFIX."users.alliance ) - where ".TB_PREFIX."wdata.id IN ($maparray) - ORDER BY FIND_IN_SET(".TB_PREFIX."wdata.id,'$maparray2')"; - -//$query2; - -$result2 = mysql_query($query2) or die(mysql_error()); - -$targetalliance = array(); -$neutralarray = array(); -$friendarray = array(); -$enemyarray = array(); -$i=0; -$i2=0; -//Load coor array -$coorarray = array("53, 137, 90, 157, 53, 177, 16, 157","89, 117, 126, 137, 89, 157, 52, 137","125, 97, 162, 117, 125, 137, 88, 117","161, 77, 198, 97, 161, 117, 124, 97","197, 57, 234, 77, 197, 97, 160, 77","233, 37, 270, 57, 233, 77, 196, 57","269, 17, 306, 37, 269, 57, 232, 37","90, 157, 127, 177, 90, 197, 53, 177","126, 137, 163, 157, 126, 177, 89, 157","162, 117, 199, 137, 162, 157, 125, 137","198, 97, 235, 117, 198, 137, 161, 117","234, 77, 271, 97, 234, 117, 197, 97","270, 57, 307, 77, 270, 97, 233, 77","306, 37, 343, 57, 306, 77, 269, 57","127, 177, 164, 197, 127, 217, 90, 197","163, 157, 200, 177, 163, 197, 126, 177","199, 137, 236, 157, 199, 177, 162, 157","235, 117, 272, 137, 235, 157, 198, 137","271, 97, 308, 117, 271, 137, 234, 117","307, 77, 344, 97, 307, 117, 270, 97","343, 57, 380, 77, 343, 97, 306, 77","164, 197, 201, 217, 164, 237, 127, 217","200, 177, 237, 197, 200, 217, 163, 197","236, 157, 273, 177, 236, 197, 199, 177","272, 137, 309, 157, 272, 177, 235, 157","308, 117, 345, 137, 308, 157, 271, 137","344, 97, 381, 117, 344, 137, 307, 117","380, 77, 417, 97, 380, 117, 343, 97","201, 217, 238, 237, 201, 257, 164, 237","237, 197, 274, 217, 237, 237, 200, 217","273, 177, 310, 197, 273, 217, 236, 197","309, 157, 346, 177, 309, 197, 272, 177","345, 137, 382, 157, 345, 177, 308, 157","381, 117, 418, 137, 381, 157, 344, 137","417, 97, 454, 117, 417, 137, 380, 117","238, 237, 275, 257, 238, 277, 201, 257","274, 217, 311, 237, 274, 257, 237, 237","310, 197, 347, 217, 310, 237, 273, 217","346, 177, 383, 197, 346, 217, 309, 197","382, 157, 419, 177, 382, 197, 345, 177","418, 137, 455, 157, 418, 177, 381, 157","454, 117, 491, 137, 454, 157, 417, 137","275, 257, 312, 277, 275, 297, 238, 277","311, 237, 348, 257, 311, 277, 274, 257","347, 217, 384, 237, 347, 257, 310, 237","383, 197, 420, 217, 383, 237, 346, 217","419, 177, 456, 197, 419, 217, 382, 197","455, 157, 492, 177, 455, 197, 418, 177","491, 137, 528, 157, 491, 177, 454, 157"); -$yrow = 0; - -$row = 0; -$coorindex = 0; -$map_js =''; -$map_gen=''; -$map_content=''; - -while ($donnees = mysql_fetch_assoc($result2)){ - -$targetalliance=$donnees["aliance_id"]; -$friendarray=$database->getAllianceAlly($donnees["aliance_id"],1); -$neutralarray=$database->getAllianceAlly($donnees["aliance_id"],2); -$enemyarray=$database->getAllianceWar2($donnees["aliance_id"]); -//var_dump($friendarray); - -//echo "(".$friendarray[0]['alli1'].">0 or ".$donnees["aliance_id"].">0) and (".$friendarray[0]['alli1']."==".$donnees["aliance_id"]." or ".$friendarray[0]['alli2']."==".$donnees["aliance_id"].") and (".$session->alliance." != ".$targetalliance." and ".$session->alliance." and ".$targetalliance.")
\n"; -if (isset($friendarray[0])) { - $friend = (($friendarray[0]['alli1']>0 and $friendarray[0]['alli2']>0 and $donnees["aliance_id"]>0) and ($friendarray[0]['alli1']==$session->alliance or $friendarray[0]['alli2']==$session->alliance) and ($session->alliance != $targetalliance and $session->alliance and $targetalliance)) ? '1':'0'; -}else $friend='0'; -if (isset($enemyarray[0])) { - $war = (($enemyarray[0]['alli1']>0 and $enemyarray[0]['alli2']>0 and $donnees["aliance_id"]>0) and ($enemyarray[0]['alli1']==$session->alliance or $enemyarray[0]['alli2']==$session->alliance) and ($session->alliance != $targetalliance and $session->alliance and $targetalliance)) ? '1':'0'; -}else $war='0'; -if (isset($neutralarray[0])) { - $neutral = (($neutralarray[0]['alli1']>0 and $neutralarray[0]['alli2']>0 and $donnees["aliance_id"]>0) and ($neutralarray[0]['alli1']==$session->alliance or $neutralarray[0]['alli2']==$session->alliance) and ($session->alliance != $targetalliance and $session->alliance and $targetalliance)) ? '1':'0'; -}else $neutral='0'; -//echo $targetalliance.">>"; -//var_dump($friendarray); -//echo"|||
"; -//var_dump($arraydiplo); -//echo in_array($targetalliance,$friendarray); - $image = ($donnees['map_occupied'] == 1 && $donnees['map_fieldtype'] > 0)?(($donnees['ville_user'] == $session->uid)? ($donnees['ville_pop']>=100? $donnees['ville_pop']>= 250?$donnees['ville_pop']>=500? 'b30': 'b20' :'b10' : 'b00') : (($targetalliance != 0)? ($friend==1? ($donnees['ville_pop']>=100? $donnees['ville_pop']>= 250?$donnees['ville_pop']>=500? 'b31': 'b21' :'b11' : 'b01') : ($war==1? ($donnees['ville_pop']>=100? $donnees['ville_pop']>= 250?$donnees['ville_pop']>=500? 'b32': 'b22' :'b12' : 'b02') : ($neutral==1? ($donnees['ville_pop']>=100? $donnees['ville_pop']>= 250?$donnees['ville_pop']>=500? 'b35': 'b25' :'b15' : 'b05') : ($targetalliance == $session->alliance? ($donnees['ville_pop']>=100? $donnees['ville_pop']>= 250?$donnees['ville_pop']>=500? 'b33': 'b23' :'b13' : 'b03') : ($donnees['ville_pop']>=100? $donnees['ville_pop']>= 250?$donnees['ville_pop']>=500? 'b34': 'b24' :'b14' : 'b04'))))) : ($donnees['ville_pop']>=100? $donnees['ville_pop']>= 250?$donnees['ville_pop']>=500? 'b34': 'b24' :'b14' : 'b04'))) : $donnees['map_image']; - - // Map Attacks by Shadow & MisterX - - $att = ''; - if($session->plus) { - $wref = $village->wid; - $toWref = $donnees['map_id']; - - if ($database->checkAttack($wref,$toWref) != 0) { - $att = ''; - }elseif ($database->checkEnforce($wref,$toWref) != 0) { - $att = ''; - }elseif ($database->checkScout($wref,$toWref) != 0) { - $att = ''; - } - } - - - // Map content - if($donnees['ville_user']==3 && $donnees['ville_name']==PLANVILLAGE){ - $map_content .= "
$att
\r"; - }else{ - $map_content .= "
$att
\r"; - } - - //Map create - $map_gen .= "\n"; - - //Javascript map info - if($yrow!=7){ - $map_js .= "[".$donnees['map_x'].",".$donnees['map_y'].",".$donnees['map_fieldtype'].",". ((!empty($donnees['map_oasis'])) ? $donnees['map_oasis'] : 0) .",\"d=".$donnees['map_id']."&c=".$generator->getMapCheck($donnees['map_id'])."\",\"".$image."\""; - if($donnees['map_occupied']){ - if($donnees['map_fieldtype'] != 0){ - $map_js.= ",\"".$donnees['ville_name']."\",\"".$donnees['user_username']."\",\"".$donnees['ville_pop']."\",\"".$donnees['aliance_name']."\",\"".$donnees['user_tribe']."\"]\n"; - } - } - elseif($donnees['map_oasis'] != 0){ - if ($donnees['oasis_conqured'] != 0){ - $map_js.= ",\"\",\"".$donnees['oasis_user']."\",\"-\",\"".$donnees['oasis_alli_name']."\",\"".$donnees['oasis_tribe']."\"]"; - } - else{ - $map_js.="]"; - } - } - else{$map_js .= "]\n";} - - if($i2 == 6 && $yrow !=6){ - $i2 = -1; - $yrow +=1; - $map_js .= "],\n["; - } - else { - if($yrow == 6 && $i2 == 6) {$map_js .= "]\n";} - else {$map_js .= ",";} - } - //$regcount += 1; - } - else {$map_js .= "]";} - - if($i == 6 && $row <= 5){ $row += 1; $i = -1;} - $i++; - $i2++; - $coorindex+=1; -} -?> -
-

(|)

-
- -
-
".$xarray[$i]."
\n"; - echo "
".$yarray[$i]."
\n"; - }?> -
- - - - - - - - - plus){ - echo 'large map'; - }?> - - - - - - - -
-
- x - y -
- goldclub != 0){echo " ".CROPFINDER."";}?> -
-
-
-
-
-
-
diff --git a/www/karte.php b/www/karte.php index 424aaab2..9e0c133b 100644 --- a/www/karte.php +++ b/www/karte.php @@ -1,115 +1,6 @@ pageLoadTimeStart(); -if(isset($_GET['newdid'])) { - $_SESSION['wid'] = $_GET['newdid']; -if(isset($_GET['d']) && isset($_GET['c'])){ - header("Location: ".$_SERVER['PHP_SELF']."?d=".preg_replace("/[^a-zA-Z0-9_-]/","",$_GET['d'])."&c=".preg_replace("/[^a-zA-Z0-9_-]/","",$_GET['c'])); -} -else if(isset($_GET['d'])){ - header("Location: ".$_SERVER['PHP_SELF']."?d=".preg_replace("/[^a-zA-Z0-9_-]/","",$_GET['d'])); -} -else{ - header("Location: ".$_SERVER['PHP_SELF']); -} -} else { - $building->procBuild($_GET); -} -?> - - - - <?php echo SERVER_NAME ?> - - - - - - - - - - - - - gpack == null || GP_ENABLE == false) { - echo " - - "; - } else { - echo " - - "; - } - ?> - - - - - -
- -
-
- -
-getMapCheck($_GET['d']) == $_GET['c']) { - include("Templates/Map/vilview.tpl"); - } - else { - header("Location: dorf1.php"); + include("Templates/Map/vilview.tpl"); } -} -else { - include("Templates/Map/mapview.tpl"); -} -?> -



- -
-
-
- -
- - -
-
-
-Calculated in pageLoadTimeEnd()-$start)*1000); -?> ms - -
Server time: -
-
-
-
- - \ No newline at end of file +} \ No newline at end of file