aboutsummaryrefslogtreecommitdiffstats
path: root/craftmine.php
diff options
context:
space:
mode:
authorpiernov <piernov@piernov.org>2016-05-03 10:37:18 +0200
committerpiernov <piernov@piernov.org>2016-05-03 10:37:18 +0200
commit64e184b901fd4e7c9a829d14c5c34416923171c3 (patch)
tree70b5281ca85a38ef2a077e226dcce56a40ed563a /craftmine.php
parentadd9d3248a5adc02b071a301005c6f11195f7f7b (diff)
parentb8112f72b322fe5bf7048ac76251c8c637b9fee2 (diff)
downloadcandybox-64e184b901fd4e7c9a829d14c5c34416923171c3.tar.gz
candybox-64e184b901fd4e7c9a829d14c5c34416923171c3.tar.bz2
candybox-64e184b901fd4e7c9a829d14c5c34416923171c3.tar.xz
candybox-64e184b901fd4e7c9a829d14c5c34416923171c3.zip
Merge branch 'master' into alexichi
Diffstat (limited to 'craftmine.php')
-rw-r--r--craftmine.php17
1 files changed, 14 insertions, 3 deletions
diff --git a/craftmine.php b/craftmine.php
index 72817cc..242e1fd 100644
--- a/craftmine.php
+++ b/craftmine.php
@@ -5,8 +5,12 @@ require_once("inc/guild.inc");
require_once("inc/shop.inc");
require_once("inc/craftmine.inc");
require_once("inc/dungeon.inc");
+require_once("inc/savegame.inc");
+
session_start(); // Must be placed *BEFORE* $_SESSION is actually used and *AFTER* all classes are imported
+$op = "";
+
/**
* Indique au client une message requete.
*/
@@ -27,14 +31,16 @@ function reportBadRequest() {
exit();
}
if (!isset($_POST["op"])) {
- reportBadRequest();
-}
+ if(!isset($_GET["op"]))
+ reportBadRequest();
+ else
+ $op = $_GET["op"];
+} else $op = $_POST["op"];
/**
* On récupère l'opération à exécuter et on le fait.
*/
-$op = $_POST["op"];
switch($op) {
case "withdrawMine": withdrawMine(); break;
case "createGuild": createGuild(); break;
@@ -45,6 +51,11 @@ switch($op) {
case "buildDungeon" : buildDungeon(); break;
case "launchDungeon" : launchDungeon(); break;
case "exitDungeon" : exitDungeon(); break;
+ case "saveGame": saveGame(); break;
+ case "downSave": downSave(); break;
+ case "listSaves": listSaves(); break;
+ case "loadSave": loadSave(); break;
+ case "deleteSave": deleteSave(); break;
default: reportBadRequest();
}