diff options
author | Daniel Weipert <git@mail.dweipert.de> | 2024-01-08 22:28:02 +0100 |
---|---|---|
committer | Daniel Weipert <git@mail.dweipert.de> | 2024-01-08 22:28:02 +0100 |
commit | e4351601a7ced91bf5a2c516a38db714d43e6ecf (patch) | |
tree | 045b0fb41621aab160cca3b24fd4184e1d8db9c2 /src/gemini/Gemini.php | |
parent | 82875448c485d26375ed6dea4e64e940f6e10f74 (diff) |
send resources + adminer css
Diffstat (limited to 'src/gemini/Gemini.php')
-rw-r--r-- | src/gemini/Gemini.php | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/gemini/Gemini.php b/src/gemini/Gemini.php index 507b962..4c420d4 100644 --- a/src/gemini/Gemini.php +++ b/src/gemini/Gemini.php @@ -129,6 +129,25 @@ class Gemini $response = $unitController->sendUnits($request); } + else if (preg_match('@village/(\d+)/(\d+)/send-resources@', $request->getPath(), $routeMatch)) { + $request + ->set('x', $routeMatch[1]) + ->set('y', $routeMatch[2]); + + if (preg_match('@village/(\d+)/(\d+)/send-resources/type/(\w+)$@', $request->getPath(), $routeMatch)) { + $request->set('selectedResourceType', $routeMatch[3]); + } + else if (preg_match('@village/(\d+)/(\d+)/send-resources/type/(\w+)/village/(\d+)/(\d+)$@', $request->getPath(), $routeMatch)) { + $request + ->set('selectedResourceType', $routeMatch[3]) + ->set('selectedVillageX', $routeMatch[4]) + ->set('selectedVillageY', $routeMatch[5]); + } + + $villageController = new Village(); + $response = $villageController->sendResources($request); + } + else if (preg_match('@village/(\d+)/(\d+)@', $request->getPath(), $routeMatch)) { $request ->set('x', $routeMatch[1]) |