game/cron/tom_check.php

116 lines
6.7 KiB
PHP
Raw Normal View History

2022-06-06 21:30:34 +00:00
<?php
define('GAME',true);
setlocale(LC_CTYPE ,"ru_RU.CP1251");
include('/home/newcom1/public_html/_incl_data/__config.php');
include('/home/newcom1/public_html/_incl_data/class/__db_connect.php');
include('/home/newcom1/public_html/_incl_data/class/__user.php');
$sp = mysql_query('SELECT * FROM `stats` WHERE `priemslot` > 10');
while( $pl = mysql_fetch_array($sp) ) {
$test = mysql_fetch_array(mysql_query('SELECT * FROM `rep` WHERE `id` = "'.$pl['id'].'" LIMIT 1'));
$userst = mysql_fetch_array(mysql_query('SELECT * FROM `users` WHERE `id` = "'.$pl['id'].'" LIMIT 1'));
if($test['add_slot']>0)
{
// echo "<22><><EFBFBD>:".$userst['login']." <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:".$pl['priemslot']." <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:".$test['add_slot']."<br>";
}
$kolvo = mysql_fetch_array(mysql_query('SELECT COUNT(*) FROM `actions` WHERE `uid` ="'.$pl['id'].'" AND `vars` ="read"'));
$overtop=$pl['priemslot']-10-$test['add_slot']-($kolvo['COUNT(*)']+1);
$overtopkorrect=$pl['priemslot']-10-$test['add_slot'];
if($overtop>8)
{
$prevish = $overtop -8;
} else {$prevish =0;}
if ($overtopkorrect>8){$overtopkorrect=8;}
$resultslot= 10 + $test['add_slot'] + $overtopkorrect;
if($overtop>0)
{
echo "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>!!! <20><><EFBFBD>:".$userst['login']." <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:".$pl['priemslot']." <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>:".$resultslot." <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:".$test['add_slot']." <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>:".$kolvo['COUNT(*)']." <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:".$overtop." <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:".$prevish." <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:".$overtopkorrect."<br>";
mysql_query('UPDATE `stats` SET `priemslot` = "'.$resultslot.'" WHERE `id` = "'.$pl['id'].'"');
// mysql_query('UPDATE `stats` SET `priemslot` = "'.$resultslot.'" WHERE `id` = "'.$pl['id'].'"');
mysql_query('DELETE FROM `actions` WHERE `uid` = "'.$pl['id'].'" AND `vars` = "read" ');
if($overtopkorrect==5){$overtopkorrect=6;}
if ($overtopkorrect==1)
{
mysql_query('INSERT INTO `actions`(`uid`, `time`, `city`, `room`, `vars`, `vals`) VALUES ("'.$pl['id'].'","'.time().'","capitalcity","10","read","1044")');
}
elseif ($overtopkorrect==2)
{
mysql_query('INSERT INTO `actions`(`uid`, `time`, `city`, `room`, `vars`, `vals`) VALUES ("'.$pl['id'].'","'.time().'","capitalcity","10","read","1044")');
mysql_query('INSERT INTO `actions`(`uid`, `time`, `city`, `room`, `vars`, `vals`) VALUES ("'.$pl['id'].'","'.time().'","capitalcity","10","read","1045")');
}
elseif ($overtopkorrect==3)
{
mysql_query('INSERT INTO `actions`(`uid`, `time`, `city`, `room`, `vars`, `vals`) VALUES ("'.$pl['id'].'","'.time().'","capitalcity","10","read","1044")');
mysql_query('INSERT INTO `actions`(`uid`, `time`, `city`, `room`, `vars`, `vals`) VALUES ("'.$pl['id'].'","'.time().'","capitalcity","10","read","1045")');
mysql_query('INSERT INTO `actions`(`uid`, `time`, `city`, `room`, `vars`, `vals`) VALUES ("'.$pl['id'].'","'.time().'","capitalcity","10","read","1046")');
}
elseif ($overtopkorrect==4)
{
mysql_query('INSERT INTO `actions`(`uid`, `time`, `city`, `room`, `vars`, `vals`) VALUES ("'.$pl['id'].'","'.time().'","capitalcity","10","read","1044")');
mysql_query('INSERT INTO `actions`(`uid`, `time`, `city`, `room`, `vars`, `vals`) VALUES ("'.$pl['id'].'","'.time().'","capitalcity","10","read","1045")');
mysql_query('INSERT INTO `actions`(`uid`, `time`, `city`, `room`, `vars`, `vals`) VALUES ("'.$pl['id'].'","'.time().'","capitalcity","10","read","1046")');
mysql_query('INSERT INTO `actions`(`uid`, `time`, `city`, `room`, `vars`, `vals`) VALUES ("'.$pl['id'].'","'.time().'","capitalcity","10","read","1047")');
}
elseif ($overtopkorrect==6)
{
mysql_query('INSERT INTO `actions`(`uid`, `time`, `city`, `room`, `vars`, `vals`) VALUES ("'.$pl['id'].'","'.time().'","capitalcity","10","read","1044")');
mysql_query('INSERT INTO `actions`(`uid`, `time`, `city`, `room`, `vars`, `vals`) VALUES ("'.$pl['id'].'","'.time().'","capitalcity","10","read","1045")');
mysql_query('INSERT INTO `actions`(`uid`, `time`, `city`, `room`, `vars`, `vals`) VALUES ("'.$pl['id'].'","'.time().'","capitalcity","10","read","1046")');
mysql_query('INSERT INTO `actions`(`uid`, `time`, `city`, `room`, `vars`, `vals`) VALUES ("'.$pl['id'].'","'.time().'","capitalcity","10","read","1047")');
mysql_query('INSERT INTO `actions`(`uid`, `time`, `city`, `room`, `vars`, `vals`) VALUES ("'.$pl['id'].'","'.time().'","capitalcity","10","read","4811")');
}
elseif ($overtopkorrect==7)
{
mysql_query('INSERT INTO `actions`(`uid`, `time`, `city`, `room`, `vars`, `vals`) VALUES ("'.$pl['id'].'","'.time().'","capitalcity","10","read","1044")');
mysql_query('INSERT INTO `actions`(`uid`, `time`, `city`, `room`, `vars`, `vals`) VALUES ("'.$pl['id'].'","'.time().'","capitalcity","10","read","1045")');
mysql_query('INSERT INTO `actions`(`uid`, `time`, `city`, `room`, `vars`, `vals`) VALUES ("'.$pl['id'].'","'.time().'","capitalcity","10","read","1046")');
mysql_query('INSERT INTO `actions`(`uid`, `time`, `city`, `room`, `vars`, `vals`) VALUES ("'.$pl['id'].'","'.time().'","capitalcity","10","read","1047")');
mysql_query('INSERT INTO `actions`(`uid`, `time`, `city`, `room`, `vars`, `vals`) VALUES ("'.$pl['id'].'","'.time().'","capitalcity","10","read","4811")');
mysql_query('INSERT INTO `actions`(`uid`, `time`, `city`, `room`, `vars`, `vals`) VALUES ("'.$pl['id'].'","'.time().'","capitalcity","10","read","4812")');
}
elseif ($overtopkorrect==8)
{
mysql_query('INSERT INTO `actions`(`uid`, `time`, `city`, `room`, `vars`, `vals`) VALUES ("'.$pl['id'].'","'.time().'","capitalcity","10","read","1044")');
mysql_query('INSERT INTO `actions`(`uid`, `time`, `city`, `room`, `vars`, `vals`) VALUES ("'.$pl['id'].'","'.time().'","capitalcity","10","read","1045")');
mysql_query('INSERT INTO `actions`(`uid`, `time`, `city`, `room`, `vars`, `vals`) VALUES ("'.$pl['id'].'","'.time().'","capitalcity","10","read","1046")');
mysql_query('INSERT INTO `actions`(`uid`, `time`, `city`, `room`, `vars`, `vals`) VALUES ("'.$pl['id'].'","'.time().'","capitalcity","10","read","1047")');
mysql_query('INSERT INTO `actions`(`uid`, `time`, `city`, `room`, `vars`, `vals`) VALUES ("'.$pl['id'].'","'.time().'","capitalcity","10","read","4811")');
mysql_query('INSERT INTO `actions`(`uid`, `time`, `city`, `room`, `vars`, `vals`) VALUES ("'.$pl['id'].'","'.time().'","capitalcity","10","read","4812")');
mysql_query('INSERT INTO `actions`(`uid`, `time`, `city`, `room`, `vars`, `vals`) VALUES ("'.$pl['id'].'","'.time().'","capitalcity","10","read","4813")');
}
echo "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>!!! <20><><EFBFBD>:".$userst['login']." <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:".$resultslot." <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:".$test['add_slot']." <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>:".$overtopkorrect."<br>";
}
}
?>