- 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>
31 lines
1 KiB
PHP
31 lines
1 KiB
PHP
<?php
|
|
declare(strict_types=1);
|
|
|
|
require_once __DIR__ . '/controllers/AdminWorkshopController.php';
|
|
require_once __DIR__ . '/controllers/WorkshopProfileController.php';
|
|
|
|
function exec_ogp_module(): void
|
|
{
|
|
global $db;
|
|
echo '<h2>' . get_lang('steam_workshop') . '</h2>';
|
|
|
|
// Route to the DB-driven profile manager when requested
|
|
$swAction = $_GET['sw_action'] ?? '';
|
|
$profileActions = ['profiles', 'profile_form'];
|
|
$postAction = $_POST['sw_action'] ?? '';
|
|
$profilePostActions = ['profile_save', 'profile_delete'];
|
|
|
|
if (in_array($swAction, $profileActions, true) || in_array($postAction, $profilePostActions, true)) {
|
|
$controller = new WorkshopProfileController($db);
|
|
$controller->handle();
|
|
return;
|
|
}
|
|
|
|
// Default: legacy XML adapter manager + tab link to profiles
|
|
echo '<p><a class="btn secondary" href="?m=steam_workshop&p=workshop_admin&sw_action=profiles">'
|
|
. (function_exists('get_lang') ? get_lang('nav_workshop_profiles') : 'Workshop Profiles')
|
|
. '</a></p>';
|
|
|
|
$controller = new AdminWorkshopController($db);
|
|
$controller->handle();
|
|
}
|