Library for handling Solid State Networks patch files, written in TypeScript for Node.js
Find a file
2018-10-08 21:21:09 +02:00
src 🐛 Fix process path of ssn-installer 2018-10-08 21:21:09 +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
LICENSE 📄 Add license 2018-10-07 16:16:18 +02:00
package-lock.json 👷‍♂️ Include ssn-installer as a dependency 2018-10-08 21:14:15 +02:00
package.json 👷‍♂️ Include ssn-installer as a dependency 2018-10-08 21:14:15 +02:00
README.md 👷‍♂️ Include ssn-installer as a dependency 2018-10-08 21:14:15 +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:

sudo npm install -g typescript tslint

Install dependencies and transpile the TypeScript files to JavaScript by running:

npm install && npm start

For a better command line experience, add the following to your ~/.bashrc file:

alias swtor_install='node /path/to/installation/patcher/dist/installPatch.js'

complete -W 'assets_swtor_de_de assets_swtor_en_us assets_swtor_fr_fr assets_swtor_main assets_swtor_test_de_de assets_swtor_test_en_us assets_swtor_test_fr_fr assets_swtor_test_main eualas movies_de_de movies_en_us movies_fr_fr patcher2014 patcher2017 retailclient_liveqatest retailclient_swtor retailclient_publictest' 'swtor_install'

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/getSolidPkgZip.js assets_swtor_main 126 127
node dist/installPatch.js assets_swtor_main 126 127
swtor_install assets_swtor_main 126 127

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);
}())

License

Copyright (C) 2018 Jedipedia.net

This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License along with this program. If not, see https://www.gnu.org/licenses/.

Introduction

SWTORs patcher uses technology licensed from Solid State Networks (SSN). However, SWTOR does not use the GUI software from SSN; instead the developers wrote their own patch deploy pipeline which interfaces with the command line tools from SSN.

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 a future patch before it is released.

Instead of 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.

  • yproducty: SWTOR is split into multiple products. That way, you can choose to only install part of SWTOR. For example, if you install the products yassets_swtor_mainy and yassets_swtor_en_usy, you only have the English-language live client files and no other languages and no PTS.
  • yreleasey: Colloquially, this is known as a “patch” or “Game Update”. For example, release y264y in product yassets_swtor_mainy refers to Game Update 5.2.0. However, not every release can be mapped to a “patch”; sometimes there are multiple releases between two actual “patches”, e.g. because of build errors or because they need to add a hotfix via another release before the “patch” can be pushed to the live servers. A release is always an integer starting at y0y.
  • ypatchy: In the SSN sense, a patch refers to the difference between two releases. For example, y263to264y is a patch that can be used to update a product from release y263y to release y264y. The first number is called yfromy while the second number is ytoy. In order to install a patch, the release given in the yfromy number must already be installed on your disk, with one exception: If the yfromy number is y-1y, e.g. in patch y-1to0y, the patch does not store the differences but it has full file contents to allow for a fresh install.
  • yenvironmenty: An environment consists of multiple products. For example, the live environment (yswtory) has products like yassets_swtor_mainy while the PTS environment (ypublictesty) has yassets_swtor_test_mainy.
  • ymanifesty: 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 sections. 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 lack of HTTPS is not an issue since 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

In cases where the environment is part of the product name, the URL is slightly different since there is a folder for the environment: http://cdn-patch.swtor.com/patch/${environment}/${product}/${product}_${from}to${to}.solidpkg

Appendix

Environments used by SWTOR

Currently, the following three environments are used:

  • swtor: The live game, including the European and North American servers. Open to all players and the default environment when logging into the launcher.
  • publictest: The Public Test Server to allow players to test upcoming content. Open to players most of the time, unless the testing is under NDA, in which case only accounts invited to the test have access.
  • liveqatest: The environment where QA can test upcoming patches before they are deployed to the live servers. Not accessible to players.

Previously, the following environments were also used:

  • betatest: The client used during the closed beta (2011 and earlier) to play the game.
  • cstraining: No longer used.
  • liveeptest: No longer used.
  • squadron157: The client used during the early closed beta by the Squadron157 testing group to play the game.

Products used by SWTOR

SWTOR uses the following products:

  • assets_swtor_de_de: German language files for the live environment.
  • assets_swtor_en_us: English language files for the live environment.
  • assets_swtor_fr_fr: 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 but still available for download.
  • patcher2017: Current version of the launcher, used to download and install patches.
  • retailclient_{environment}: The client used to play the game, e.g. retailclient_swtor or retailclient_publictest.

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

  • biomon_{environment}: The Biomongoose tool, possibly to monitor performance like CPU and memory usage.
  • byftools_{environment}: Unknown tools ByfTools and iPen, might be related to Photoshop or other designer tools.
  • heroblade_{environment}: The IDE used for editing the game, either by placing new objects into the game world or editing scripts.
  • morpheme_{environment}: Morpheme is a middleware used for character animations. Only available in the cstraining and liveqatest environments.
  • patcher: The old launcher before the 2014 revamp. No longer in use.
  • playerclient_{environment}: A client to play the game, used by the devs instead of retailclient. Has a console and integrates with HeroBlade.
  • repositoryassistant_{environment}: unknown
  • repositorybrowser_{environment}: The repository browser interfaces with HeroBlade to load 3D models, textures and other assets.
  • toolshub_{environment}: Used to launch more tools; most likely SpeedTree, WWise and other middleware.
  • visualizer_{environment}: Also known as VANViewer; possibly the tool mentioned by Georg Zoeller in his 2011 GDC talk.