Deathgarden_Rebirth-Rewrite/dist/app/Http/Controllers/Web/Admin/Tools/AdminToolController.php
Vari dfbb8f34c0 Added new Admin Tool page to manage the different versions we need to control. These are:
- launcher version (updating launcher)
- game version
- content version (for catalog)
- catalog version

Also added checks that when the wrong content version you dont get a catalog until you update tha game. And added another check when queuing when using the wrong game version you dont get queued. (so that hunters on the wrong version cannot block the matchmaking)
2024-09-05 23:43:47 +02:00

71 lines
1.6 KiB
PHP

<?php
namespace App\Http\Controllers\Web\Admin\Tools;
use App\Enums\Auth\Permissions;
use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\View;
abstract class AdminToolController extends Controller
{
protected static string $name;
protected static string $description;
protected static string $iconComponent;
protected static Permissions $neededPermission;
public function __construct()
{
$this->overrideTitle(static::$name);
}
/**
* @return AdminToolController[]|string[]
*/
final public static function getAllTools(): array
{
return [
GameNewsController::class,
FileManagerController::class,
VersioningController::class,
LauncherMessageController::class,
LogViewerController::class,
UsersController::class,
ChatMessageController::class,
InboxMailerController::class,
PlayerReportsController::class,
];
}
public static function getNotificationText(): ?string {
return null;
}
final public static function getName(): string
{
return static::$name;
}
final public static function getDescription(): string
{
return static::$description;
}
final public static function getIconComponent(): string
{
return static::$iconComponent;
}
final public static function getNeededPermission(): string
{
return static::$neededPermission->value;
}
final protected function overrideTitle(string $title): void {
View::share('title', $title);
}
}