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

46 lines
1.7 KiB
PHP

<?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. ÷èñòêà è ñáðîñ ñ÷åò÷èêîâ ïðè îòñóòñòâèè áîåâ ÷òîá íå ëàìàëñß ëîã
$temptime=time()-1*24*60*60; // 1 ñóòîê
$temptimeñ=time()-24*60*60; // 24 ÷àñà
//mysql_query('OPTIMIZE TABLE `battle_act`');
mysql_query('DELETE FROM `battle_end` WHERE `time`< "'.$temptime.'"');
//mysql_query('OPTIMIZE TABLE `battle_end`');
mysql_query('DELETE FROM `battle_last` WHERE `time`< "'.$temptime.'"');
//mysql_query('OPTIMIZE TABLE `battle_last`');
mysql_query('DELETE FROM `battle_out` WHERE `time` < "'.$temptime.'"');
//mysql_query('OPTIMIZE TABLE `battle_out`');
mysql_query('DELETE FROM `battle_stat` WHERE `time` < "'.$temptimeñ.'"');
//mysql_query('OPTIMIZE TABLE `battle_stat`');
mysql_query('DELETE FROM `battle_users` WHERE `time_enter` < "'.$temptime.'" AND `time_enter` !=0 ');
//mysql_query('OPTIMIZE TABLE `battle_users`');
mysql_query('DELETE FROM `battle` WHERE `time_over` < "'.$temptime.'" AND `time_over` !=0');
//mysql_query('OPTIMIZE TABLE `battle`');
mysql_query('DELETE FROM `battle_logs` WHERE `time` < "'.$temptime.'"');
//mysql_query('OPTIMIZE TABLE `battle_logs`');
mysql_query('DELETE FROM `battle_logs_save` WHERE `time` < "'.$temptime.'"');
//mysql_query('OPTIMIZE TABLE `battle_logs_save`');
// mysql_query('DELETE FROM `zayvki` WHERE `time` < "'.$temptime.'"');
//mysql_query('OPTIMIZE TABLE `zayvki`');
?>