Update rcon library

The xPaw library has been updated and added via composer
This commit is contained in:
Sergei Solovev 2023-12-07 22:08:55 +03:00
parent 3d2b87a35b
commit 24ccb37caf
17 changed files with 43 additions and 65 deletions

View file

@ -40,6 +40,17 @@ class action extends actions
$proc_stat[0] = $ssh->get('cat /proc/stat');
}
// Проверка наличия steamclient.so
$checkLinkCommand = 'ls ' . $tarif['install'] . $server['uid'] . '/.steam/sdk32/steamclient.so';
$checkLinkOutput = $ssh->get($checkLinkCommand);
if (strpos($checkLinkOutput, 'steamclient.so') === false) {
// Символическая ссылка отсутствует, создаем ее
$createLinkCommand ='mkdir -p ' . $tarif['install'] . $server['uid'] . '/.steam/sdk32/' . ';'
. 'ln -s /path/cmd/linux32/steamclient.so ' . $tarif['install'] . $server['uid'] . '/.steam/sdk32/';
$ssh->get($createLinkCommand);
}
// Проверка наличия стартовой карты
$ssh->set('cd ' . $tarif['install'] . $server['uid'] . '/cstrike/maps/ && ls | grep .bsp | grep -v .bsp.');

View file

@ -2,16 +2,12 @@
if (!DEFINED('EGP'))
exit(header('Refresh: 0; URL=http://' . $_SERVER['SERVER_NAME'] . '/404'));
use xPaw\SourceQuery\SourceQuery;
class rcon
{
public static function cmd($server, $cmd = 'status')
{
include(LIB . 'games/query/Buffer.php');
include(LIB . 'games/query/BaseSocket.php');
include(LIB . 'games/query/Socket.php');
include(LIB . 'games/query/GoldSourceRcon.php');
include(LIB . 'games/query/SourceQuery.php');
$sq = new SourceQuery();
list($ip, $port) = explode(':', $server['address']);

View file

@ -4,17 +4,14 @@ if (!DEFINED('EGP'))
include(LIB . 'games/scans.php');
use xPaw\SourceQuery\SourceQuery;
class scan extends scans
{
public static function mon($id, $players_get = false)
{
global $cfg, $sql, $html, $mcache;
include(LIB . 'games/query/Buffer.php');
include(LIB . 'games/query/BaseSocket.php');
include(LIB . 'games/query/Socket.php');
include(LIB . 'games/query/SourceQuery.php');
$sq = new SourceQuery();
if ($players_get)

View file

@ -207,14 +207,14 @@ class service
}
}
$ram = $tarif['param_fix'] ? $aData['ram'] : $cfg['ram']['cs'] * $aSDATA['slots'];
$ram = isset($tarif['param_fix']) ? $aData['ram'] : $cfg['ram']['cs'] * $aData['slots'];
// Массив данных
$aSDATA = array(
'unit' => $aData['unit'], // идентификатор локации
'tarif' => $aData['tarif'], // идентификатор тарифа
'ram' => $ram, // значение ram
'param_fix' => $tarif['param_fix'], // фиксированные параметры
'param_fix' => isset($tarif['param_fix']), // фиксированные параметры
'fps' => $aData['fps'], // значение fps
'pack' => $aData['pack'], // Выбранная сборка для установки
'time' => $aData['time'], // Время аренды

View file

@ -2,15 +2,12 @@
if (!DEFINED('EGP'))
exit(header('Refresh: 0; URL=http://' . $_SERVER['SERVER_NAME'] . '/404'));
use xPaw\SourceQuery\SourceQuery;
class rcon
{
public static function cmd($server, $cmd = 'status')
{
include(LIB . 'games/query/Buffer.php');
include(LIB . 'games/query/BaseSocket.php');
include(LIB . 'games/query/Socket.php');
include(LIB . 'games/query/SourceRcon.php');
include(LIB . 'games/query/SourceQuery.php');
$sq = new SourceQuery();

View file

@ -4,17 +4,14 @@ if (!DEFINED('EGP'))
include(LIB . 'games/scans.php');
use xPaw\SourceQuery\SourceQuery;
class scan extends scans
{
public static function mon($id, $players_get = false)
{
global $cfg, $sql, $html, $mcache;
include(LIB . 'games/query/Buffer.php');
include(LIB . 'games/query/BaseSocket.php');
include(LIB . 'games/query/Socket.php');
include(LIB . 'games/query/SourceQuery.php');
$sq = new SourceQuery();
if ($players_get)

View file

@ -208,14 +208,14 @@ class service
}
}
$ram = $tarif['param_fix'] ? $aData['ram'] : $cfg['ram']['cs2'] * $aSDATA['slots'];
$ram = isset($tarif['param_fix']) ? $aData['ram'] : $cfg['ram']['cs2'] * $aData['slots'];
// Массив данных
$aSDATA = array(
'unit' => $aData['unit'], // идентификатор локации
'tarif' => $aData['tarif'], // идентификатор тарифа
'ram' => $ram, // значение ram
'param_fix' => $tarif['param_fix'], // фиксированные параметры
'param_fix' => isset($tarif['param_fix']), // фиксированные параметры
'tickrate' => $aData['tickrate'], // значение tickrate
'pack' => $aData['pack'], // Выбранная сборка для установки
'time' => $aData['time'], // Время аренды

View file

@ -2,16 +2,12 @@
if (!DEFINED('EGP'))
exit(header('Refresh: 0; URL=http://' . $_SERVER['SERVER_NAME'] . '/404'));
use xPaw\SourceQuery\SourceQuery;
class rcon
{
public static function cmd($server, $cmd = 'status')
{
include(LIB . 'games/query/Buffer.php');
include(LIB . 'games/query/BaseSocket.php');
include(LIB . 'games/query/Socket.php');
include(LIB . 'games/query/SourceRcon.php');
include(LIB . 'games/query/SourceQuery.php');
$sq = new SourceQuery();
list($ip, $port) = explode(':', $server['address']);

View file

@ -4,17 +4,14 @@ if (!DEFINED('EGP'))
include(LIB . 'games/scans.php');
use xPaw\SourceQuery\SourceQuery;
class scan extends scans
{
public static function mon($id, $players_get = false)
{
global $cfg, $sql, $html, $mcache;
include(LIB . 'games/query/Buffer.php');
include(LIB . 'games/query/BaseSocket.php');
include(LIB . 'games/query/Socket.php');
include(LIB . 'games/query/SourceQuery.php');
$sq = new SourceQuery();
if ($players_get)

View file

@ -208,14 +208,14 @@ class service
}
}
$ram = $tarif['param_fix'] ? $aData['ram'] : $cfg['ram']['csgo'] * $aSDATA['slots'];
$ram = isset($tarif['param_fix']) ? $aData['ram'] : $cfg['ram']['csgo'] * $aData['slots'];
// Массив данных
$aSDATA = array(
'unit' => $aData['unit'], // идентификатор локации
'tarif' => $aData['tarif'], // идентификатор тарифа
'ram' => $ram, // значение ram
'param_fix' => $tarif['param_fix'], // фиксированные параметры
'param_fix' => isset($tarif['param_fix']), // фиксированные параметры
'tickrate' => $aData['tickrate'], // значение tickrate
'pack' => $aData['pack'], // Выбранная сборка для установки
'time' => $aData['time'], // Время аренды

View file

@ -2,16 +2,12 @@
if (!DEFINED('EGP'))
exit(header('Refresh: 0; URL=http://' . $_SERVER['SERVER_NAME'] . '/404'));
use xPaw\SourceQuery\SourceQuery;
class rcon
{
public static function cmd($server, $cmd = 'status')
{
include(LIB . 'games/query/Buffer.php');
include(LIB . 'games/query/BaseSocket.php');
include(LIB . 'games/query/Socket.php');
include(LIB . 'games/query/SourceRcon.php');
include(LIB . 'games/query/SourceQuery.php');
$sq = new SourceQuery();
list($ip, $port) = explode(':', $server['address']);

View file

@ -4,17 +4,14 @@ if (!DEFINED('EGP'))
include(LIB . 'games/scans.php');
use xPaw\SourceQuery\SourceQuery;
class scan extends scans
{
public static function mon($id, $players_get = false)
{
global $cfg, $sql, $html, $mcache;
include(LIB . 'games/query/Buffer.php');
include(LIB . 'games/query/BaseSocket.php');
include(LIB . 'games/query/Socket.php');
include(LIB . 'games/query/SourceQuery.php');
$sq = new SourceQuery();
if ($players_get)

View file

@ -208,14 +208,14 @@ class service
}
}
$ram = $tarif['param_fix'] ? $aData['ram'] : $cfg['ram']['css'] * $aSDATA['slots'];
$ram = isset($tarif['param_fix']) ? $aData['ram'] : $cfg['ram']['css'] * $aData['slots'];
// Массив данных
$aSDATA = array(
'unit' => $aData['unit'], // идентификатор локации
'tarif' => $aData['tarif'], // идентификатор тарифа
'ram' => $ram, // значение ram
'param_fix' => $tarif['param_fix'], // фиксированные параметры
'param_fix' => isset($tarif['param_fix']), // фиксированные параметры
'tickrate' => $aData['tickrate'], // значение tickrate
'pack' => $aData['pack'], // Выбранная сборка для установки
'time' => $aData['time'], // Время аренды

View file

@ -2,16 +2,12 @@
if (!DEFINED('EGP'))
exit(header('Refresh: 0; URL=http://' . $_SERVER['SERVER_NAME'] . '/404'));
use xPaw\SourceQuery\SourceQuery;
class rcon
{
public static function cmd($server, $cmd = 'status')
{
include(LIB . 'games/query/Buffer.php');
include(LIB . 'games/query/BaseSocket.php');
include(LIB . 'games/query/Socket.php');
include(LIB . 'games/query/SourceRcon.php');
include(LIB . 'games/query/SourceQuery.php');
$sq = new SourceQuery();
list($ip, $port) = explode(':', $server['address']);

View file

@ -4,17 +4,14 @@ if (!DEFINED('EGP'))
include(LIB . 'games/scans.php');
use xPaw\SourceQuery\SourceQuery;
class scan extends scans
{
public static function mon($id, $players_get = false)
{
global $cfg, $sql, $html, $mcache;
include(LIB . 'games/query/Buffer.php');
include(LIB . 'games/query/BaseSocket.php');
include(LIB . 'games/query/Socket.php');
include(LIB . 'games/query/SourceQuery.php');
$sq = new SourceQuery();
if ($players_get)

View file

@ -215,14 +215,14 @@ class service
}
}
$ram = $tarif['param_fix'] ? $aData['ram'] : $cfg['ram']['cssold'] * $aSDATA['slots'];
$ram = isset($tarif['param_fix']) ? $aData['ram'] : $cfg['ram']['cssold'] * $aData['slots'];
// Массив данных
$aSDATA = array(
'unit' => $aData['unit'], // идентификатор локации
'tarif' => $aData['tarif'], // идентификатор тарифа
'ram' => $ram, // значение ram
'param_fix' => $tarif['param_fix'], // фиксированные параметры
'param_fix' => isset($tarif['param_fix']), // фиксированные параметры
'tickrate' => $aData['tickrate'], // значение tickrate
'fps' => $aData['fps'], // значение fps
'pack' => $aData['pack'], // Выбранная сборка для установки

View file

@ -1151,8 +1151,9 @@ class sys
$cache = $ctrl ? sys::buttons($id, $data['status'], $data['game'], $ctrl) : sys::buttons($id, $data['status'], $data['game']);
if (isset($data['players']))
if (isset($data['players']) && is_array($data['players'])) {
$cache['players'] = $data['players'];
}
$mcache->set($nmch, $cache, false, 5);