From af52ac37874959c4964cea2c915c8fc9415500a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C5=91cze=20Bence?= Date: Thu, 4 Jun 2020 00:13:32 +0200 Subject: [PATCH 1/2] MAPG-110 request the correct endpoint in case of in-place game reset --- public/static/js/game.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/static/js/game.js b/public/static/js/game.js index e302a86..789ba2c 100644 --- a/public/static/js/game.js +++ b/public/static/js/game.js @@ -135,7 +135,7 @@ Core.resetGame(); }; - xhr.open('GET', '/game/' + mapId + '/position.json', true); + xhr.open('GET', '/game/' + mapId + '/json', true); xhr.send(); }, From 6a9f7eddc15f4f77dec0411e84a10703a551c875 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C5=91cze=20Bence?= Date: Thu, 4 Jun 2020 00:13:57 +0200 Subject: [PATCH 2/2] MAPG-110 make error response more for machines --- src/Controller/PositionController.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Controller/PositionController.php b/src/Controller/PositionController.php index e248446..e2f7d7b 100644 --- a/src/Controller/PositionController.php +++ b/src/Controller/PositionController.php @@ -17,7 +17,7 @@ class PositionController $mapId = (int) $parameters['mapId']; if (!isset($_SESSION['state']) || $_SESSION['state']['mapId'] !== $mapId) { - $data = ['error' => 'No valid session found!']; + $data = ['error' => 'no_session_found']; return new JsonContent($data); } @@ -55,7 +55,7 @@ class PositionController $mapId = (int) $parameters['mapId']; if (!isset($_SESSION['state']) || $_SESSION['state']['mapId'] !== $mapId) { - $data = ['error' => 'No valid session found!']; + $data = ['error' => 'no_session_found']; return new JsonContent($data); }