- 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>
41 lines
1.2 KiB
PHP
41 lines
1.2 KiB
PHP
<?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();
|
||
}
|
||
|