From 9f1e642a47f10269c24690d3a3027a91e8e23b5a Mon Sep 17 00:00:00 2001 From: Skylar Ittner Date: Fri, 2 Dec 2016 16:54:42 -0700 Subject: [PATCH] Add "levelup" boolean to output of *place.php --- attackplace.php | 2 +- claimplace.php | 2 +- refillplace.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/attackplace.php b/attackplace.php index 583577f..6ca1b86 100644 --- a/attackplace.php +++ b/attackplace.php @@ -118,4 +118,4 @@ if ($placehp == 0) { $database->update('locations', ['currentlife' => $placehp], ['locationid' => $VARS['locationid']]); } -sendOK(($dolevelup ? PLAYER_LEVEL_UP : PLACE_SUCCESS)); +echo json_encode(["status" => "OK", "message" => ($dolevelup ? PLAYER_LEVEL_UP : PLACE_SUCCESS), "levelup" => ($dolevelup ? true : false)]); diff --git a/claimplace.php b/claimplace.php index f4760fa..f4285f4 100644 --- a/claimplace.php +++ b/claimplace.php @@ -44,4 +44,4 @@ if (floor($userlevel) > floor($user['level'])) { // Update the place $database->update('locations', ['currentlife' => 100, 'maxlife' => 100, 'owneruuid' => $_SESSION['uuid'], 'teamid' => $user['teamid']], ['locationid' => $VARS['locationid']]); -sendOK(($dolevelup ? PLAYER_LEVEL_UP : PLACE_SUCCESS)); +echo json_encode(["status" => "OK", "message" => ($dolevelup ? PLAYER_LEVEL_UP : PLACE_SUCCESS), "levelup" => ($dolevelup ? true : false)]); \ No newline at end of file diff --git a/refillplace.php b/refillplace.php index 6b9bfe1..7c2aa91 100644 --- a/refillplace.php +++ b/refillplace.php @@ -49,4 +49,4 @@ if ($placelife > 100) { // Update the place $database->update('locations', ['currentlife' => $placelife, 'maxlife' => 100, 'owneruuid' => $_SESSION['uuid'], 'teamid' => $user['teamid']], ['locationid' => $VARS['locationid']]); -sendOK(($dolevelup ? PLAYER_LEVEL_UP : PLACE_HEALTH_REFILLED)); +echo json_encode(["status" => "OK", "message" => ($dolevelup ? PLAYER_LEVEL_UP : PLACE_HEALTH_REFILLED), "levelup" => ($dolevelup ? true : false)]);