feat: remove legacy rsync/manual install methods, standardize SteamCMD pipeline, fix Update button
Agent-Logs-Url: https://github.com/GameServerPanel/GSP/sessions/9c87b62e-17b2-4f36-9b49-82238d73dda2 Co-authored-by: iaretechnician <2749183+iaretechnician@users.noreply.github.com>
This commit is contained in:
parent
43877bbd9e
commit
75e63475ae
17 changed files with 56 additions and 1000 deletions
|
|
@ -297,55 +297,6 @@ function send_rcon_command($command, $remote, $server_xml, $home_info, $home_id,
|
|||
}
|
||||
}
|
||||
|
||||
function test_rsync_response($address)
|
||||
{
|
||||
$starttime = microtime(true);
|
||||
$fp = fsockopen($address, 873, $errno, $errstr, 3);
|
||||
$stoptime = microtime(true);
|
||||
if (!$fp) {
|
||||
return FALSE;
|
||||
}
|
||||
else
|
||||
{
|
||||
$out = "Connection: Close\r\n\r\n";
|
||||
fwrite($fp, $out);
|
||||
$response = "";
|
||||
while (!feof($fp)) {
|
||||
$response .= fgets($fp, 128);
|
||||
}
|
||||
fclose($fp);
|
||||
if(strstr($response,"@RSYNCD"))
|
||||
{
|
||||
$response_time = ($stoptime - $starttime);
|
||||
return $response_time;
|
||||
}
|
||||
else
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
function get_faster_rsync($rsync_sites)
|
||||
{
|
||||
$faster = "NONE";
|
||||
foreach ((array)$rsync_sites as $site)
|
||||
{
|
||||
list($url,$name) = explode('|', $site);
|
||||
$current_time = test_rsync_response($url);
|
||||
if($response_time !== FALSE)
|
||||
{
|
||||
if(!isset($previous_time))
|
||||
$faster = $url;
|
||||
if($previous_time > $current_time)
|
||||
$faster = $url;
|
||||
$previous_time = $current_time;
|
||||
}
|
||||
}
|
||||
|
||||
if($faster == "NONE")
|
||||
$faster = "rsync.opengamepanel.org";
|
||||
return $faster;
|
||||
}
|
||||
|
||||
function get_download_filename($url)
|
||||
{
|
||||
if(empty($url) or !filter_var($url, FILTER_VALIDATE_URL))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue