Файл: DarkAge/udarpk.php
Строк: 28
<?
Error_Reporting(E_ALL & ~E_NOTICE);
include_once("files/antixak.php");
include_once("files/zag.php");
$log = htmlspecialchars(stripslashes($log));
$pas = htmlspecialchars(stripslashes($pas));
/////////////////////////////////////////////////////
$text = @file("data/reg/$log.dat");
if ($text!=""){
$udata = explode(":||:",$text[0]);
$login=trim($udata[0]);
$password=trim($udata[1]);
$mysila=trim($udata[4]);}
////////////////////////////////////////////////////////
if (md5($pas)==$password && $log==$login && $log!=="" && md5($pas)!=="") {
if(@file("data/pk/$log.dat")){
$text = @file("data/pk/$log.dat");
$data = explode("||",$text[0]);
if(@file("data/pk/lose/$log.dat")){header ("Location: losepk.php?log=$log&pas=$pas"); exit;}
if(!@file("data/pk/$data[0].dat")){header ("Location: winpk.php?log=$log&pas=$pas"); exit;}
$text = @file("data/reg/$data[0].dat");
$udat = explode(":||:",$text[0]);
$rand=rand(1,400);
$udar=$mysila-$udat[3]+$rand;
if($udar<="0"){$udar="$rand";}
$udat[16]=$udat[16]-$udar;
$pkss=$udat[0].':||:'.$udat[1].':||:'.$udat[2].':||:'.$udat[3].':||:'.$udat[4].':||:'.$udat[5].':||:'.$udat[6].':||:'.$udat[7].':||:'.$udat[8].':||:'.$udat[9].':||:'.$udat[10].':||:'.$udat[11].':||:'.$udat[12].':||:'.$udat[13].':||:'.$udat[14].':||:'.$udat[15].':||:'.$udat[16].':||:'.$udat[17].':||:'.$udat[18].':||:'.$udat[19].':||:'.$udat[20].':||:'.$udat[21].':||:'.$udat[22].':||:'.$udat[23].':||:'.$udat[24].':||:'.$udat[25].':||:'.$udat[26].':||:'.$udat[27].':||:'.$udat[28].':||:'.$udat[29].':||:'.$udat[30].':||:'.$udat[31].':||:'.$udat[32].':||:'.$udat[33].':||:'.$udat[34].':||:'.$udat[35].':||:'.$udat[36].':||:'.$udat[37].':||:'.$udat[38].':||:'.$udat[39].':||:'.$udat[40].':||:'.$udat[41].':||:'.$udat[42].':||:'.$udat[43].':||:'.$udat[44].':||:'.$udat[45].':||:'.$udat[46].':||:'.$udat[47].':||:'.$udat[48].':||:'.$udat[49].':||:'.$udat[50].':||:'.$udat[51].':||:'.$udat[52].':||:'.$udat[53].':||:'.$udat[54].':||:'.$udat[55].':||:'.$udat[56].':||:'.$udat[57].':||:'.$udat[58].':||:'.$udat[59].':||:'.$udat[60].':||:'.$udat[61].':||:'.$udat[62].':||:'.$udat[63].':||:'.$udat[64].':||:'.$udat[65].':||:'.$udat[66].':||:'.$udat[67].':||:'.$udat[68].':||:'.$udat[69].':||:'.$udat[70].':||:'.$udat[71].':||:'.$udat[72].':||:'.$udat[73].':||:'.$udat[74].':||:'.$udat[75].':||:'.$udat[76].':||:'.$udat[77].':||:'.$udat[78].':||:'.$udat[79].':||:'.$udat[80].':||:'.$udat[81].':||:'.$udat[82].':||:'.$udat[83].':||:'.$udat[84].':||:'.$udat[85].':||:'.$udat[86].':||:'.$udat[87].':||:'.$udat[88].':||:'.$udat[89].':||:'.$udat[90].':||:'.$udat[91].':||:'.$udat[92].':||:'.$udat[93].':||:'.$udat[94].':||:'.$udat[95].':||:'.$udat[96].':||:'.$udat[97].':||:'.$udat[98].':||:'.$udat[99].':||:'.$udat[100].':||:';
$fp=fopen("data/reg/$data[0].dat","a+");
flock($fp,LOCK_EX);
ftruncate($fp,0);
fputs($fp,"$pkssrn");
fflush($fp);
flock($fp,LOCK_UN);
fclose($fp);
if($udat[16]<="0"){
$fp=fopen("data/pk/lose/$data[0].dat","w");
flock($fp,LOCK_EX);
ftruncate($fp,0);
fputs($fp,"$log||rn");
fflush($fp);
flock($fp,LOCK_UN);
fclose($fp);
header ("Location: winpk.php?log=$log&pas=$pas"); exit;}
header ("Location: combatpk.php?log=$log&pas=$pas&udar=$udar");
}
}
include_once("files/down.php");
?>