Difference between revisions of "CampaignServerWML"

From The Battle for Wesnoth Wiki
(Downloading a Campaign)
Line 23: Line 23:
  
 
== Downloading a Campaign ==
 
== Downloading a Campaign ==
 +
 +
This command is used to download a specified campaign from the campaign server.
 +
 
* Request
 
* Request
** '''[upload]'''
+
** '''[request_campaign]'''
*** ''author'' - author(s) of the campaign.
+
*** ''name'' - the name of the campaign.
*** ''description'' - description of the campaign. For pre 1.0 campaigns this should also describe the playability.
 
*** ''icon'' - path to an image in the standard image directory for Wesnoth. This path must use forward slashes (/). It cannot refer to custom images included with the campaign. This image is displayed as an icon by the campaign client built into Wesnoth.
 
*** ''name'' - the name of the campaign. Note this is not the title and shouldn't have spaces in it.
 
*** ''passphrase'' - this is used to control updates to campaigns on the server. For existing campaigns, if the passphrase doesn't match the update will be rejected. You can't change the passphrase yourself. If you lose or need to change the passphrase you need to contact the server administrator.
 
*** ''title'' - the title of the campaign. This is not a translatable string.
 
*** ''version'' - version of the campaign. The recommended format is x.y.z where x, y and z are decimal strings. x should be 0 for campaigns that are not yet complete.
 
*** '''[data]'''
 
**** '''[file]'''
 
***** ''name'' - the name of the file. This does not include any path information.
 
***** ''contents'' - the content of the file (binary data).
 
**** '''[dir]'''
 
***** ''name'' - the name of the directory. This does not include any path information.
 
***** This tag may contain '''[file]''' or '''[dir]''' subtags (the latter are recursive).
 
 
* Response
 
* Response
** '''[message]'''
+
** ''author'' - author(s) of the campaign.
*** ''message'' - translatable string that indicates that the campaign upload was successful.
+
** ''description'' - description of the campaign. For pre 1.0 campaigns this should also describe the playability.
 +
** ''icon'' - path to an image in the standard image directory for Wesnoth. This path must use forward slashes (/). It cannot refer to custom images included with the campaign. This image is displayed as an icon by the campaign client built into Wesnoth.
 +
** ''name'' - the name of the campaign. Note this is not the title and shouldn't have spaces in it.
 +
** ''passphrase'' - this is used to control updates to campaigns on the server. For existing campaigns, if the passphrase doesn't match the update will be rejected. You can't change the passphrase yourself. If you lose or need to change the passphrase you need to contact the server administrator.
 +
** ''title'' - the title of the campaign. This is not a translatable string.
 +
** ''version'' - version of the campaign. The recommended format is x.y.z where x, y and z are decimal strings. x should be 0 for campaigns that are not yet complete.
 +
** '''[data]'''
 +
*** '''[file]'''
 +
**** ''name'' - the name of the file. This does not include any path information.
 +
**** ''contents'' - the content of the file (binary data).
 +
*** '''[dir]'''
 +
**** ''name'' - the name of the directory. This does not include any path information.
 +
**** This tag may contain '''[file]''' or '''[dir]''' subtags (the latter are recursive).
  
 
== Uploading a Campaign ==
 
== Uploading a Campaign ==

Revision as of 19:59, 7 October 2005

Campaign Server WML

This page describes the WML commands exchanged between campaign download clients and a campaign server. Note that this WML is not used in the game engine.

Listing Available Campaigns

This request is used to retrieve a list of campaigns available on the server and some overview information about them.

  • Request
    • [request_campaign_list]
  • Response
    • [campaigns]
      • [campaign]
        • author - author(s) of the campaign.
        • description - description of the campaign. For pre 1.0 campaigns this should also describe the playability.
        • downloads - the number times the campaign (including previous versions) has been downloaded directly from the campaign server.
        • filename - filename campaign is stored in (currently the same as name).
        • icon - path to an image in the standard image directory for Wesnoth. This path must use forward slashes (/). It cannot refer to custom images included with the campaign. This image is displayed as an icon by the campaign client built into Wesnoth.
        • size - the size of the campaign in bytes on the campaign server.
        • timestamp - when this version of the campaign was uploaded.
        • title - campaign title.
        • version - version of the campaign. The recommended format is x.y.z where x, y and z are decimal strings. x should be 0 for campaigns that are not yet complete.

Downloading a Campaign

This command is used to download a specified campaign from the campaign server.

  • Request
    • [request_campaign]
      • name - the name of the campaign.
  • Response
    • author - author(s) of the campaign.
    • description - description of the campaign. For pre 1.0 campaigns this should also describe the playability.
    • icon - path to an image in the standard image directory for Wesnoth. This path must use forward slashes (/). It cannot refer to custom images included with the campaign. This image is displayed as an icon by the campaign client built into Wesnoth.
    • name - the name of the campaign. Note this is not the title and shouldn't have spaces in it.
    • passphrase - this is used to control updates to campaigns on the server. For existing campaigns, if the passphrase doesn't match the update will be rejected. You can't change the passphrase yourself. If you lose or need to change the passphrase you need to contact the server administrator.
    • title - the title of the campaign. This is not a translatable string.
    • version - version of the campaign. The recommended format is x.y.z where x, y and z are decimal strings. x should be 0 for campaigns that are not yet complete.
    • [data]
      • [file]
        • name - the name of the file. This does not include any path information.
        • contents - the content of the file (binary data).
      • [dir]
        • name - the name of the directory. This does not include any path information.
        • This tag may contain [file] or [dir] subtags (the latter are recursive).

Uploading a Campaign

This command is used to upload a new or updated version of an add on campaign to the campaign server.

  • Request
    • [upload]
      • author - author(s) of the campaign.
      • description - description of the campaign. For pre 1.0 campaigns this should also describe the playability.
      • icon - path to an image in the standard image directory for Wesnoth. This path must use forward slashes (/). It cannot refer to custom images included with the campaign. This image is displayed as an icon by the campaign client built into Wesnoth.
      • name - the name of the campaign. Note this is not the title and shouldn't have spaces in it.
      • passphrase - this is used to control updates to campaigns on the server. For existing campaigns, if the passphrase doesn't match the update will be rejected. You can't change the passphrase yourself. If you lose or need to change the passphrase you need to contact the server administrator.
      • title - the title of the campaign. This is not a translatable string.
      • version - version of the campaign. The recommended format is x.y.z where x, y and z are decimal strings. x should be 0 for campaigns that are not yet complete.
      • [data]
        • [file]
          • name - the name of the file. This does not include any path information.
          • contents - the content of the file (binary data).
        • [dir]
          • name - the name of the directory. This does not include any path information.
          • This tag may contain [file] or [dir] subtags (the latter are recursive).
  • Response
    • [message]
      • message - translatable string that indicates that the campaign upload was successful.

Deleting a Campaign

This command is used to delete an existing campaign from the campaign server.

  • Request
    • [delete]
      • name - The name of the cmpaign to delete.
      • passphrase - This must match the passphrase on record for the campaign in order for the campaign to be deleted.
  • Response
    • [message]
      • message - translatable string that indicates that the campaign was erased.

Request License Information

Retrieve the terms of the license used for any uploaded campaigns. You may not upload a campaign if you don't (or can't) aggree to the license. Wesnoth requires campaigns (including images and sound) to be licensed under the GPL.

  • Request
    • [request_terms]
  • Response
    • [message]
      • message - translatable string containing the text of the license.

See Also