Library for handling Solid State Networks patch files, written in TypeScript for Node.js
Find a file
2018-07-08 22:59:31 +02:00
src 🚧 manually decompress file to debug 2018-07-08 22:59:31 +02:00
.editorconfig Add config module 2018-06-21 14:17:21 +02:00
.gitignore 🚨 Adding tslint and fixing warnings 2018-06-21 14:37:29 +02:00
package-lock.json 👷 Update dependencies 2018-07-08 15:56:15 +02:00
package.json 👷 Update dependencies 2018-07-08 15:56:15 +02:00
README.md 🚧 Partial switch to streams, and add utility endpoints 2018-07-05 00:58:40 +02:00
tsconfig.json 👷 Fix sourcemaps to include ts code 2018-07-05 15:32:05 +02:00

This tool is used for fetching releases from SWTORs patch server CDN and installing them.

Installation

For this tool to work, tsc and tslint must be globally available, e.g. by running:

npm install -g typescript tslint

Transpile the TypeScript files to JavaScript by running:

npm start

Usage

Either directly run whatever script you need:

node dist/getManifest.js assets_swtor_main
node dist/getSolidPkg.js assets_swtor_main 126 127
node dist/installPatch.js

Or import the functions into your Node.js application:

import * as ssn from './dist';

(async function() {
  const manifestContents = await ssn.getManifest('assets_swtor_main');
  console.log(manifestContents);

  const solidpkgContents = await ssn.getSolidpkg('assets_swtor_main', 126, 127);
  console.log(solidpkgContents);
}())

Introduction

SWTORs patcher is licensed from Solid State Networks, so it is mostly using code from SSN. However, SWTOR does not use the original software by SSN; instead they wrote their own patch deploy pipeline which interfaces with the SSN command line tools.

Also, SWTOR does not use all features offered by SSN. Notably, for public-facing products they do not use the peer-to-peer download of patches; instead all patches are downloaded from a CDN. In addition, they do not use the upcoming feature where you can preload an upcoming patch before it is released.

In addition to the SSN patcher, the live game (but not the PTS) can also be installed via BitRaider. We do not cover BitRaider since understanding SSN is enough to install all patches.

Terminology

SSN uses the following terms; make sure you are familiar with them since we use them as well in documentation and in code.

  • product: SWTOR is split into multiple products. That way, you can choose to only install part of SWTOR. For example, if you install the products assets_swtor_main and assets_swtor_en_us, you only have the English-language live client files and no other languages and no PTS.
  • release: Colloquially, this is known as a “patch” (or Game Update). For example, release 264 in product assets_swtor_main refers to Game Update 5.2.0. However, not every release can be mapped to a “patch” (or Game Update); sometimes there are multiple releases between two actual “patches”, e.g. because of built errors or because they need to add another hotfix before releasing the “patch”. A release is always an integer starting at 0.
  • patch: In a SSN sense, a patch refers to the difference between two releases. For example, 263to264 is a patch that can be used to update a product from release 263 to release 264. The first number is called from while the second number is to. If the from number is -1, e.g. in patch -1to0, the patch does not store the differences but the full file contents to allow a fresh install. Otherwise, you must already have the from release installed in order to apply the patch.
  • environment: An environment consists of multiple products. For example, the live environment has products like assets_swtor_main while the pts environment has assets_swtor_test_main.
  • manifest: Each product has a manifest, a single file that lists all releases and all patches, and specifies which release is the current release (that the launcher must install).

SSN file format and encryption

All files used by SSN are password-protected .zip files with a .exe header. The files are stored in the .zip section, while the .exe header (and the signatures at the end) are used to verify the integrity of the file. We are not interested in checking the integrity, so we only look at the .zip file. Check the .zip specification for more information on the .zip format.

For each file, the extra field contains the following information:

  • For password protected files, the password needed to decrypt the file. The password itself is encoded and even if you have decoded it, it is usually in binary. Most .zip software only accepts textual passwords, so I recommend writing a custom .zip reader.
  • Whether this file is stored in full, or whether only the differences are stored in vcdiff/xdelta3 encoding. Also flags whether a file was deleted, and it includes the hashes of both the old and the new file.

Manifests (.patchmanifest)

A .patchmanifest SSN file contains a single file manifest.xml which includes a list of releases and patches, and specifies which manifest is the current one.

Patches (.solidpkg)

A .solidpkg file contains a single file metafile.solid, which is in Bencode format (similar to .torrent files) and includes the names, sizes and hashes of all files with the patch data (.zip, .z01, .z02 etc.).

Version files (.version)

Once a patch is installed, you can look into the .version file to figure out which release it is, and use the hashes to verify that the installation is correct.

File download and CDN

Manifests are hosted on manifest.swtor.com, while patches are hosted on cdn-patch.swtor.com. They can only be downloaded via HTTP (port 80) but the files are integrity-checked via their included signatures.

Manifests can be downloaded as follows: http://manifest.swtor.com/patch/${product}.patchmanifest

Then knowing which patch you need, you can get the patch as follows: http://cdn-patch.swtor.com/patch/${product}/${product}_${from}to${to}.solidpkg

Appendix

Products used by SWTOR

SWTOR uses the following products:

  • assets_swtor_de_de: German language files for the live environment.
  • assets_swtor_fr_fr: English language files for the live environment.
  • assets_swtor_en_us: French language files for the live environment.
  • assets_swtor_main: Main game data for the live environment.
  • assets_swtor_test_de_de: German language files for the PTS environment.
  • assets_swtor_test_en_us: English language files for the PTS environment.
  • assets_swtor_test_fr_fr: French language files for the PTS environment.
  • assets_swtor_test_main: Main game data for the PTS environment.
  • eualas: End user access and license agreement, and other legal documents you need to accept in the launcher before you can play the game.
  • movies_de_de: Intro movies by Blur in German language.
  • movies_en_us: Intro movies by Blur in English language.
  • movies_fr_fr: Intro movies by Blur in French language.
  • patcher2014: The old launcher, now replaced by patcher2017.
  • patcher2017: Current version of the launcher, used to download and install patches.
  • retailclient_liveqatest: The current client used by QA the day before a maintenance to log into a private server and check that the upcoming patch is correct.
  • retailclient_publictest: The current client used to play the game on the PTS.
  • retailclient_swtor: The current client used to play the game in the live environment.

In addition, there are a few private products which are only reachable through BioWares VPN and are not publicly accessible:

  • biomon_cstraining, biomon_liveeptest, biomon_liveqatest, biomon_publictest, biomon_swtor: The Biomongoose tool, possibly to monitor performance like CPU and memory usage.
  • byftools_cstraining, byftools_liveeptest, byftools_liveqatest, byftools_publictest, byftools_swtor: Unknown tools ByfTools and iPen.
  • heroblade_cstraining, heroblade_liveeptest, heroblade_liveqatest, heroblade_publictest, heroblade_swtor: The IDE used for editing the game, either by placing new objects into the game world or editing scripts.
  • morpheme_cstraining, morpheme_liveqatest: Morpheme is a middleware used for character animations.
  • patcher: The old launcher before the 2014 revamp. No longer in use.
  • playerclient_cstraining, playerclient_liveeptest, playerclient_liveqatest, playerclient_publictest, playerclient_swtor: A client to play the game, used by the devs instead of retailclient. Has a console and integrates with HeroBlade.
  • repositoryassistant_cstraining, repositoryassistant_liveeptest, repositoryassistant_liveqatest, repositoryassistant_publictest, repositoryassistant_swtor: unknown
  • repositorybrowser_cstraining, repositorybrowser_liveeptest, repositorybrowser_liveqatest, repositorybrowser_publictest, repositorybrowser_swtor: The repository browser interfaces with HeroBlade to load 3D models, textures and other assets.
  • toolshub_cstraining, toolshub_liveeptest, toolshub_liveqatest, toolshub_publictest, toolshub_swtor: Used to launch more tools; most likely SpeedTree, WWise and other middleware.
  • visualizer_cstraining, visualizer_liveeptest, visualizer_liveqatest, visualizer_publictest, visualizer_swtor: Also known as VANViewer; possibly the tool mentioned by Georg Zoeller in his 2011 GDC talk.

The following products are deprecated and no longer used.

  • retailclient_betatest: The client used during the closed beta (2011 and earlier) to play the game.
  • retailclient_cstraining: No longer used.
  • retailclient_liveeptest: No longer used.
  • retailclient_squadron157: The client used during the closed beta by the Squadron157 testing group to play the game.