//bcscale(4); date_default_timezone_set("Europe/Rome"); if(isset($_POST["userNick"])){$nome=$_POST["userNick"];} if(isset($_POST["mechtype"])){$mechtype=$_POST["mechtype"];} if(isset($_POST["score"])){$realScore=$_POST["score"];} if(isset($realScore)){$score=substr("0000000000000000".$realScore,-16);} $host=$_SERVER['REMOTE_ADDR']; if(isset($_POST['magic'])){$magic=$_POST['magic'];}else{$magic="getScore";} if(isset($_GET["mod"])){ $mech=$_GET["mod"]; }else{ $mech=1; } if(isset($nome)) $nome=str_replace( "/n" , "" , $nome ); //----------------- se score =-1 è la richiesta del numero sessione if($magic=="getScore"){ getScore($mech); }else{ saveScore($nome, $score, $host, $magic, $realScore, $mechtype); getScore($mechtype); } function saveScore($nome, $score, $host, $magic, $realScore, $mechtype){ //echo "il tuo punteggio \n\n ".$nome." ".$score." ".$magic."\n\n"; //echo md5(((($realScore*2)+8534)))."\n\n"; //echo md5($realScore)."\n\n"; //$a1=md5(($realScore*2)+8534); //$a2=md5($nome); //$chk=md5($a1.$a2); //echo $chk; //appende il record al file score $today = getdate(); $month = $today['month']; $mday = $today['mday']; $year = $today['year']; if ($magic==(($realScore*2)+37)){ do { } while (file_exists("lock")); if (!file_exists("scores/lock") ){ $f = @fopen("scores/lock", "w"); @fputs($f,"-"); fclose($f); $f = @fopen("scores/".$year.$month.$mday, "a"); @fputs($f,"$score|$nome|$mechtype|$host\n"); @fclose($f); $f = @fopen("scores/".$year.$month, "a"); @fputs($f,"$score|$nome|$mechtype|$host\n"); @fclose($f); $f = @fopen("scores/".$year, "a"); @fputs($f,"$score|$nome|$mechtype|$host\n"); @fclose($f); //echo "classifica"; //echo "\n\n"; $hiscore=@file("scores/".$year.$month.$mday); rsort ($hiscore); $Yhiscore=@file("scores/".$year); rsort ($Yhiscore); $Mhiscore=@file("scores/".$year.$month); rsort ($Mhiscore); // salva $f = @fopen("scores/".$year.$month.$mday, "w"); $fm= @fopen("scores/".$year.$month, "w"); $fy= @fopen("scores/".$year, "w"); // salva i giornalieri $i=0; foreach($hiscore as $score){ $i++; if ($i<1000){ @fputs($f,$score); } } // salva gli annuali $i=0; foreach($Yhiscore as $score){ $i++; if ($i<100){ @fputs($fy,$score); } } // salva i mensili $i=0; foreach($Mhiscore as $score){ $i++; if ($i<100){ @fputs($fm,$score); } } //echo "OK"; fclose($f); fclose($fm); fclose($fy); unlink("scores/lock"); } } //getScore(); //echo "scoreSaved=1"; } function getScore($mech){ ?>
|
Model AK021 :: Today's Hi Score |
www.officinepixel.com |