r6db / app

https://r6db.app
MIT License
15 stars 3 forks source link

Implement game status #18

Open LaxisB opened 5 years ago

LaxisB commented 5 years ago

https://rainbow6.ubisoft.com/status/

[
    {
        "AppID": "e3d5ea9e-50bd-43b7-88bf-39794f4e3d40",
        "Category": "Instance",
        "Name": "Rainbow Six Siege - PC - LIVE",
        "Platform": "PC",
        "Status": "Degraded",
        "Maintenance": false
    },
    {
        "AppID": "fb4cc4c9-2063-461d-a1e8-84a7d36525fc",
        "Category": "Instance",
        "Name": "Rainbow Six Siege - PS4 - LIVE",
        "Platform": "PS4",
        "Status": "Online",
        "Maintenance": null
    },
    {
        "AppID": "4008612d-3baf-49e4-957a-33066726a7bc",
        "Category": "Instance",
        "Name": "Rainbow Six Siege - XBOXONE - LIVE",
        "Platform": "XBOXONE",
        "Status": "Online",
        "Maintenance": null
    }
]
Kllngii commented 5 years ago

A request to https://game-status-api.ubisoft.com/v1/instances?appIds=AppIdPC,AppIdPsN,AppIdXBX should do the job.

Kllngii commented 5 years ago

Maybe a file, located in r6api/src/commands/getStatus.ts, like this:

import { URLS } from '../ubicontants';

type UUID = string;

interface ISingleStatus {
    appId: UUID;
    category: string; //pointless
    platform: 'PC' | 'PS4' | 'XBOXONE';
    status: string;
    maintenance: string;
}

export interface IGetStatus {
    id: UUID; // the appId
    platform: string; // the platform
    status: string; // the status
    maintenance: string;
}

//The Request Method comes here