aboutsummaryrefslogtreecommitdiffstats
path: root/craftmine.php
diff options
context:
space:
mode:
authorpiernov <piernov@piernov.org>2016-04-27 20:53:43 +0200
committerpiernov <piernov@piernov.org>2016-04-27 20:53:43 +0200
commit807e528d6a1ae40ab118f711fe2e8c2bb7df915a (patch)
tree1d4fbde95ff281d5bb628dcc545401146e26ff15 /craftmine.php
parent2b0a84a41eeb90094d42c3c516bf99837d08a745 (diff)
parentcaf62cfe0e439fc13f7c297954c4aeb21112a2ec (diff)
downloadcandybox-807e528d6a1ae40ab118f711fe2e8c2bb7df915a.tar.gz
candybox-807e528d6a1ae40ab118f711fe2e8c2bb7df915a.tar.bz2
candybox-807e528d6a1ae40ab118f711fe2e8c2bb7df915a.tar.xz
candybox-807e528d6a1ae40ab118f711fe2e8c2bb7df915a.zip
Merge branch 'feat/savegame' into piernov
Diffstat (limited to 'craftmine.php')
-rw-r--r--craftmine.php13
1 files changed, 10 insertions, 3 deletions
diff --git a/craftmine.php b/craftmine.php
index 78c5e37..ac187cc 100644
--- a/craftmine.php
+++ b/craftmine.php
@@ -4,9 +4,12 @@ require_once("inc/mine.inc");
require_once("inc/guild.inc");
require_once("inc/shop.inc");
require_once("inc/craftmine.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 +30,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;
@@ -42,6 +47,8 @@ switch($op) {
case "getCraftMine": sendCraftMine(); break;
case "buildShop": buildShop(); break;
case "buyItem": buyItem(); break;
+ case "saveGame": saveGame(); break;
+ case "downSave": downSave(); break;
default: reportBadRequest();
}