fix(steam_workshop): address code review feedback
- WorkshopInstaller: rename cachePath/installPath params to sourcePath/targetPath in checkNeedsSync; replace account_placeholder with TODO comment explaining feature is pending - WorkshopRepository: remove duplicate docblock on insertOrUpdateMod - module.php: improve install_queries version comments - user_workshop_mods.php: rename $scriptPath to $requestPath - profile_form.php: add symlink limitation note to copy method dropdown - lang/en_US.php: update steamcmd login mode hint to reflect account mode status" Agent-Logs-Url: https://github.com/GameServerPanel/GSP/sessions/e7f0d80d-f775-4794-adbd-cf48b55bc9c1 Co-authored-by: iaretechnician <2749183+iaretechnician@users.noreply.github.com>
This commit is contained in:
parent
69f415ad86
commit
df4f1d1bdc
6 changed files with 20 additions and 16 deletions
|
|
@ -382,7 +382,12 @@ class WorkshopInstaller
|
|||
}
|
||||
|
||||
$loginMode = (string)($profile['steamcmd_login_mode'] ?? 'anonymous');
|
||||
$loginArg = $loginMode === 'account' ? 'account_placeholder' : 'anonymous';
|
||||
// TODO: When login_mode is 'account', replace 'anonymous' with the
|
||||
// configured SteamCMD credentials (username + password) loaded from
|
||||
// a secure panel-side credential store. Until that feature is
|
||||
// implemented, 'account' mode logs in anonymously (which works for
|
||||
// free/publicly-accessible Workshop items).
|
||||
$loginArg = 'anonymous';
|
||||
|
||||
$cmd = implode(' ', [
|
||||
escapeshellarg($steamcmdPath),
|
||||
|
|
@ -422,19 +427,19 @@ class WorkshopInstaller
|
|||
*/
|
||||
private function checkNeedsSync(
|
||||
object $remote,
|
||||
string $cachePath,
|
||||
string $installPath,
|
||||
string $sourcePath,
|
||||
string $targetPath,
|
||||
array $profile,
|
||||
array &$log
|
||||
): bool {
|
||||
$copyMethod = (string)($profile['copy_method'] ?? 'rsync');
|
||||
$log[] = "Pre-start compare: cache={$cachePath} dest={$installPath} method={$copyMethod}";
|
||||
$log[] = "Pre-start compare: source={$sourcePath} target={$targetPath} method={$copyMethod}";
|
||||
|
||||
if ($copyMethod === 'rsync') {
|
||||
$cmd = sprintf(
|
||||
'rsync -rcn --delete %s %s 2>/dev/null; echo "RSYNC_EXIT:$?"',
|
||||
escapeshellarg(rtrim($cachePath, '/') . '/'),
|
||||
escapeshellarg(rtrim($installPath, '/') . '/')
|
||||
escapeshellarg(rtrim($sourcePath, '/') . '/'),
|
||||
escapeshellarg(rtrim($targetPath, '/') . '/')
|
||||
);
|
||||
$out = (string)$remote->exec($cmd);
|
||||
$body = preg_replace('/RSYNC_EXIT:\d+\s*$/', '', $out) ?? '';
|
||||
|
|
|
|||
|
|
@ -314,10 +314,6 @@ class WorkshopRepository
|
|||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Insert a new mod row or update the existing one (upsert by home_id + workshop_id).
|
||||
* Returns the row id.
|
||||
*/
|
||||
/**
|
||||
* Insert (id = 0) or update (id > 0) a Workshop mod entry for a game home.
|
||||
* Returns the row id.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue