From add9d3248a5adc02b071a301005c6f11195f7f7b Mon Sep 17 00:00:00 2001 From: alexichi Date: Tue, 3 May 2016 10:33:27 +0200 Subject: add dungeon client side to display it when reload --- inc/craftmine.inc | 4 +++- inc/dungeon.inc | 6 ++++++ 2 files changed, 9 insertions(+), 1 deletion(-) (limited to 'inc') 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"])) { -- cgit v1.2.3-54-g00ecf