danielwerg / r6api.js

🍫 Node.js wrapper around Rainbow Six Siege APIs
https://npm.im/r6api.js
MIT License
109 stars 19 forks source link

Implement "profiles/gamesplayed endpoint #81

Open BadCoder1337 opened 2 years ago

BadCoder1337 commented 2 years ago

Underlying endpoint returns only Uplay (id f68a4bb5-608a-4ff2-8123-be8ef797e0a6) and nothing about R6 Extraction (id 5033bfb3-8a2e-4748-93e5-2ffa82975a85, codename Pioneer PC) or R6 Siege (id e3d5ea9e-50bd-43b7-88bf-39794f4e3d40) profiles is under a year old. We need to update the documentation, mark getProfileApplications as deprecated and discourage usage.

BadCoder1337 commented 2 years ago

There's a working alternative https://public-ubiservices.ubi.com/v1/profiles/{profileId}/gamesplayed https://public-ubiservices.ubi.com/v1/profiles/gamesplayed?profileIds={profileIds}

danielwerg commented 2 years ago

Underlying endpoint returns only Uplay id

It will if profileId never launched anything else, it does return correct data for uplay launcher and siege for my account, not sure about extraction

profiles is under a year old

not sure what that means

On top of that, gamesplayed endpoint only returns appId and nothing else, I use lastDatePlayed in several of my projects, so it wouldn't be a sufficient alternative.

BadCoder1337 commented 2 years ago

This is getProfileApplications for my profile. (I truncated some crap from 2018)

{
  "id": "c09fc7c9-5d45-4c6c-94e5-2dee159abff3",
  "applications": [
    {
      "id": "a427a342-56bb-437b-b835-fa695c75893b",
      "name": "Tom Clancy's Rainbow Six Siege - Test Server",
      "platform": "PC",
      "sessionsPlayed": 53,
      "daysPlayed": 20,
      "lastPlayedAt": "2020-10-10T19:40:18.197Z",
      "firstPlayedAt": "2017-05-19T14:59:46.804Z"
    },
    {
      "id": "e3d5ea9e-50bd-43b7-88bf-39794f4e3d40",
      "name": "Tom Clancy's Rainbow Six Siege",
      "platform": "PC",
      "sessionsPlayed": 1431,
      "daysPlayed": 786,
      "lastPlayedAt": "2021-02-03T19:43:21.239Z",
      "firstPlayedAt": "2016-02-07T12:15:41.606Z"
    },
    {
      "id": "f68a4bb5-608a-4ff2-8123-be8ef797e0a6",
      "name": null,
      "platform": null,
      "sessionsPlayed": 1174,
      "daysPlayed": 959,
      "lastPlayedAt": "2022-01-20T05:08:19.948Z",
      "firstPlayedAt": "2016-02-07T12:09:26.631Z"
    }
  ]
}

I obviously played Siege till the end of 2021, but info frozen on February. Also there's no Extraction which i played today.

danielwerg commented 2 years ago

Oh yeah, you are right, it doesn't update siege. I will still keep because in 99% uplay lastPlayed and siege lastPlayed are the same thing.

BadCoder1337 commented 2 years ago

It's worth to mention. Also worth to implement the getGamesPlayed method if someone would ensure that a user has a game.

danielwerg commented 2 years ago

I don't really have a use case for that nor motivation right now, but If you want to do that I will review a pr.