Rainbow Six Seige SDK
This is an unofficial node SDK for Rainbow Six Seige
Installation
> npm install @proak/r6s-sdk
Usage
const { Auth } = require('@proak/r6s-sdk')
const auth = new Auth({ email: 'john.doe@example.com', password: '1234589' })
// connect to ubisoft
await auth.connect()
API
Auth
constructor(options)
Parameter | Required | Description |
---|---|---|
options.token | false | Token to be used when connecting to ubisoft |
options.email | false | Email to be used when authenticating with ubisoft. This is required along with password if options.token is not passed |
options.password | false | Password to be used in authenticating with ubisoft. This is required along with email if options.token is not passed |
options.cacheTime | false | Time in milliseconds to keep cache. defaults to 12000
|
options.maxConnectionRetries | false | Number of times to retry failed requests. Defaults to 1 |
options.appId | false | id of app. Defaults to 39baebad-39e5-4552-8c25-2c9b919064e2
|
Example:
const { Auth } = require('@proak/r6s-sdk')
const auth = new Auth({
cacheTime: 50000,
maxConnectionRetries: 3,
email: 'john.doe@example.com',
password: '5dio80bCIVOW.!bo~?'
})
//=> Auth Instance
connect()
Parameter | Required | Description |
---|
Example:
const { Auth } = require('@proak/r6s-sdk')
const auth = new Auth({ email: 'john@doe.com', password: 'TGsieo280?!-' })
await auth.connect()
getPlayer(options)
Parameter | Required | Description |
---|---|---|
options.uid | false | UID of player to retrieve. Must not be set at the same time as options.name as search can be done by only one of them |
options.name | false | name of player to retrieve. Must not be set at the same time as options.uid as search can be done by only one of them |
options.platform | true | platform type of player |
Example:
const { Auth } = require('@proak/r6s-sdk')
const auth = new Auth({ email: 'john@doe.com', password: 'TGsieo280?!-' })
await auth.getPlayer({ name: 'JUNE' })
// => Player Instance
getOperatorDefinitions()
Parameter | Required | Description |
---|
Example:
const { Auth } = require('@proak/r6s-sdk')
const auth = new Auth({ email: 'john@doe.com', password: 'TGsieo280?!-' })
await auth.getOperatorDefinitions()
getOperatorIndex()
Parameter | Required | Description |
---|---|---|
name | true | Name of operator to retrieve |
Example:
const { Auth } = require('@proak/r6s-sdk')
const auth = new Auth({ email: 'john@doe.com', password: 'TGsieo280?!-' })
await auth.getOperatorIndex('smoke')
// Result
{
id: 'smoke',
index: '2:1',
category: 'def',
name: { oasisId: '62253' },
ctu: { oasisId: '62015' },
figure: {
small: 'assets/images/small-smoke.2726e3087231686a.png',
large: 'assets/images/large-smoke.1bf9006654c09ba6.png'
},
mask: 'assets/images/mask-smoke.c84491688f294f51.png',
badge: 'assets/images/badge-smoke.874e98880d03a204.png',
uniqueStatistic: {
pvp: {
statisticId: 'operatorpvp_smoke_poisongaskill:2:1',
label: { oasisId: '194660' }
},
pve: {
statisticId: 'operatorpve_smoke_poisongaskill:2:1',
label: { oasisId: '194660' }
}
}
}
getOperatorStatistic()
Parameter | Required | Description |
---|---|---|
name | true | Name of operator to retrieve statistics |
Example:
const { Auth } = require('@proak/r6s-sdk')
const auth = new Auth({ email: 'john@doe.com', password: 'TGsieo280?!-' })
const statistic = await auth.getOperatorStatistic('smoke')
//=> operatorpvp_smoke_poisongaskill:2:1
getOperatorBadge()
Parameter | Required | Description |
---|---|---|
name | true | Name of operator to retrieve badge |
Example:
const { Auth } = require('@proak/r6s-sdk')
const auth = new Auth({ email: 'john@doe.com', password: 'TGsieo280?!-' })
const badge = await auth.getOperatorBadge('smoke')
//=> assets/images/badge-smoke.874e98880d03a204.png
getObjectIndex()
Parameter | Required | Description |
---|---|---|
key | true | key of definition to retrieve object index |
Example:
const { Auth } = require('@proak/r6s-sdk')
const auth = new Auth({ email: 'john@doe.com', password: 'TGsieo280?!-' })
const objectIndex = await auth.getObjectIndex('operatorpve_headshot:5:1')
//=> 5:1
Player
To get a particular player, you need to have have authenticated with ubisoft using the Auth
class and returned the auth
instance. Then you can call .getPlayer
on auth. For example:
const { Auth } = require('@proak/r6s-sdk')
const auth = new Auth({ email: 'john@doe.com', password: 'TGsieo280?!-' })
const player = await auth.getPlayer({ name: 'JUNE.KR' })
//=> Player Instance
The player instance has a number of useful member methods. which are described below:
loadLevel()
This method loads the player's Xp and level
Parameter | Required | Description |
---|
Example:
const player = await auth.getPlayer({ name: 'JUNE.KR', platform: 'uplay' })
await player.loadLevel()
//=> Player { xp: 28402, level: 74 }
checkLevel()
This method checks' the player's XP and level, only loading it if it has not been loaded yet
Parameter | Required | Description |
---|
Example:
const player = await auth.getPlayer({ name: 'JUNE.KR', platform: 'uplay' })
await player.checkLevel()
//=> Player Instance updated with `xp` and `level`
loadRank()
This method loads a player's rank for a specific region and season
Parameter | Required | Description |
---|---|---|
options.region | true | The name of the region you want to get the rank for |
options.season | false | The season you want to get the rank for. Defaults to -1 |
Example:
const player = await auth.getPlayer({ name: 'JUNE.KR', platform: 'uplay' })
await player.loadRank({ region: 'emea' })
//=> Player Instance updated rank details
getRank()
This method checks for a player's rank for a particular region, only loading it if it is not already loaded
Parameter | Required | Description |
---|---|---|
options.region | true | The name of the region you want to get the rank for |
options.season | false | The season you want to get the rank for. Defaults to -1 |
Example:
const player = await auth.getPlayer({ name: 'JUNE.KR', platform: 'uplay' })
await player.getRank({ region: 'emea' })
//=> Player Instance updated rank details
loadAllOperators()
This method loads the player stats for all operators
Parameter | Required | Description |
---|
Example:
const player = await auth.getPlayer({ name: 'JUNE.KR', platform: 'uplay' })
await player.loadAllOperators()
//=> Player instance with all operators stats loaded
getAllOperators()
This method checks player stats for all operators, loading them all again if they are not found.
Parameter | Required | Description |
---|
Example:
const player = await auth.getPlayer({ name: 'JUNE.KR', platform: 'uplay' })
await player.getAllOperators()
//=> Player instance with all operators stats loaded
loadOperator()
This method loads the player stats for the operator
Parameter | Required | Description |
---|---|---|
name | true | The name of the operator |
Example:
const player = await auth.getPlayer({ name: 'JUNE.KR', platform: 'uplay' })
const operator = await player.loadOperator('smoke')
//=> Operator Instance
getOperator()
This method gets the player stats for the operator, only loading it if it is not already loaded
Parameter | Required | Description |
---|---|---|
name | true | The name of the operator |
Example:
const player = await auth.getPlayer({ name: 'JUNE.KR', platform: 'uplay' })
const operator = await player.getOperator('smoke')
//=> Operator Instance