Skip to content

Commit

Permalink
Update rcon library
Browse files Browse the repository at this point in the history
The xPaw library has been updated and added via composer
  • Loading branch information
SeAnSolovev committed Dec 7, 2023
1 parent 3d2b87a commit 24ccb37
Show file tree
Hide file tree
Showing 17 changed files with 43 additions and 65 deletions.
11 changes: 11 additions & 0 deletions system/library/games/cs/action.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,17 @@ public static function start($id, $type = 'start')
$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.');

Expand Down
8 changes: 2 additions & 6 deletions system/library/games/cs/rcon.php
Original file line number Diff line number Diff line change
Expand Up @@ -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']);
Expand Down
7 changes: 2 additions & 5 deletions system/library/games/cs/scan.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,14 @@

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)
Expand Down
4 changes: 2 additions & 2 deletions system/library/games/cs/service.php
Original file line number Diff line number Diff line change
Expand Up @@ -207,14 +207,14 @@ public static function buy($aData = array())
}
}

$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'], // Время аренды
Expand Down
7 changes: 2 additions & 5 deletions system/library/games/cs2/rcon.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down
7 changes: 2 additions & 5 deletions system/library/games/cs2/scan.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,14 @@

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)
Expand Down
4 changes: 2 additions & 2 deletions system/library/games/cs2/service.php
Original file line number Diff line number Diff line change
Expand Up @@ -208,14 +208,14 @@ public static function buy($aData = array())
}
}

$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'], // Время аренды
Expand Down
8 changes: 2 additions & 6 deletions system/library/games/csgo/rcon.php
Original file line number Diff line number Diff line change
Expand Up @@ -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']);
Expand Down
7 changes: 2 additions & 5 deletions system/library/games/csgo/scan.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,14 @@

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)
Expand Down
4 changes: 2 additions & 2 deletions system/library/games/csgo/service.php
Original file line number Diff line number Diff line change
Expand Up @@ -208,14 +208,14 @@ public static function buy($aData = array())
}
}

$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'], // Время аренды
Expand Down
8 changes: 2 additions & 6 deletions system/library/games/css/rcon.php
Original file line number Diff line number Diff line change
Expand Up @@ -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']);
Expand Down
7 changes: 2 additions & 5 deletions system/library/games/css/scan.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,14 @@

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)
Expand Down
4 changes: 2 additions & 2 deletions system/library/games/css/service.php
Original file line number Diff line number Diff line change
Expand Up @@ -208,14 +208,14 @@ public static function buy($aData = array())
}
}

$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'], // Время аренды
Expand Down
8 changes: 2 additions & 6 deletions system/library/games/cssold/rcon.php
Original file line number Diff line number Diff line change
Expand Up @@ -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']);
Expand Down
7 changes: 2 additions & 5 deletions system/library/games/cssold/scan.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,14 @@

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)
Expand Down
4 changes: 2 additions & 2 deletions system/library/games/cssold/service.php
Original file line number Diff line number Diff line change
Expand Up @@ -215,14 +215,14 @@ public static function buy($aData = array())
}
}

$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'], // Выбранная сборка для установки
Expand Down
3 changes: 2 additions & 1 deletion system/library/system.php
Original file line number Diff line number Diff line change
Expand Up @@ -1151,8 +1151,9 @@ public static function reset_mcache($nmch, $id, $data = array(), $ctrl = false)

$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);

Expand Down

0 comments on commit 24ccb37

Please sign in to comment.