From 2d0da0b920035c90d56db5dbec6d62f5b50ba0c2 Mon Sep 17 00:00:00 2001 From: Daniel Weipert Date: Mon, 15 Jan 2024 14:50:10 +0100 Subject: account management --- src/gemini/Gemini.php | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) (limited to 'src/gemini/Gemini.php') diff --git a/src/gemini/Gemini.php b/src/gemini/Gemini.php index 4567958..9d34b30 100644 --- a/src/gemini/Gemini.php +++ b/src/gemini/Gemini.php @@ -94,6 +94,20 @@ class Gemini $response = $buildingController->levelUp($request); } + else if (preg_match('@village/(\d+)/(\d+)/building/(\w+)/manage@', $request->getPath(), $routeMatch)) { + $request + ->set('x', $routeMatch[1]) + ->set('y', $routeMatch[2]) + ->set('type', $routeMatch[3]); + + if ($request->get('type') === 'Storage') { + $response = new Response( + statusCode: Status::REDIRECT_PERMANENT, + meta: "/village/{$routeMatch[1]}/{$routeMatch[2]}/storage/config" + ); + } + } + else if (preg_match('@village/(\d+)/(\d+)/unit/(\w+)/create@', $request->getPath(), $routeMatch)) { $request ->set('x', $routeMatch[1]) @@ -189,6 +203,26 @@ class Gemini $response = $eventController->cancel($request); } + else if (preg_match('@account/username@', $request->getPath(), $routeMatch)) { + $userController = new User(); + $response = $userController->accountUsername($request); + } + + else if (preg_match('@account/email@', $request->getPath(), $routeMatch)) { + $userController = new User(); + $response = $userController->accountEmail($request); + } + + else if (preg_match('@account/password@', $request->getPath(), $routeMatch)) { + $userController = new User(); + $response = $userController->accountPassword($request); + } + + else if (preg_match('@account$@', $request->getPath(), $routeMatch)) { + $userController = new User(); + $response = $userController->account($request); + } + return $response; }); -- cgit v1.2.3