Update Mod API

From Warzone Wiki
Jump to: navigation, search

The Update Mod API can be used by mod developers to assist in updating the mod's code and assets. This API provides a way to rapidly iterate on mod development -- updating the mod's code and seeing the results in the Warzone game itself.

This API is meant to be integrated into a IDE, such as Visual Studio Code, to allow for easily updating the mod.

A key feature of this API is that it notifies any Warzone clients using the mod that it's out of date, and then those Warzone clients will download the updated mod automatically and immediately.

[edit] Usage

To use the API, you must first have created a development mod (not public) through the Mod Development Console. After doing that, take note of the Mod ID shown here when clicking "Edit" next to that mod.

To use the API, POST some JSON to https://www.warzone.com/API/UpdateMod?ModID=###&APIToken=XXX

The ID of your mod and your API Token are passed on the querystring, as shown.

The body of your post should be JSON that identifies all files that are to be included in your mod. Here's a sample of the format:

 {
 "files": [
        {
 		"path": "Client_PresentMenuUI.lua",
 		"content": "..."
 	}, {
 		"path": "Utilities.lua",
 		"content": "..."
 	}, {
 		"path": "SpecialUnitImages/img.png",
 		"content": "..."
 	}
 	
 	]
 }


The "content" field should contain the entire contents of that file encoded as a base64 string.

[edit] Compression

If desired, you can also pass "&Compressed=1" to the end of the querystring. If this is present, then the json body you post should be compressed with 7zip. This can be useful if your mod is very large as it will save on the upload bandwidth used.

Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox