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.
package |
inc\dungeon.inc |
---|---|
Creates the shop in the session and sends it to the client.
Debits the shop's cost from the player's gold.
package |
inc\shop.inc |
---|---|
Debits the item's cost specified as the item POST parameter, adds it to the Inventory and sends it to the client.
package |
inc\shop.inc |
---|---|
Create the miners guild in the session.
Debits GUILD_COST from the player's gold.
package |
inc\guild.inc |
---|---|
Credits the account of a certain amount of gold.
package |
inc\account.inc |
---|
integer
amount to credit
Debits the account of a certain amount of gold.
package |
inc\account.inc |
---|
integer
amount to debit
boolean
true if player had enough gold, false otherwise
Deletes a save file given as the filename POST parameter.
package |
inc\savegame.inc |
---|---|
Sends the current game or a specific save file given by the filename GET parameter to the client.
package |
inc\savegame.inc |
---|---|
Loads all the dungeon's monsters from the XML file data/monsters.xml.
package |
inc\dungeon.inc |
---|---|
array
contains all the Monster objects
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.
package |
inc\savegame.inc |
---|---|
string
the generated file name
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.
package |
inc\savegame.inc |
---|
array
an array with mixed type elements to convert to XML
\SimpleXMLElement
root XML to add the elements to
Gets an Item object from the shop from its name.
package |
inc\shop.inc |
---|---|
params |
string $name the name of the object to search for |
\Item|false
the Item object or false if the item was not found
Increases a player's stat.
package |
inc\perso.inc |
---|
integer
stat to increase
Initializes the gold amount and miners count in the session.
package |
inc\mine.inc |
---|---|
Sends monsters for a specific floor as specified by the floor POST parameter to the client.
package |
inc\dungeon.inc |
---|---|
traite le fait que wooden sword n'est pas cumulable metal sword non plus life bottle cumulable 3 fois si on clique sur wooden sword alors que on avait une metal sword, le bonusPower passe de +3 à +1
package |
inc\perso.inc |
---|---|
Sends the list of available saves to the client.
Warning: this function changes directory.
package |
inc\savegame.inc |
---|---|
Loads a save file given as the filename POST parameter to the session.
Empties the session beforehand.
package |
inc\savegame.inc |
---|---|
Loads all the shop's items from the XML file data/items.xml.
package |
inc\shop.inc |
---|---|
array
contains all the Item objects
Reads an XML tree and deserializes it to an array.
package |
inc\savegame.inc |
---|
\SimpleXMLElement
root XML to read the elements from
array
an empty array to stores the elements to, passed by reference
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.
package |
inc\savegame.inc |
---|---|
Sends all data from previous session on page load.
All data from the different modules are packed in an array.
package |
inc\craftmine.inc |
---|---|
Returns the dungeon array if it was created.
package |
inc\dungeon.inc |
---|---|
array
dungeon array as created by generateMonster
Updates floor and monster number from the POST parameters in the session.
package |
inc\dungeon.inc |
---|---|
Sends an error message to the client.
Simple wrapper calling sendMessage with "error" as $type.
package |
inc\messages.inc |
---|
string
message content
string
optional parameters to apply when formating message string
Sends an info message to the client.
Simple wrapper calling sendMessage with "info" as $type.
package |
inc\messages.inc |
---|
string
message content
string
optional parameters to apply when formating message string
Sends a message to the client.
package |
inc\messages.inc |
---|
string
message type, for example "info" or "error"
string
message content
string
optional parameters to apply when formating message string
Returns the amount of gold currently owned by the player.
package |
inc\mine.inc |
---|---|
integer
amount of gold available
Returns the number of miners currently in the guild.
package |
inc\guild.inc |
---|---|
integer
number of miners in the guild
Returns all player's stats after initializing them if needed.
package |
inc\perso.inc |
---|---|
array<mixed,integer>
arrays containing player's stats
Returns the shop array if it was created.
package |
inc\shop.inc |
---|---|
array
shop array as created by loadShop
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.
package |
inc\savegame.inc |
---|---|