Skip to content

The Admin Tool

Emanuele Manzione edited this page Apr 8, 2020 · 28 revisions

Before you can start updating your game, you have to perform some initialization tasks. The whole documentation assumes you are working on Windows, so commands and everything else refers to its environment. If you are on a different OS don't worry: the process is the same, very minor changes in commandline commands are needed.

Requirements

You will need a web server that can server files over HTTP. The Launcher's downloader does access files through direct URLs, like: http://yourIP/yourFolder/yourFile.exe, so make sure that your files host can serve them correctly! You also will need the PATCH - Updating System package.

Initialization

Go on Window > PATCH > Admin Tool or press Alt + Shift + P: this will initialize the workspace. If you now click on Window > PATCH > Go to Workspace folder or press Alt + Shift + O the workspace will open and you will see some new folders: App, Builds, Patches, Updater.

Commandline equivalent

Run the command .\MHLab.Patch.Admin.exe --init: this will initialize the workspace. You will find an App folder in the same folder. The App folder will contains your game's current files.

The first version

Now you just need to build your game. Once you done and built files are available, move all of them to the App folder. Go to Admin Tool > Builds and hit Initial build button.

Commandline equivalent

Run the command .\MHLab.Patch.Admin.exe --build

After the computation, you will notice new files and folder spawned in your Builds folder:

  • 0.1.0 folder, it contains your game's files with some metadata about the version number
  • builds_index.json file, it contains metadata about all versions
  • build_0.1.0.json file, it contains metadata about the specific version

Upload the first build

It's a good time to upload files! Upload 0.1.0 folder, builds_index.json and build_0.1.0.json files on your web server.

Hint

To test if your files are reachable by the Launcher, just navigate over them with a normal web browser. Assuming we uploaded files at http://127.0.0.1/MyGame/, we will navigate on http://127.0.0.1/MyGame/Builds/builds_index.json. It should return a JSON string.

The second version

When you made enough changes to your game and you want to deploy a new version, just build your game again and put it in App folder. Go to Admin Tool > Builds again. This time you can notice that more options exist. Before proceeding, you should take a look at Release type. It regulates how the version number is increased and contains three options:

  • Patch release: with a previous version number of 2.3.6, a patch release will change the version number to 2.3.7. It is used for very little changes, hotfixes and similar stuff.
  • Minor release: with a previous version number of 2.3.6, a minor release will change the version number to 2.4.0. It is used for minor changes or additions to the existing functionalities.
  • Major release: with a previous version number of 2.3.6, a major release will change the version number to 3.0.0. It is used for major changes/additions to the existing functionalities or for changes/additions that break the backward compatibility.

Pick a release type accordingly to your needs and hit Build new version button. Again, after some computation the process will complete and you will find in your Builds folder a new version.

Hint

You can avoid to upload all versions you build. Patches are enough to update your clients' game. Why would you want to upload a build, then? Because of the repair functionality. Patches can be applied only if the game files' state is correct. So if your client corrupts a file or tries to modify it, the patch cannot be applied. The repairer runs exactly for this reason: if a file is corrupted, the correct state is restored. Remember: when you want to upload a new build, you must upload always version-specific files and folders (0.1.1 folder and build_0.1.1.json, for example), but also the index file (builds_index.json).

Generating the first patch

At this point you have two versions of your game. It's time to generate a patch between them: in this way updating from the old version to the new one will be a breeze. Go to Admin Tool > Patches. Set the version from / version to (it is automatically set on last two versions, for your convenience) and the compression level, then hit Build new patch button.

Hint

The compression level can go from 1 to 9. It impacts how strong the compression for that patch will be: lower levels offer better compression time but worse compression ratio.

When the process completes, you will find new files in your Patches folder (let's say your versions are 0.1.0 and 0.1.1):

  • patches_index.json file: it tracks down all patches you built
  • 0.1.0_0.1.1.json file: it contains metadata about the patch between version 0.1.0 and version 0.1.1
  • 0.1.0_0.1.1.zip file: it is a compressed archive that contains actual files needed to apply this patch

Upload the first patch

Upload 0.1.0_0.1.1.zip, 0.1.0_0.1.1.json and patches_index.json files on your web server. Remember to always upload patches_index.json everytime you upload a patch.