aboutsummaryrefslogtreecommitdiffstats
path: root/inc
diff options
context:
space:
mode:
Diffstat (limited to 'inc')
-rw-r--r--inc/craftmine.inc4
-rw-r--r--inc/dungeon.inc6
2 files changed, 9 insertions, 1 deletions
diff --git a/inc/craftmine.inc b/inc/craftmine.inc
index 33a28d7..0d6a445 100644
--- a/inc/craftmine.inc
+++ b/inc/craftmine.inc
@@ -2,12 +2,14 @@
require_once("mine.inc");
require_once("shop.inc");
+require_once("dungeon.inc");
function sendCraftMine() {
$data = array("gold" => sendMine(),
"shop" => sendShop(),
"inventory" => Inventory::sendContent(),
- "miners" => sendMiners()
+ "miners" => sendMiners(),
+ "dungeon" => sendDungeon(),
);
echo json_encode($data);
}
diff --git a/inc/dungeon.inc b/inc/dungeon.inc
index 8c26c92..81e2ba7 100644
--- a/inc/dungeon.inc
+++ b/inc/dungeon.inc
@@ -24,6 +24,12 @@ function initDungeon() {
$_SESSION["dungeon"] = true;
}
+function sendDungeon() {
+ if(!empty($_SESSION["dungeon"]))
+ return generateMonster();
+ else return false;
+}
+
function buildDungeon() {
$dungeon=generateMonster();
if(!empty($_SESSION["dungeon"])) {