EngineGP/system/library/cron.php
Sergei Solovev 276ec7f3eb Updating the server name reference in code
This change replaces the use of $_SERVER['SERVER_NAME'] with $_SERVER['HTTP_HOST'] throughout the codebase. The modification ensures consistency and compliance with best practices, since $_SERVER['HTTP_HOST'] is often used to extract the host header from an HTTP request. This update may improve compatibility and security, especially in scenarios where the Host header plays a key role in proper server configuration and routing. Please review and test the changes carefully to ensure smooth functionality in different environments.
2023-12-23 04:50:14 +03:00

80 lines
1.8 KiB
PHP

<?php
if (!DEFINED('EGP'))
exit(header('Refresh: 0; URL=http://' . $_SERVER['HTTP_HOST'] . '/404'));
print_r($task);
// Подгрузка трейта
if (!file_exists(CRON . $task . '.php'))
exit('error method');
$device = '!mobile';
$user = array('id' => 0, 'group' => 'admin');
class cron
{
public static $seping = 5;
public static $process = array(
'cs' => 'hlds_',
'cssold' => 'srcds_i686',
'css' => 'srcds_',
'csgo' => 'srcds_',
'cs2' => 'cs2',
'cs2' => 'RustDedicated',
'samp' => 'samp',
'crmp' => 'samp',
'mta' => 'mta',
'mc' => 'java'
);
public static $quakestat = array(
'cs' => 'a2s',
'cssold' => 'a2s',
'css' => 'a2s',
'csgo' => 'a2s',
'cs2' => 'a2s',
'rust' => 'a2s',
'mta' => 'eye'
);
public static $admins_file = array(
'cs' => 'cstrike/addons/amxmodx/configs/users.ini',
'cssold' => 'cstrike/addons/sourcemod/configs/admins_simple.ini',
'css' => 'cstrike/addons/sourcemod/configs/admins_simple.ini',
'csgo' => 'csgo/addons/sourcemod/configs/admins_simple.ini',
'cs2' => 'csgo/addons/sourcemod/configs/admins_simple.ini'
);
public static function thread($num, $type, $aData)
{
$threads = array();
for ($n = 1; $n <= $num; $n += 1) {
$data = '';
$i = 0;
foreach ($aData as $key => $val) {
if ($i == cron::$seping)
break;
$data .= $val . ' ';
unset($aData[$key]);
$i += 1;
}
$aData = array_values($aData);
$threads[] = $type . ' ' . substr($data, 0, -1);
}
return $threads;
}
}
include(CRON . $task . '.php');
new $task();
?>