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
|
|
@ -46,55 +46,21 @@ if (preg_match("/u/",$server_home['access_rights']))
|
|||
$master_server_home_id = FALSE;
|
||||
}
|
||||
}
|
||||
// In case game is compatible with steam we offer a way to use steam with the updates.
|
||||
if( $server_xml->installer == "steamcmd" )
|
||||
{
|
||||
if( $master_server_home_id != FALSE AND $master_server_home_id != $server_home['home_id'] )
|
||||
{
|
||||
$module_buttons[] = "<a class='monitorbutton' href='?m=gamemanager&p=update&home_id=".$server_home['home_id']."&mod_id=".$server_home['mod_id']."&master_server_home_id=".$master_server_home_id."&update=update'>
|
||||
<img src='" . check_theme_image("images/master.png") . "' title='". get_lang("update_from_local_master_server") ."'>
|
||||
<span>". get_lang("update_from_local_master_server") ."</span>
|
||||
</a>";
|
||||
}
|
||||
|
||||
//$module_buttons[] = "<a class='monitorbutton' href='?m=gamemanager&p=update&home_id=".$server_home['home_id']."&mod_id=".$server_home['mod_id']."&update=update'>
|
||||
$module_buttons[] = "<a class='monitorbutton' href='javascript:confirmarUpdateSteam();'>
|
||||
<img src='" . check_theme_image("images/steam.png") ."' title='". get_lang("install_update_manually") ."'>
|
||||
<span>". get_lang("install_update_steam") ."</span>
|
||||
</a>
|
||||
<script>
|
||||
function confirmarUpdateSteam(){
|
||||
if (confirm('If you continue, you will overwrite any configuration files. BACKUP IMPORTANT FILES!')) {
|
||||
window.location.href = '?m=gamemanager&p=update&home_id=".$server_home['home_id']."&mod_id=".$server_home['mod_id']."&update=update';
|
||||
}
|
||||
}
|
||||
</script>";
|
||||
|
||||
$hasSteamAutoUpdate = true;
|
||||
}
|
||||
// In other cases manual update is provided.
|
||||
if( $server_xml->installer == "manual" )
|
||||
|
||||
// Master-server copy update (available regardless of installer type).
|
||||
if( $master_server_home_id != FALSE AND $master_server_home_id != $server_home['home_id'] )
|
||||
{
|
||||
$module_buttons[] = "<a class='monitorbutton' href='?m=gamemanager&p=update_manual&home_id=".$server_home['home_id']."&mod_id=".$server_home['mod_id']."&update=update'>
|
||||
<img src='" . check_theme_image("images/install.png") . "' title='". get_lang("install_update_manual") ."'>
|
||||
<span>". get_lang("install_update_manual") ."</span>
|
||||
$module_buttons[] = "<a class='monitorbutton' href='?m=gamemanager&p=update&home_id=".$server_home['home_id']."&mod_id=".$server_home['mod_id']."&master_server_home_id=".$master_server_home_id."&update=update'>
|
||||
<img src='" . check_theme_image("images/master.png") . "' title='". get_lang("update_from_local_master_server") ."'>
|
||||
<span>". get_lang("update_from_local_master_server") ."</span>
|
||||
</a>";
|
||||
}
|
||||
|
||||
// In other cases rsync update is provided.
|
||||
if( $server_xml->installer == "rsync" )
|
||||
{
|
||||
$sync_name = $server_xml->game_key;
|
||||
$sync_list = @file("modules/gamemanager/rsync.list", FILE_IGNORE_NEW_LINES);
|
||||
if ( (is_array($sync_list) && in_array($sync_name, $sync_list)) OR ($master_server_home_id != FALSE and $master_server_home_id != $server_home['home_id']) )
|
||||
{
|
||||
$module_buttons[] = "<a class='monitorbutton' href='?m=gamemanager&p=rsync_install&home_id=".$server_home['home_id']."&mod_id=".$server_home['mod_id']."&update=update'>
|
||||
<img src='" . check_theme_image("images/rsync.png") . "' title='". rsync_install ."'>
|
||||
<span>". get_lang("rsync_install") ."</span>
|
||||
</a>";
|
||||
}
|
||||
}
|
||||
// Update button — runs SteamCMD (validate) for steam games, or install scripts for others.
|
||||
$module_buttons[] = "<a class='monitorbutton' href='?m=gamemanager&p=update&home_id=".$server_home['home_id']."&mod_id=".$server_home['mod_id']."&update=update'>
|
||||
<img src='" . check_theme_image("images/steam.png") ."' title='". get_lang("update_server") ."'>
|
||||
<span>". get_lang("update_server") ."</span>
|
||||
</a>";
|
||||
$hasSteamAutoUpdate = true;
|
||||
/*
|
||||
|
||||
$module_buttons[] = "<a class='monitorbutton getAPILinks' hassteam='" . ($hasSteamAutoUpdate ? 'true' : 'false') . "' hasrcon='" . ($server_xml->control_protocol || ($server_xml->lgsl_query_name and $server_xml->lgsl_query_name == "7dtd") || ($server_xml->gameq_query_name and $server_xml->gameq_query_name == "minecraft") ? 'true' : 'false') . "' copyfail='" . get_lang("auto_update_copy_me_fail") . "' copysuccess='" . get_lang("auto_update_copy_me_success") . "' autoupdatetext='" . get_lang("auto_update_title_popup") . "' copyme='" . get_lang("auto_update_copy_me") . "' token='".$db->getApiToken($_SESSION['user_id'])."' ip='".$server_home['ip']."' port='".$server_home['port']."' modkey='".$server_home['mod_key']."' panelurl='" . getOGPSiteURL() . "'>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue