diff --git a/modules/steam_workshop/lang/en_US.php b/modules/steam_workshop/lang/en_US.php index bb780ef0..3e5e28e5 100644 --- a/modules/steam_workshop/lang/en_US.php +++ b/modules/steam_workshop/lang/en_US.php @@ -226,7 +226,7 @@ return [ 'profile_hint_steamcmd_path' => 'Full path to steamcmd.sh on the remote agent. Leave blank to use the agent default (/home/gameserver/steamcmd/steamcmd.sh).', 'profile_label_steam_login_required'=> 'Steam login required (game is not free / requires ownership)', 'profile_label_steamcmd_login_mode' => 'SteamCMD login mode', - 'profile_hint_steamcmd_login_mode' => 'Use anonymous for free Workshop mods. Use configured account for games requiring ownership.', + 'profile_hint_steamcmd_login_mode' => 'Use anonymous for free Workshop mods. Configured account mode stores the intent; full credential injection requires panel-level Steam account configuration (see admin docs).', 'profile_label_os' => 'Supported OS', 'profile_label_cache_path' => 'Workshop download/cache path', 'profile_hint_cache_path' => 'Where SteamCMD stores downloaded mod content on the agent. E.g. /home/gameserver/steamcmd/steamapps/workshop/content/%workshop_app_id%/%workshop_id%', diff --git a/modules/steam_workshop/lib/WorkshopInstaller.php b/modules/steam_workshop/lib/WorkshopInstaller.php index 4aef44ee..b9dc0481 100644 --- a/modules/steam_workshop/lib/WorkshopInstaller.php +++ b/modules/steam_workshop/lib/WorkshopInstaller.php @@ -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) ?? ''; diff --git a/modules/steam_workshop/lib/WorkshopRepository.php b/modules/steam_workshop/lib/WorkshopRepository.php index f5cc60b4..1940426d 100644 --- a/modules/steam_workshop/lib/WorkshopRepository.php +++ b/modules/steam_workshop/lib/WorkshopRepository.php @@ -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. diff --git a/modules/steam_workshop/module.php b/modules/steam_workshop/module.php index 423b3919..4e666c23 100644 --- a/modules/steam_workshop/module.php +++ b/modules/steam_workshop/module.php @@ -29,8 +29,11 @@ $module_required = TRUE; $module_menus = array(); // ----------------------------------------------------------------------- -// $install_queries[0] – run during FRESH install (all keys executed). -// $install_queries[2] – run when upgrading an existing v1 install to v2. +// $install_queries[0] – executed for FRESH installs (all keys run). +// Contains the full v2 schema with every column. +// $install_queries[2] – executed when upgrading an existing v1 install +// to v2 (ALTER TABLE + new settings table). +// $db_version = 2 (v1 = original release; v2 = this rewrite). // ----------------------------------------------------------------------- $install_queries = array(); diff --git a/modules/steam_workshop/views/admin/profile_form.php b/modules/steam_workshop/views/admin/profile_form.php index f74e59c6..7aced66d 100644 --- a/modules/steam_workshop/views/admin/profile_form.php +++ b/modules/steam_workshop/views/admin/profile_form.php @@ -20,7 +20,7 @@ $folderFormats = ['@%mod_name%' => '@%mod_name% (mod title)', '@%workshop_id%' $curFolderFormat = (string)($profile['folder_naming_format'] ?? '@%workshop_id%'); $separatorList = ['semicolon' => 'Semicolon ( ; )', 'comma' => 'Comma ( , )', 'space' => 'Space ( )']; $curSeparator = (string)($profile['mod_separator'] ?? 'semicolon'); -$copyMethods = ['rsync' => 'rsync (Linux/Unix)', 'copy' => 'cp / basic copy', 'symlink' => 'Symlink']; +$copyMethods = ['rsync' => 'rsync (Linux/Unix)', 'copy' => 'cp / basic copy', 'symlink' => 'Symlink (requires persistent cache path)']; $curCopyMethod = (string)($profile['copy_method'] ?? 'rsync'); $loginModes = ['anonymous' => 'Anonymous (recommended for free mods)', 'account' => 'Configured account (paid games)']; $curLoginMode = (string)($profile['steamcmd_login_mode'] ?? 'anonymous'); diff --git a/modules/steam_workshop/views/user_workshop_mods.php b/modules/steam_workshop/views/user_workshop_mods.php index 8587b372..92ca061c 100644 --- a/modules/steam_workshop/views/user_workshop_mods.php +++ b/modules/steam_workshop/views/user_workshop_mods.php @@ -287,8 +287,8 @@ $statusClass = match($lastStatus) { $lang['mod_picker_action_add'] ?? 'Add', 'remove' => $lang['mod_picker_action_remove'] ?? 'Remove',