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
88 lines
3.7 KiB
PHP
88 lines
3.7 KiB
PHP
<?php
|
|
|
|
namespace App\Http\Controllers\Web\Admin\Tools;
|
|
|
|
use App\Enums\Auth\Permissions;
|
|
use App\Enums\Game\ExperienceEventType;
|
|
use App\Http\Requests\Api\Admin\Tools\SaveCurrencyConfiguration;
|
|
use App\Http\Requests\Api\Admin\Tools\SaveMatchConfigurationRequest;
|
|
use App\Http\Requests\Api\Admin\Tools\SaveMatchmakingConfigurationRequest;
|
|
use App\Models\Admin\CurrencyMultipliers;
|
|
use App\Models\Admin\ExperienceMultipliers;
|
|
use App\Models\Admin\MatchmakingSettings;
|
|
use Session;
|
|
|
|
class MatchConfigurationController extends AdminToolController
|
|
{
|
|
protected static string $name = 'Match Configuration';
|
|
|
|
protected static string $description = 'Manage Events & Game Modes';
|
|
|
|
protected static string $iconComponent = 'icons.globe';
|
|
|
|
protected static Permissions $neededPermission = Permissions::FILE_UPLOAD;
|
|
|
|
public function index()
|
|
{
|
|
return view('admin.tools.match-configuration');
|
|
}
|
|
|
|
public function saveExperience(SaveMatchConfigurationRequest $request)
|
|
{
|
|
$experienceMultipliers = ExperienceMultipliers::get();
|
|
|
|
try {
|
|
$experienceMultipliers->setEventTypeMultiplier(ExperienceEventType::ConstructDefeats, $request->constructDefeatsMultiplier);
|
|
$experienceMultipliers->setEventTypeMultiplier(ExperienceEventType::Downing, $request->downingMultiplier);
|
|
$experienceMultipliers->setEventTypeMultiplier(ExperienceEventType::Drones, $request->dronesMultiplier);
|
|
$experienceMultipliers->setEventTypeMultiplier(ExperienceEventType::Execution, $request->executionMultiplier);
|
|
$experienceMultipliers->setEventTypeMultiplier(ExperienceEventType::GardenFinale, $request->gardenFinaleMultiplier);
|
|
$experienceMultipliers->setEventTypeMultiplier(ExperienceEventType::Hacking, $request->hackingMultiplier);
|
|
$experienceMultipliers->setEventTypeMultiplier(ExperienceEventType::HunterClose, $request->hunterCloseMultiplier);
|
|
$experienceMultipliers->setEventTypeMultiplier(ExperienceEventType::Resources, $request->resourcesMultiplier);
|
|
$experienceMultipliers->setEventTypeMultiplier(ExperienceEventType::TeamActions, $request->teamActionsMultiplier);
|
|
$experienceMultipliers->save();
|
|
|
|
Session::flash('alert-success', 'Configuration saved successfully.');
|
|
} catch (\Exception $e) {
|
|
Session::flash('alert-error', 'Configuration could not be saved, something went wrong: '.$e->getMessage());
|
|
}
|
|
|
|
return back();
|
|
}
|
|
|
|
public function saveCurrency(SaveCurrencyConfiguration $request)
|
|
{
|
|
$currencyMultiplier = CurrencyMultipliers::get();
|
|
|
|
try {
|
|
$currencyMultiplier->currencyA = $request->currencyAMultiplier;
|
|
$currencyMultiplier->currencyB = $request->currencyBMultiplier;
|
|
$currencyMultiplier->currencyC = $request->currencyCMultiplier;
|
|
$currencyMultiplier->save();
|
|
|
|
Session::flash('alert-success', 'Configuration saved successfully.');
|
|
} catch (\Exception $e) {
|
|
Session::flash('alert-error', 'Configuration could not be saved, something went wrong: '.$e->getMessage());
|
|
}
|
|
|
|
return back();
|
|
}
|
|
|
|
public function saveMatchmaking(SaveMatchmakingConfigurationRequest $request)
|
|
{
|
|
$matchmakingConfig = MatchmakingSettings::get();
|
|
|
|
try {
|
|
$matchmakingConfig->matchWaitingTime = $request->matchmakingWaitingTime;
|
|
$matchmakingConfig->save();
|
|
|
|
Session::flash('alert-success', 'Matchmaking configuration saved successfully.');
|
|
} catch (\Exception $e) {
|
|
Session::flash('alert-error', 'Matchmaking configuration could not be saved, something went wrong: '.$e->getMessage());
|
|
}
|
|
|
|
return back();
|
|
}
|
|
}
|