diff --git a/app/Http/Controllers/OptionsController.php b/app/Http/Controllers/OptionsController.php index 9e87e2e..c5a17bb 100755 --- a/app/Http/Controllers/OptionsController.php +++ b/app/Http/Controllers/OptionsController.php @@ -46,7 +46,8 @@ class OptionsController extends Controller 'pwExpiry' => Options::getOption('password_expiry'), 'requiresPMC' => Options::getOption('requireGameLicense'), 'enforce2fa' => Options::getOption('force2fa') - ] + ], + 'currentGame' => Options::getOption('currentGame') ]); } @@ -89,4 +90,26 @@ class OptionsController extends Controller return redirect()->back(); } + + public function saveGameIntegration(Request $request) + { + $supportedGames = [ + 'RUST', + 'MINECRAFT', + 'SE', + 'GMOD' + ]; + + if (!is_null($request->gamePref) && in_array($request->gamePref, $supportedGames)) + { + Options::changeOption('currentGame', $request->gamePref); + $request->session()->flash('success', 'Updated current game.'); + + return redirect()->back(); + } + + $request->session()->flash('error', 'Unsupported game ' . $request->gamePref . '.'); + + return redirect()->back(); + } } diff --git a/resources/views/dashboard/administration/settings.blade.php b/resources/views/dashboard/administration/settings.blade.php index c4a8e08..d44732e 100755 --- a/resources/views/dashboard/administration/settings.blade.php +++ b/resources/views/dashboard/administration/settings.blade.php @@ -208,43 +208,48 @@