Вход Регистрация
Файл: gamele.ru/gameplay/ajax/map_ajax.php
Строк: 61
<?php
session_start
();
include(
$_SERVER["DOCUMENT_ROOT"]."/includes/config.inc.php");
include(
DROOT."/includes/functions.php");

$pers GetUser();

$plstt=allparam($pers);

$totems = array("0"=>array("00:00","01:59"),"1"=>array("02:00","03:59"),"2"=>array("04:00","05:59"),"3"=>array("06:00","07:59"),"4"=>array("08:00","09:59"),"5"=>array("10:00","11:59"),"6"=>array("12:00","13:59"),"7"=>array("14:00","15:59"),"8"=>array("16:00","17:59"),"9"=>array("18:00","19:59"),"10"=>array("20:00","21:59"),"11"=>array("22:00","23:59"));

$IsNap 0;
if(
date("H:i")>=$totems[$pers['thotem']][0] and date("H:i")<=$totems[$pers['thotem']][1]){
    
$IsNap 1;
}

if(
mysql_num_rows(mysql_query("SELECT * FROM `effects` WHERE `time>'".time()."' and `userid`='".$pers['id']."' AND (`eff_id`='1' OR `eff_id`='2')"))>0){
    exit(
'MESS@["Передвижение невозможно",0,0]');
}

if(
round(($pers['ustal']-time())/(150/($plstt[58]/200+1)))>88){
    exit(
'MESS@["Перемещение невозможно! Вы слишком устали!",0,0]');
    }

list(
$pers['x'], $pers['y']) = explode('_'$pers['pos']);
for(
$x = ($pers['x']-1);$x <= ($pers['x']+1);$x++){
    for(
$y = ($pers['y']-1);$y <= ($pers['y']+1);$y++){
        if((
$_GET['x'] == $x and $_GET['y'] == $y)){
            
$GoPos = array('x'=>$_GET['x'],'y'=>$_GET['y']);
        }
    }
}
if(
intval($_GET['act']==1)){
$pers['umen'] = (($pers['umen'])?$pers['umen']:'||||||||||||||||||||||||||||||||||||');
$um explode("|",$pers['umen']);
foreach(
$um as $key=>$val){
    
$umt[$key] = (($val)?$val:0);
}
$is_cord mysql_fetch_array(mysql_query("SELECT * FROM `nature` WHERE `x` = '".intval($GoPos['x'])."' and `y` = '".intval($GoPos['y'])."'"));

$ust=$pers['ustal']+(150/($plstt[58]/200+1));
if(
round(($pers['ustal']-time())/(150/($plstt[58]/200+1)))<88){
if((!empty(
$is_cord['x']) or $is_cord['x']=='0') and (!empty($is_cord['y']) or $is_cord['y']=='0') and in_array($_GET['vcode'],$_SESSION['vcodes'])){
    if(
$pers['ustal']<time()){
        
$pers['ustal']=time();
    }
$WaitTime = (30-(intval($umt[26]/6.6)));

    
$it=mysql_fetch_array(mysql_query("SELECT `invent`.*, `items`.* FROM `items` INNER JOIN `invent` ON `items`.`id` = `invent`.`protype` WHERE `invent`.`pl_id`='".$pers['id']."' AND `items`.`acte`='BotNapForm' LIMIT 1;"));
    
mysql_query("UPDATE `user` SET `ustal`='".($pers['ustal']+(150/($nst[58]/200+1)))."',`pos`='".$is_cord['x']."_".$is_cord['y']."',`wait`='".(time()+$WaitTime)."' WHERE `id` = '".$pers['id']."'");
    
$_SESSION['nature_from'] = $pers['x']."_".$pers['y'];
    unset(
$_SESSION['vcodes']);
    echo
'GO@'.$is_cord['x'].'@'.$is_cord['y'].'@[';
    
$query_nature mysql_query("SELECT `x`,`y` FROM `nature` WHERE `x`>='".($is_cord['x']-1)."' and `x`<='".($is_cord['x']+1)."' and `y`>='".($is_cord['y']-1)."' and `y`<='".($is_cord['y']+1)."'");
    
$pnature '';
    while(
$nature mysql_fetch_array($query_nature)){
        if(
$is_cord['x']!=$nature['x'] or $is_cord['y']!=$nature['y']){
            
$pnature .= '['.$nature['x'].','.$nature['y'].',"'.vCode().'"],';
        }
    }
    echo 
substr($pnature,0,strlen($pnature)-1);
    echo
']@['.($is_cord['quest']?'["que","Квесты","'.vCode().'",[]],':'').'["inf","Ваш персонаж","'.vCode().'",[]],["inv","Инвентарь","'.vCode().'",[]]'.($is_cord['dep']!=64?',["dep","Войти","'.vCode().'",[]]':'').($is_cord['clan_id']==$pers['clan_id']?',["dep","Войти в Замок","'.vCode().'",[]]':'').($is_cord['wood']?',["wood","Деревья","'.vCode().'",[]]':'').($is_cord['ogl']?',["ogl","Оглядется","'.vCode().'",[]]':'').(($is_cord['les'])?',["les","Оглядется","'.vCode().'",[]]':'').($is_cord['fis']?',["fis","Рыбалка","'.vCode().'",[]]':'').($IsNap?',["fig","Напасть","'.vCode().'",[]]':'').($is_cord['dri']?',["dri","Пить","'.vCode().'",[]]':'').(accesses($pers['id'],'out')?',["editor","Редактор","'.vCode().'",[]]':'').']@['.$WaitTime.',"';
    if(
date("H")<or date("H")>20){
        echo
'night';
    }else{
        echo
'day';
    }
    echo
'",""]';
    }
    else{
    echo
'ERR';
//MESS@["Соединение с сервером утеряно. Просьба выполнить повторный вход в игру с главной страницы.",0,0]
}
}else{
    echo
'MESS@["Вы сильно утомлены<br /> отдохните немного и продолжите свой путь.",0,0]';
}
}
?>
Онлайн: 0
Реклама