1.10931.1 • Published 9 months ago

ubisoft-demux v1.10931.1

Weekly downloads
-
License
MIT
Repository
github
Last release
9 months ago

ubisoft-demux-node

npm GitHub Workflow Status

The Ubisoft Connect game launcher uses a bespoke socket-level protocol sending protocol buffer encoded messages to perform the majority of its core functionality. This package implements the Demux protocol and assists with communicating directly with the Demux API.

Usage

The package is well documented with JSDoc and TypeScript. Hovering and IntelliSense should give you plenty of information on each function. The types for the protobuf data are undocumented as of now due to being internal Ubisoft knowledge.

You should be using this package guided by knowledge gained from reverse engineering requests in the Ubisoft Connect launcher. It is very low level and you can easily do things out of order as the Demux API is not meant to be directly consumed by users.

Demux API

Send a basic request

Basic requests contain a requestId that must increment with each request. This method keeps track of all requests and manages the requestId for you.

import { UbisoftDemux } from 'ubisoft-demux';
const ubiDemux = new UbisoftDemux();
const resp = await ubiDemux.basicRequest({
    getPatchInfoReq: {
        patchTrackId: 'DEFAULT',
        testConfig: false,
        trackType: 0,
    },
});

Send a service request

A service is a set of requests restricted to a certain domain's data model. This package will keep track of a request's service type and decode it appropriately.

import { UbisoftDemux } from 'ubisoft-demux';
const ubiDemux = new UbisoftDemux();
const resp = await ubiDemux.serviceRequest('utility_service', {
    request: {
        geoipReq: {},
    },
});

Use a service connection

Most service interactions occur through an open "connection". This package will open a connection and manage incrementing its connection requestId.

import { UbisoftDemux } from 'ubisoft-demux';
const ubiDemux = new UbisoftDemux();
const connection = await ubiDemux.openConnection('ownership_service');
const resp = await connection.request({
    request: {
        requestId: 1,
        initializeReq: {
            getAssociations: true,
            protoVersion: 7,
            useStaging: false,
        },
    },
});

Authentication

You can authenticate with the Demux API using a login ticket obtained from the UbiServices HTTP API. See below for more on it.

import { UbisoftDemux } from 'ubisoft-demux';
const ubiDemux = new UbisoftDemux();
await ubiDemux.basicRequest({
    authenticateReq: {
        clientId: 'uplay_pc',
        sendKeepAlive: false,
        token: {
            ubiTicket: `<your ticket here>`,
        },
    },
});

Errors

The Demux API does not return errors. If you do something wrong, you will just see a timeout error. The default timeout is 10 seconds.

UbiServices API

Ubisoft's HTTP REST API is out of the scope of this package, but it contains some basic requests that are complementary to the Demux API.

Login

Currently only supports fresh login without 2FA.

import { UbiServicesApi } from 'ubisoft-demux';
const ubiServices = new UbiServicesApi();
const { ticket } = await ubiServices.login(email, password);

File Parser

Since many of Ubisoft Connect's local files are also protobuf format, this package can also decode many of them.

import { UbisoftFileParser } from 'ubisoft-demux';
const data = readFileSync(`%LOCALAPPDATA%/Ubisoft Game Launcher/user.dat`);
const fileParser = new UbisoftFileParser();
const result = fileParser.parseUserDat(data);

Use IntelliSense to see all the available file parsers.

How to get the .proto's

Only needed if you need to update the protos

  1. Follow steps 1-3 of this guide.
  2. Copy the protos folder to ./proto

How to capture and decode Ubisoft Connect Demux requests

Follow the documentation on ubisoft-dmx-decode

1.10931.1

9 months ago

1.10872.0

1 year ago

1.10894.0

1 year ago

1.10931.0

1 year ago

1.10906.0

1 year ago

1.10887.0

1 year ago

1.10824.0

2 years ago

1.10807.0

2 years ago

1.10811.0

2 years ago

1.10857.0

2 years ago

1.10836.0

2 years ago

1.10799.0

2 years ago

1.10753.1

2 years ago

1.10773.0

2 years ago

1.10783.0

2 years ago

1.10786.0

2 years ago

1.10773.1

2 years ago

1.10731.2

2 years ago

1.10731.1

2 years ago

1.10731.0

2 years ago

1.10753.0

2 years ago

1.10715.0

2 years ago

1.10702.0

2 years ago

1.10690.7

2 years ago

1.10690.6

2 years ago

1.10690.5

2 years ago

1.10690.4

2 years ago

1.10690.3

2 years ago

1.10690.2

2 years ago

1.10690.1

2 years ago

1.10690.0

2 years ago

1.0.0

3 years ago