+ */
+ public function listAvailableGameKeys(): array
+ {
+ $keys = [];
+ $configDir = defined('SERVER_CONFIG_LOCATION') ? SERVER_CONFIG_LOCATION : __DIR__ . '/../../config_games/server_configs';
+ foreach (glob($configDir . '/*.xml') as $file) {
+ $xml = @simplexml_load_file($file);
+ if ($xml === false) {
+ continue;
+ }
+ if (isset($xml->game_key)) {
+ $keys[] = trim((string)$xml->game_key);
+ }
+ }
+
+ $keys = array_filter(array_unique($keys));
+ sort($keys);
+ return array_values($keys);
+ }
+
private function sanitizeInterval(?int $minutes): int
{
if ($minutes === null || $minutes <= 0) {
@@ -387,4 +474,16 @@ class SteamWorkshopService
'last_saved_at' => null,
];
}
+
+ private function ensureDataFiles(): void
+ {
+ $dir = dirname($this->adapterMapFile);
+ if (!is_dir($dir)) {
+ mkdir($dir, 0775, true);
+ }
+
+ if (!is_file($this->adapterMapFile)) {
+ file_put_contents($this->adapterMapFile, json_encode([]));
+ }
+ }
}
diff --git a/modules/steam_workshop/views/admin/index.php b/modules/steam_workshop/views/admin/index.php
new file mode 100644
index 00000000..a45849fb
--- /dev/null
+++ b/modules/steam_workshop/views/admin/index.php
@@ -0,0 +1,75 @@
+
+
+
+
+
+
+
+
+
+
+
+ |
+ |
+ Steam App ID |
+ |
+ |
+ |
+
+
+
+
+
+ |
+ |
+ |
+ |
+ |
+ |
+
+
+
+
+
diff --git a/modules/steam_workshop/views/partials/form_fields.php b/modules/steam_workshop/views/partials/form_fields.php
index 5c9c1c76..0b0539c0 100644
--- a/modules/steam_workshop/views/partials/form_fields.php
+++ b/modules/steam_workshop/views/partials/form_fields.php
@@ -3,6 +3,7 @@ declare(strict_types=1);
/** @var array $formConfig */
/** @var array $adapterOptions */
/** @var array $lang */
+/** @var bool $adapterLocked */
$enabled = !empty($formConfig['workshop_enabled']);
$interval = (int)$formConfig['update_interval_minutes'];
$stagingDir = htmlspecialchars($formConfig['staging_dir']);
@@ -10,6 +11,7 @@ $postInstall = htmlspecialchars($formConfig['post_install_script']);
$rawDefinition = htmlspecialchars($formConfig['raw_definition']);
$installStrategy = $formConfig['install_strategy'];
$onUpdateAction = $formConfig['on_update_action'];
+$currentAdapterName = $adapterOptions[$formConfig['adapter_key']] ?? strtoupper($formConfig['adapter_key']);
?>