<?php
//$locBegin1 = microtime(true);
include_once "../../site.class.php";
include_once $PATH_TO_CODE."/script/connect.php";
include_once $PATH_TO_CODE."/script/fonction.php";
include_once $PATH_TO_CODE."/script/update/imageupdate.class.php";
include_once $PATH_TO_CODE."/modules/dungeon/update/dungeonplayerobjectlistupdate.class.php";
include_once $PATH_TO_CODE."/modules/dungeon/update/dungeonimageupdate.class.php";
include_once $PATH_TO_CODE."/modules/dungeon/update/playerblocklistupdate.class.php";
include_once $PATH_TO_CODE."/modules/dungeon/objectmanager.class.php";
include_once $PATH_TO_CODE."/modules/dungeon/imageupdaterock.php";
include_once $PATH_TO_CODE."/modules/basicfog/imageupdate.class.php";
$locUpdateImagePara = getGetPost(Constante::$HTTP_IMAGE_UPDATE_NAME, false);
if(!$locUpdateImagePara) {
exit;
}
getSessionPlayerId($locPlayerId);
$locUpdateImageParaArray = explode(Constante::$SEP_URL_1, $locUpdateImagePara);
if(count($locUpdateImageParaArray) < 6)
{
echo "NOT ENOUGHT ARGUMENT IN $locUpdateImagePara";
exit(-1);
}
//echo $locUpdateImagePara;
global $gloObjectManager;
$gloObjectManager->loadBlockInsteadOneZone=false;
$locPlayer = $gloObjectManager->getPlayer($locPlayerId);
header("Content-Type: text/xml;charset=UTF-8");
//TODO : as soon scrolling is activated send equally the center which is used for this update ! (scrolling change the center, and client will not have image name based on the source image but on his position in the screen. A translation will be done on client side.
echo "<?xml version=\"1.0\" encoding=\"utf-8\"?>";
echo "<root>";
$locArrayOfUpdate=array();
array_push($locArrayOfUpdate, new PlayerBlockListUpdate($locUpdateImageParaArray, $locPlayer));
array_push($locArrayOfUpdate, new DungeonPlayerObjectListUpdate($locUpdateImageParaArray, $locPlayer));
array_push($locArrayOfUpdate, new DungeonUpdate($locUpdateImageParaArray, $locPlayer));
array_push($locArrayOfUpdate, new RockUpdate($locUpdateImageParaArray, $locPlayer));
if(DungeonConstante::$FOW_IS_ACTIVATED) {
array_push($locArrayOfUpdate, new BasicFogUpdate($locUpdateImageParaArray, $locPlayer));
} else {
array_push($locArrayOfUpdate, new DungeonImageUpdate($locUpdateImageParaArray, $locPlayer));
}
foreach($locArrayOfUpdate as $locUpdate) {
//$locBegin = microtime(true);
$locUpdate->echoUpdate();
//echo "TIMER : ".((microtime(true) - $locBegin)*1000)."ms<br>";
}
echo "</root>";
//echo ((microtime(true) - $locBegin1)*1000)."ms<br>";
?>