From 9f28616dfd1cc425c5013937bab729217b7be2e6 Mon Sep 17 00:00:00 2001 From: piernov Date: Sun, 8 May 2016 20:45:40 +0200 Subject: Add build_doc.sh script + generated phpdoc --- doc/phpdoc/packages/inc.savegame.inc.html | 246 ++++++++++++++++++++++++++++++ 1 file changed, 246 insertions(+) create mode 100644 doc/phpdoc/packages/inc.savegame.inc.html (limited to 'doc/phpdoc/packages/inc.savegame.inc.html') diff --git a/doc/phpdoc/packages/inc.savegame.inc.html b/doc/phpdoc/packages/inc.savegame.inc.html new file mode 100644 index 0000000..4009130 --- /dev/null +++ b/doc/phpdoc/packages/inc.savegame.inc.html @@ -0,0 +1,246 @@ + + + + + + » \inc\savegame.inc + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + +
+ +
+
+ +
+ +
+ +
+ + + + +
+

Functions

+
+

genXML

+

Recursively generates an XML tree from an array.

+
If objects are found, call addToXML() methods which should serialize the object as a child of the XML tree passed as parameter.
+ « More » +
+ +
+

genSave

+

Generates the XML save tree from the session.

+
+ « More » +
+ +
+

genFilename

+

Generates the save file name using current date/time.

+
The date function will use the server's timezone which could be inconsistent with the client timezone.
+ « More » +
+ +
+

saveGame

+

Save the XML save tree as an XML file named after the results of genFilename in SAVEDIR.

+
Fails and send an error the the client if permissions are incorrectly set. Watch for errors in PHP log.
+ « More » +
+ +
+

downSave

+

Sends the current game or a specific save file given by the filename GET parameter to the client.

+
+ « More » +
+ +
+

listSaves

+

Sends the list of available saves to the client.

+
Warning: this function changes directory.
+ « More » +
+ +
+

parseSave

+

Reads an XML tree and deserializes it to an array.

+
+ « More » +
+ +
+

deleteSave

+

Deletes a save file given as the filename POST parameter.

+
+ « More » +
+ +
+

loadSave

+

Loads a save file given as the filename POST parameter to the session.

+
Empties the session beforehand.
+ « More » +
+ +
+

uploadSave

+

Reads a save file sent by the client.

+
Parse the received file then generate it again to clean it for any unwanted +and make sure that it is a valid XML save file. +XML errors are simply ignored and an error is sent to the client if something wrong happens.
+ « More » +
+ +
+ +
+

Constants

+
+

SAVEDIR

+

Directory to save to and load from.

+
The PHP/Apache user must have write permission on this directory. +Use the following commands to give write permissions to the http group: +<samp> +sudo chown :http data/save +sudo chmod g+w data/save +</samp>
+ « More » +
+ +
+ + + +
+
+
+ + + + -- cgit v1.2.3-54-g00ecf