mirror of
https://github.com/Deathgarden-Rebirth/Deathgarden_Rebirth-Rewrite.git
synced 2026-12-05 08:44:59 -06:00
Replace the manually set launcher version with releases uploaded from the
CI zip (exes, launcher-manifest.json and launcher-manifest.json.sig).
- New "Launcher" admin tool (renamed from Launcher Message): upload a
release, switch the current one, delete old ones, set the launcher message
- Uploads are validated: manifest rules, size + SHA-256 of every exe, and
the ECDSA manifest signature when LAUNCHER_UPDATE_PUBLIC_KEYS is set
- The same zip, manifest or version cannot be published twice; only the
newest 5 releases are kept and the current one is never removed
- Serve the current release to the launcher at /launcher/{file},
byte-for-byte and uncached, with range support for resumed downloads
- /download-launcher serves the newest framework build; the legacy
/api/v1/launcher-version returns the current release version
- Remove the launcher version from the Versioning tool
- Fix the file input button highlighting when hovering the whole input
94 lines
3.4 KiB
PHP
94 lines
3.4 KiB
PHP
<?php
|
|
|
|
namespace App\Http\Controllers\Web\Homepage;
|
|
|
|
use App\Enums\Launcher\FileAction;
|
|
use App\Enums\Launcher\Patchline;
|
|
use App\Http\Controllers\Controller;
|
|
use App\Models\Admin\LauncherRelease;
|
|
use App\Models\GameFile;
|
|
use Illuminate\Contracts\View\Factory;
|
|
use Illuminate\Contracts\View\View;
|
|
use Illuminate\Foundation\Application;
|
|
use Illuminate\Support\Facades\Response;
|
|
use Illuminate\Support\Facades\View as CompView;
|
|
use Symfony\Component\HttpFoundation\BinaryFileResponse;
|
|
|
|
class HomepageController extends Controller
|
|
{
|
|
public function index(): Factory|Application|View|\Illuminate\Contracts\Foundation\Application
|
|
{
|
|
CompView::share('metaDescription', 'After five years, the game has been brought back to life by the
|
|
community and is now playable again, featuring new balance changes for an improved
|
|
experience.');
|
|
CompView::share('metaKeywords', ['Deathgarden', 'Rebirth']);
|
|
|
|
return view('web.home');
|
|
}
|
|
|
|
public function download(): Factory|Application|View|\Illuminate\Contracts\Foundation\Application
|
|
{
|
|
$files = GameFile::wherePatchline(Patchline::LIVE)
|
|
->whereAction(FileAction::ADD)
|
|
->get();
|
|
|
|
static::setTitle('Deathgarden: Rebirth | Download');
|
|
CompView::share('metaKeywords', ['Deathgarden', 'Rebirth', 'Download', 'Launcher']);
|
|
CompView::share('metaDescription', 'Download the official Deathgarden: Rebirth launcher to easily install and update the Deathgarden: Rebirth mod.');
|
|
|
|
return view('web.download', ['files' => $files]);
|
|
}
|
|
|
|
public function downloadLauncher(): BinaryFileResponse
|
|
{
|
|
$release = LauncherRelease::current() ?? abort(404);
|
|
$path = $release->servableFilePath($release->downloadBuild()['file'] ?? '') ?? abort(404);
|
|
|
|
return Response::download($path, "Deathgarden Launcher_{$release->version}.exe", [
|
|
'Cache-Control' => 'no-cache, no-store, must-revalidate',
|
|
]);
|
|
}
|
|
|
|
public function patchNotes(): Factory|Application|View|\Illuminate\Contracts\Foundation\Application
|
|
{
|
|
static::setTitle('Deathgarden: Rebirth | Patch Notes');
|
|
CompView::share('metaKeywords', ['Deathgarden', 'Rebirth', 'patch', 'patchnnotes', 'patch notes']);
|
|
CompView::share('metaDescription', 'Stay up to date with all the changes, improvements, and updates in Deathgarden: Rebirth. Below is a complete archive of every patch since the mods release.');
|
|
|
|
return view('web.patch-notes');
|
|
}
|
|
|
|
public function howToPlay(): Factory|Application|View|\Illuminate\Contracts\Foundation\Application
|
|
{
|
|
static::setTitle('Deathgarden: Rebirth | How to Play');
|
|
|
|
return view('web.how-to-play');
|
|
}
|
|
|
|
public function knownIssues(): Factory|Application|View|\Illuminate\Contracts\Foundation\Application
|
|
{
|
|
static::setTitle('Deathgarden: Rebirth | Known Issues');
|
|
|
|
return view('web.known-issues');
|
|
}
|
|
|
|
public function eula(): Factory|Application|View|\Illuminate\Contracts\Foundation\Application
|
|
{
|
|
static::setTitle('Deathgarden: Rebirth | End User License Agreement');
|
|
|
|
return view('web.eula');
|
|
}
|
|
|
|
public function credits(): Factory|Application|View|\Illuminate\Contracts\Foundation\Application
|
|
{
|
|
static::setTitle('Deathgarden: Rebirth | Credits');
|
|
|
|
return view('web.credits');
|
|
}
|
|
|
|
protected static function setTitle(string $title)
|
|
{
|
|
CompView::share('title', $title);
|
|
}
|
|
}
|