Functions
generateMonster¶
Loads all the dungeon's monsters from the XML file data/monsters.xml.
« More »
initDungeon¶
Marks the dungeon as accessible in the session.
« More »
sendDungeon¶
Returns the dungeon array if it was created.
« More »
buildDungeon¶
Allows acces to the dungeon in the session and sends it to the client.
Debits the dungeon's ticket cost from the player's gold.
« More »
launchDungeon¶
Sends monsters for a specific floor as specified by the floor POST parameter to the client.
« More »
sendDungeonProgress¶
Updates floor and monster number from the POST parameters in the session.
« More »
exitDungeon¶
Marks the dungeon as not accessible in the session.
« More »
Functions
sendMessage¶
Sends a message to the client.
« More »
sendError¶
Sends an error message to the client.
Simple wrapper calling sendMessage with "error" as $type.
« More »
sendInfo¶
Sends an info message to the client.
Simple wrapper calling sendMessage with "info" as $type.
« More »
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 »
Functions
loadShop¶
Loads all the shop's items from the XML file data/items.xml.
« More »
getItem¶
Gets an Item object from the shop from its name.
« More »
initShop¶
Marks the shop as created in the session.
« More »
sendShop¶
Returns the shop array if it was created.
« More »
buildShop¶
Creates the shop in the session and sends it to the client.
Debits the shop's cost from the player's gold.
« More »
buyItem¶
Debits the item's cost specified as the item POST parameter, adds it to the Inventory and sends it to the client.
« More »
useItem¶
Invoke useItem on an item passed as the item POST parameter, sends to the client the updated player stats and the item.
« More »