<?
include 'mysql.php';
error_reporting(0);
include_once("inclydings/zag.php");
include_once("inclydings/ini.php");
include_once("inclydings/sesi.php");
if (isset($user)) {
echo"Окрестность: <u>$udata[37]</u><br/><br/>";
$dir = opendir ("L2dbnam/esql2db/mob");
while ($file = readdir ($dir))
{if (( $file != ".") && ($file != ".."))
{$a[]=$file;}}
closedir ($dir);
$total = count($a);
for ($i = 0; $i < $total; $i++){
$tex = @file("L2dbnam/esql2db/mob/$a[$i]");
$data = explode("||",$tex[0]);
$a[$i]=str_replace(".dat","",$a[$i]);
if($data[4]==$udata[37]){
$data_0[]=$data[0];
$data_1[]=$data[1];
$data_2[]=$data[2];
$data_id[]=$a[$i];
}}
foreach($data_0 as $k=>$v)
{
{
$text="1:||:";
$fp=fopen("L2dbnam/esql2db/respaun/bishop.dat","w");
flock($fp,LOCK_EX);
ftruncate($fp,0);
fputs($fp,"$text");
fflush($fp);
flock($fp,LOCK_UN);
fclose($fp);
$text="1:||:";
$fp=fopen("L2dbnam/esql2db/respaun2/bishop.dat","w");
flock($fp,LOCK_EX);
ftruncate($fp,0);
fputs($fp,"$text");
fflush($fp);
flock($fp,LOCK_UN);
fclose($fp);
$zahvat = @file("L2dbnam/esql2db/respaun2/$data_id[$k].dat");
$zadat = explode(":||:",$zahvat[0]);
$dzzz=$zadat[1];
$ffd = $udata[20];
$zahvat = @file("L2dbnam/esql2db/respaun2/$data_id[$k]");
$zadat = explode(":||:",$zahvat[0]);
$dzzz=$zadat[1];
$dzzs=$zadat[0];
$fr=array_merge(glob("L2dbnam/esql2db/respaun2/*.dat"));
foreach ($fr as $file)
{if((time()- filectime($file)) > 180)unlink ($file);}
$fr=array_merge(glob("L2dbnam/esql2db/respaun/*.dat"));
foreach ($fr as $file)
{if((time()- filectime($file)) > 180)unlink ($file);}
if ($zahvat!==false){
$dat_screen[]="[<a href=\"infomob.php?$sd&id=$data_id[$k]\">?</a>] <a href=\"go.php?$sd&id=$data_id[$k]\">$data_0[$k]</a><font color=pink> [$data_1[$k] lvl</font> / <font color=yellow> $data_2[$k] HP]</font><br/>";
}}
if (!@file("L2dbnam/esql2db/respaun2/$data_id[$k].dat")){
$dat_screen[]="[<a href=\"infomob.php?$sd&id=$data_id[$k]\">?</a>] <a href=\"go.php?$sd&id=$data_id[$k]\">$data_0[$k]</a><font color=pink> [$data_1[$k] lvl</font> / <font color=yellow> $data_2[$k] HP]</font><br/>";
}
}
$total = count($dat_screen);
if (empty($_GET['vp'])) $vp = 0;
else $vp = $_GET['vp'];
if ($total < $vp + 8){ $end = $total; }
else {$end = $vp + 8; }
for ($i = $vp; $i < $end; $i++){
echo"$dat_screen[$i]";
}
if ($vp !== 0) {echo '<br/><br/><a href="okrestnosti.php?vp='.($vp - 5).'&'.$sd.'">Пройти назад</a> ';}
if ($total > $vp + 8) {echo ' <br/><a href="okrestnosti.php?vp='.($vp + 5).'&'.$sd.'">Пройти дальше</a>';}
echo"<br/>- - -<br/>";
include_once"inclydings/lvl.php";
}else{echo"Пароль или ник неверен.Возможно сессия устарела.Попробуйте авторизироваться заново...";}
include_once"inclydings/downok.php";
list($msec,$sec)=explode(chr(32),microtime());
?>