game/cron/battle_dell.php
2022-06-07 00:30:34 +03:00

63 lines
1.9 KiB
PHP
Raw Blame History

<?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');
//11. ÷èñòêà è ñáðîñ ñ÷åò÷èêîâ ïðè îòñóòñòâèè áîåâ ÷òîá íå ëàìàëñß ëîã
$test=0;
while( $test == 0 )
{
$tbtl=mysql_fetch_array(mysql_query('SELECT * FROM `battle` WHERE `team_win`=-1 ORDER BY `id` ASC LIMIT 1'));
echo "<EFBFBD>îé: ";
echo $tbtl['id']."<br>";
if (isset($tbtl['id']))
{
sleep (2);
}
else
{
mysql_query('UPDATE `users` SET `battle` = 0 WHERE `battle` > 0');
mysql_query('LOCK TABLES `battle_act` WRITE,`battle_end` WRITE,`battle_last` WRITE,`battle_out` WRITE,`battle_stat` WRITE,`battle_users` WRITE,`battle` WRITE,`battle_logs` WRITE,`battle_logs_save` WRITE,`zayvki` WRITE');
mysql_query('TRUNCATE TABLE `battle_act`');
//mysql_query('OPTIMIZE TABLE `battle_act`');
mysql_query('TRUNCATE TABLE `battle_end`');
//mysql_query('OPTIMIZE TABLE `battle_end`');
mysql_query('TRUNCATE TABLE `battle_last`');
//mysql_query('OPTIMIZE TABLE `battle_last`');
mysql_query('TRUNCATE TABLE `battle_out`');
//mysql_query('OPTIMIZE TABLE `battle_out`');
mysql_query('TRUNCATE TABLE `battle_stat`');
//mysql_query('OPTIMIZE TABLE `battle_stat`');
mysql_query('TRUNCATE TABLE `battle_users`');
//mysql_query('OPTIMIZE TABLE `battle_users`');
mysql_query('TRUNCATE TABLE `battle`');
//mysql_query('OPTIMIZE TABLE `battle`');
mysql_query('TRUNCATE TABLE `battle_logs`');
//mysql_query('OPTIMIZE TABLE `battle_logs`');
mysql_query('TRUNCATE TABLE `battle_logs_save`');
//mysql_query('OPTIMIZE TABLE `battle_logs_save`');
mysql_query('TRUNCATE TABLE `zayvki`');
//mysql_query('OPTIMIZE TABLE `zayvki`');
mysql_query('UNLOCK TABLES');
$test=1;
}
}
?>