aboutsummaryrefslogtreecommitdiffstats
path: root/inc/savegame.inc
diff options
context:
space:
mode:
Diffstat (limited to 'inc/savegame.inc')
-rw-r--r--inc/savegame.inc7
1 files changed, 7 insertions, 0 deletions
diff --git a/inc/savegame.inc b/inc/savegame.inc
index 79b1dae..eb4134f 100644
--- a/inc/savegame.inc
+++ b/inc/savegame.inc
@@ -71,6 +71,13 @@ function parseSave($xml, &$table) { // Passing $table by reference
}
}
+function deleteSave() {
+ if(empty($_POST["filename"])) return;
+ $filename = $_POST["filename"];
+ if(rm_file(SAVEDIR + "/" + $filename)) sendError("gamesave_delete_failed"); // TODO: find the correct method for removing a fileā€¦
+ else sendInfo("gamesave_delete_success");
+}
+
function loadSave() {
if(empty($_POST["filename"])) return;
$xml = simplexml_load_file(SAVEDIR . "/" . $_POST["filename"]);