Creation/Dev/Update Packages
Update Packages allow you to package files together and allow the user to manually download them when they log in, or force them to download the files when they log in. This is good for downloading certain images or ganis the first time a player logs in to a server or when they are updated, and it will help prevent the game form looking weird while everything loads individually.
Note: This is missing some information, but should be enough to get you started on update packages. Experiment with it, some fun stuff may happen :).
Using Update Packages
Update Packages are based on plain-text files, and have a fairly simple syntax.
You first need to add a folder option so that the .gupd file is downloadable.
file *.gupd
You then need to create a file called basepackage.gupd. This will specify the subpackages.
Base Package
Here is the general syntax of a basepackage.gupd file.
GRPKG001 NAME My Packages VERSION 1.23 PLATFORM any SUBPACKAGE package_images.gupd SUBPACKAGE package_sounds.gupd USECHECKSUM false PROTECTOVERWRITE true FLAG popupforoptionalpackages=false
Lets break it apart piece by piece.
GRPKG001
All .gupd files must start with this line.
NAME My Packages
The name of the package. In this case it's name is "My Packages".
VERSION 1.23
The version of the package. In this case, the version is "1.23"
SUBPACKAGE package_images.gupd
This line gives the filename of a subpackage, which can contain other files. You can have however many subpackages you want.
USECHECKSUM false
A checksum is a modulated number of all the data within a file. It basically allows the download to be checked for any erronous data that may have appeared during the transfer.
PROTECTOVERWRITE true
Unsure. Though it may be self-explanitory.
FLAG popupforoptionalpackages=false
Again, unsure. Though, again, it may be self-explanitory.
PLATFORM any
What platform(s) this pacakge is available to. In this case it will be available to people on all platforms.
Sub Packages
Subpackages work similar to the base package.
General Subpackage file
GRPKG001 NAME Images VERSION 1.00 PLATFORM any DESCRIPTION Maloria Images. <img src="images/alchemybottlered.gif"> DESCRIPTIONEND SUBPACKAGE images_guimain.gupd USECHECKSUM false PROTECTOVERWRITE true FLAG popupforoptionalpackages=false
The only new parameter here is DESCRIPTION. It contains a description of the package. It currently supports limited HTML markup. You must put DESCRIPTIONEND at the end of a description.
This points to another Subpackage, which contains the actual files.
GRPKG001 NAME GUI Images VERSION 1.00 PLATFORM any DESCRIPTION Images used for Maloria's GUIs. DESCRIPTIONEND MODE required FILE levels/webgifs/maldefaultwindow.png FILE levels/webgifs/maldefaultscroll.png FILE levels/webgifs/maldefaultbutton.png FILE levels/webgifs/maldefaultcheck.png FILE levels/webgifs/maldefaultslider.png FILE levels/webgifs/maldefaulttextedit.png
This is the general layout of a subpackage that contains files. The only new attributes here are FILE and MODE.
If you have MODE required then the files will be downloaded the first time the user connects to your server,and every time the VERSION changes. If you habe MODE optional then the user will have to download the files himself.
FILE levels/webgifs/maldefaultcheck.png
This is the location on the clients computer to save the files, relative to the Graal directory.