Panel/modules/steam_workshop/main.php
copilot-swe-agent[bot] 8eff063a93
feat: add database-driven Steam Workshop system
- Create 3 new DB tables: workshop_game_profiles, workshop_cache, server_workshop_mods
- Add WorkshopRepository (DB access layer for all 3 tables)
- Add WorkshopInstaller (rsync/robocopy/custom_script copy logic, SteamCMD download via agent exec)
- Add WorkshopUpdater (scheduled cache update functions grouped by agent)
- Add WorkshopPreStart (pre-start mod sync helper)
- Add WorkshopProfileController (admin CRUD for profiles)
- Add WorkshopModController (user install/remove/toggle/load_order/sync)
- Add admin views: profiles list + profile_form
- Add user views: user_workshop_index + user_workshop_mods
- Add cron_update.php CLI entry point (--all/--agent-id/--home-id/--profile-id/--workshop-id)
- Add prestart_sync.php CLI helper for XML pre_start hook
- Update workshop_admin.php to route to profile management
- Update main.php to route to new mod management (legacy fallback preserved)
- Update module.php with DB migration SQL and version bump to 2.1
- Update lang/en_US.php with all new strings

Agent-Logs-Url: https://github.com/GameServerPanel/GSP/sessions/dbeebd0e-e7a5-469d-8a8c-e63193d1ebb0

Co-authored-by: iaretechnician <2749183+iaretechnician@users.noreply.github.com>
2026-04-30 18:01:33 +00:00

41 lines
1.2 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?php
declare(strict_types=1);
/*
* OGP / GSP Steam Workshop module entrypoint.
* Routes to either the new DB-driven WorkshopModController or the
* legacy SteamWorkshopController, depending on the action requested.
*/
require_once __DIR__ . '/controllers/SteamWorkshopController.php';
require_once __DIR__ . '/controllers/WorkshopModController.php';
function exec_ogp_module(): void
{
global $db;
$action = $_GET['action'] ?? '';
$postAction = $_POST['ws_action'] ?? '';
// JSON search endpoint no heading
if ($action === 'search') {
$controller = new SteamWorkshopController($db);
$controller->handle();
return;
}
echo '<h2>' . get_lang('steam_workshop') . '</h2>';
// New DB-driven actions
$newActions = ['index', 'mods'];
$newPostActions = ['install', 'remove', 'toggle', 'load_order', 'sync'];
if (in_array($action, $newActions, true) || in_array($postAction, $newPostActions, true)) {
$controller = new WorkshopModController($db);
$controller->handle();
return;
}
// Legacy controller for old Workshop page actions
$controller = new SteamWorkshopController($db);
$controller->handle();
}