Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HELP WANTED – Endpoint for Ranked 2.0 & Operation: Solar Raid #91

Closed
SwiftCODA opened this issue Dec 8, 2022 · 27 comments
Closed

HELP WANTED – Endpoint for Ranked 2.0 & Operation: Solar Raid #91

SwiftCODA opened this issue Dec 8, 2022 · 27 comments

Comments

@SwiftCODA
Copy link
Contributor

SwiftCODA commented Dec 8, 2022

The XHR requests on the Ubisoft stats tracker website are making requests for all 28 seasons, and returning data for all except 28, the current one. Does anyone know of a new endpoint for seasonal ranked stats with skill / rank value / hidden mmr and whatever else they added in the Ranked 2.0 update?

Information:
Ubisoft Web Stats XHR/Fetch Requests:
player_skill_records:
method: GET
host: public-ubiservices.ubi.com
path: /v1/spaces/05bfb3f7-6c21-4c42-be1f-97a33fb5cf66/sandboxes/OSBOR_PS4_LNCH_A/r6karma/player_skill_records
parameters:

  • board_ids: pvp_ranked
  • season_ids: -1,-2,-3,-4,-5,-6,-7,-8,-9,-10,-11,-12,-13,-14,-15,-16,-17,-18,-19,-20,-21,-22,-23,-24,-25,-26,-27,-28 (-1 would be the current season, -2 would be the one before it, -28 would be Season 1.
  • region_ids: ncsa
  • profile_ids: 13a81b0c-1107-4449-8adb-9ae06c09d28a (Random leaderboard player on PSN who has data for season 28)
    headers:
  • Authorization: ubi_v1 t={MY_TOKEN}
  • User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.1 Safari/605.1.15
  • Ubi-AppId: {MY_UBI_APP_ID}
  • Ubi-SessionId: {MY_UBI_SESSION_ID}
  • Connection: keep-alive
    response:
    (An array of object like this one. The -1 season corresponds to this object)
{
   "season_id":27,
   "regions_player_skill_records":[
      {
         "region_id":"ncsa",
         "boards_player_skill_records":[
            {
               "board_id":"pvp_ranked",
               "players_skill_records":[
                  {
                     "max_mmr":0,
                     "skill_mean":25,
                     "deaths":0,
                     "profile_id":"13a81b0c-1107-4449-8adb-9ae06c09d28a",
                     "next_rank_mmr":0,
                     "rank":0,
                     "max_rank":0,
                     "board_id":"pvp_ranked",
                     "skill_stdev":8.334,
                     "kills":0,
                     "last_match_skill_stdev_change":0,
                     "past_seasons_wins":0,
                     "update_time":"1970-01-01T00:00:00+00:00",
                     "last_match_mmr_change":0,
                     "abandons":0,
                     "season":27,
                     "past_seasons_losses":0,
                     "top_rank_position":0,
                     "last_match_skill_mean_change":0,
                     "mmr":2500,
                     "previous_rank_mmr":0,
                     "last_match_result":0,
                     "past_seasons_abandons":0,
                     "wins":0,
                     "region":"ncsa",
                     "losses":0
                  }
               ]
            }
         ]
      }
   ]
},
{
   "season_id":-28,
   "regions_player_skill_records":[]
}

It appears the server is seeing a request for stats for the season which was 27 seasons ago (-28), and saying "hmm... we don't have stats for a season this far back", which makes sense, considering that -1 returns season 27, and not 28.

This proves that the player_skill_records endpoint's data source does not contain information for season 28.

The other request made:
players:
method: GET
host: public-ubiservices.ubi.com
path: /v1/spaces/05bfb3f7-6c21-4c42-be1f-97a33fb5cf66/sandboxes/OSBOR_PS4_LNCH_A/r6karma/players
parameters:

  • board_id: pvp_ranked
  • season_id: -1 (Should return the current season, 28)
  • region_id: ncsa
  • profile_ids: 13a81b0c-1107-4449-8adb-9ae06c09d28a
    headers:
  • Authorization: ubi_v1 t={MY_TOKEN}
  • User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.1 Safari/605.1.15
  • Ubi-AppId: {MY_UBI_APP_ID}
  • Ubi-SessionId: {MY_UBI_SESSION_ID}
  • Connection: keep-alive
    response:
{
   "players":{
      "13a81b0c-1107-4449-8adb-9ae06c09d28a":{
         "max_mmr":0,
         "skill_mean":25,
         "deaths":0,
         "profile_id":"13a81b0c-1107-4449-8adb-9ae06c09d28a",
         "next_rank_mmr":0,
         "rank":0,
         "max_rank":0,
         "board_id":"pvp_ranked",
         "skill_stdev":8.334,
         "kills":0,
         "last_match_skill_stdev_change":0,
         "past_seasons_wins":0,
         "update_time":"1970-01-01T00:00:00+00:00",
         "last_match_mmr_change":0,
         "abandons":0,
         "season":27,
         "past_seasons_losses":0,
         "top_rank_position":0,
         "last_match_skill_mean_change":0,
         "mmr":2500,
         "previous_rank_mmr":0,
         "last_match_result":0,
         "past_seasons_abandons":0,
         "wins":0,
         "region":"ncsa",
         "losses":0
      }
   }
}

Notice the "season" value is 27, even though we passed in -1 to fetch the current season, 28.

This proves that the players endpoint's data source does not contain information for season 28.

EDIT:
The original endpoints we were using before Neon Dawn for seasonal data do not work for season 28 either.
Screen Shot 2022-12-08 at 3 47 54 PM

@Us3r-3C29x
Copy link

https://tabstats.com/ has the data for season 28, so I dont know

@SwiftCODA
Copy link
Contributor Author

https://tabstats.com/ has the data for season 28, so I dont know

So does TRN. But yet the actual tracker on the Ubi site is broken. Empty arrays in the response and uncaught exception errors too. I will probably hop on the PC R6 and intercept the HTTP requests to see if there's anything new there...

@BadCoder1337
Copy link

While I have been trying to discover new endpoints I found an awesome guide for intercepting Ubisoft Connect network activity. But it doesn't work for game client since it utilizes a separate network stack over Winsock2. To intercept game client requests you should unpin SSL cert. It's possible with some Cheat Engine magic which I found here https://www.unknowncheats.me/forum/3113434-post11501.html. I'm read-only on the forum, so I can't contact the author.

@Us3r-3C29x
Copy link

Any updates?

@BadCoder1337
Copy link

Ubisoft re-enabled unique builds to prevent cheat development, and as a side effect, also my API research. I'm waiting for community to resolve this.

@Us3r-3C29x
Copy link

https://github.com/hmes98318/r6s-stats-api

He updated to rank 2.0, somebody may have a look on it. I dont currently have time

@BadCoder1337
Copy link

https://github.com/hmes98318/r6s-stats-api

He updated to rank 2.0, somebody may have a look on it. I dont currently have time

He is fetching r6.tracker.network, which have received API endpoints from Ubisoft.
Relying on an additional 3rd party is not a solution.

@SwiftCODA SwiftCODA changed the title New endpoint for seasonal ranked data? HELP WANTED – Endpoint for Ranked 2.0 & Operation: Solar Raid Dec 19, 2022
@SwiftCODA
Copy link
Contributor Author

Ubisoft re-enabled unique builds to prevent cheat development, and as a side effect, also my API research. I'm waiting for community to resolve this.

Is this resulting in you not being able to sniff HTTPS requests? I attempted to use the Postman HTTPS interception tool last night and normal HTTPS traffic was working fine in browser, but the Ubisoft Connect app didn't like it.

We need to dedicate some time and resources to this as soon as possible. This is causing lots of downtime for my (and probably many of your guys) services and resulting in a loss of revenue.

Please share this issue around with people who can help out. Thanks, and good luck.

@SwiftCODA
Copy link
Contributor Author

@Seems2Legit do you recall any methods you used way back in the beginning to find the endpoints you currently have coded?

This was referenced Dec 20, 2022
@BadCoder1337
Copy link

BadCoder1337 commented Dec 20, 2022

Is this resulting in you not being able to sniff HTTPS requests?

Again, you can't intercept game and Ubisoft Connect HTTPS queries with trivial mitm tools. Both use SSL pinning, but in various ways. For Ubisoft Connect you can dump keys from lsass.exe and decrypt packets in Wireshark. The game is using separate request library built with OpenSSL and Winsock.
When unique builds were activated I was unable to disable BattlEye to attach a debugger. Now I got a configuration to disable it so I can move forward.
I saw desired batch rank query paths, but still can't figure how to use it without a full request.

@SwiftCODA
Copy link
Contributor Author

I saw desired batch rank query paths, but still can't figure how to use it without a full request.

Would you be able to share any information you came / will come across here? I'm confident that we can come to a resolution if we all work together with little bits and pieces we find individually.

@floxay
Copy link

floxay commented Dec 21, 2022

use /v1/spaces/0d2ae42d-4c27-4cb7-af6c-2099062302bb/sandboxes/OSBOR_XPLAY_LNCH_A/

image

@danielwerg
Copy link

use /v1/spaces/0d2ae42d-4c27-4cb7-af6c-2099062302bb/sandboxes/OSBOR_XPLAY_LNCH_A/

image

hmm, mmr and max_mmr value doesn't seem to much the ones from tabstats or r6.tracker for given profile. Also, do you happen to know how to get Rank Points value?

@BadCoder1337
Copy link

BadCoder1337 commented Dec 21, 2022

use /v1/spaces/0d2ae42d-4c27-4cb7-af6c-2099062302bb/sandboxes/OSBOR_XPLAY_LNCH_A/

This looks like an old ranked system running in parrallel with ranked 2.0.
I played 9 ranked matches and my rank is still zero (unranked), but I'm Copper 3 in terms of ranked 2.0.
Literally yesterday I discovered that there's a new spaceId for crossplay.

UPD: Confirmed. After 10th game I got Silver 3 with 2340 MMR. Just like the good old days.

@floxay
Copy link

floxay commented Dec 21, 2022

New /looking, not sure how new these actually are/ endpoints are under /v2.

For example for profiles use
https://public-ubiservices.ubi.com/v2/spaces/0d2ae42d-4c27-4cb7-af6c-2099062302bb/title/r6s/skill/full_profiles

profile_ids and platform_families query params have to be specified for this endpoint.

Response
{
    "platform_families_full_profiles": [
        {
            "board_ids_full_profiles": [
                {
                    "board_id": "casual",
                    "full_profiles": [
                        {
                            "profile": {
                                "board_id": "casual",
                                "id": "REMOVED",
                                "max_rank": 0,
                                "max_rank_points": 0,
                                "platform_family": "pc",
                                "rank": 0,
                                "rank_points": 0,
                                "season_id": 28,
                                "top_rank_position": 0
                            },
                            "season_statistics": {
                                "deaths": 0,
                                "kills": 0,
                                "match_outcomes": {
                                    "abandons": 0,
                                    "losses": 0,
                                    "wins": 0
                                }
                            }
                        }
                    ]
                },
                {
                    "board_id": "event",
                    "full_profiles": [
                        {
                            "profile": {
                                "board_id": "event",
                                "id": "REMOVED",
                                "max_rank": 0,
                                "max_rank_points": 0,
                                "platform_family": "pc",
                                "rank": 0,
                                "rank_points": 0,
                                "season_id": 28,
                                "top_rank_position": 0
                            },
                            "season_statistics": {
                                "deaths": 0,
                                "kills": 0,
                                "match_outcomes": {
                                    "abandons": 0,
                                    "losses": 0,
                                    "wins": 0
                                }
                            }
                        }
                    ]
                },
                {
                    "board_id": "warmup",
                    "full_profiles": [
                        {
                            "profile": {
                                "board_id": "warmup",
                                "id": "REMOVED",
                                "max_rank": 0,
                                "max_rank_points": 0,
                                "platform_family": "pc",
                                "rank": 0,
                                "rank_points": 0,
                                "season_id": 28,
                                "top_rank_position": 0
                            },
                            "season_statistics": {
                                "deaths": 0,
                                "kills": 0,
                                "match_outcomes": {
                                    "abandons": 0,
                                    "losses": 0,
                                    "wins": 0
                                }
                            }
                        }
                    ]
                },
                {
                    "board_id": "ranked",
                    "full_profiles": [
                        {
                            "profile": {
                                "board_id": "ranked",
                                "id": "REMOVED",
                                "max_rank": 1,
                                "max_rank_points": 1080,
                                "platform_family": "pc",
                                "rank": 1,
                                "rank_points": 1080,
                                "season_id": 28,
                                "top_rank_position": 0
                            },
                            "season_statistics": {
                                "deaths": 3,
                                "kills": 1,
                                "match_outcomes": {
                                    "abandons": 0,
                                    "losses": 0,
                                    "wins": 1
                                }
                            }
                        }
                    ]
                }
            ],
            "platform_family": "pc"
        }
    ]
}

Another one for profiles would be
https://public-ubiservices.ubi.com/v2/spaces/0d2ae42d-4c27-4cb7-af6c-2099062302bb/title/r6s/skill/detailed_ranked_profile

this needs platform_family (notice it's singular here!) and nb_past_seasons params to be specified

Response
{
    "archived_profiles": [],
    "full_profile": {
        "profile": {
            "board_id": "ranked",
            "id": "REMOVED",
            "max_rank": 1,
            "max_rank_points": 1080,
            "platform_family": "pc",
            "rank": 1,
            "rank_points": 1080,
            "season_id": 28,
            "top_rank_position": 0
        },
        "season_statistics": {
            "deaths": 3,
            "kills": 1,
            "match_outcomes": {
                "abandons": 0,
                "losses": 0,
                "wins": 1
            }
        }
    },
    "last_ranked_game_information": {
        "has_abandoned": false,
        "rank_points_update": {
            "demotion_shield_rank_points_saved": 0,
            "rank_points_after": 1080,
            "rank_points_before": 1000
        },
        "team_score": 1
    }
}

EDIT:

Headers used
  • ubi-appid: e3d5ea9e-50bd-43b7-88bf-39794f4e3d40
  • ubi-appbuildid: Y7S4.1_C7296873_D1550531_S49485_48690975_PROD
  • Authorization: Ubi_v1 t=YOUR-ENCODED-TICKET
  • Ubi-localeCode: en-US
  • ubi-populations: BattlePassSyncState.V2_Preconfirmed,BattlePassUI.Enabled,BinaryDistribution.Enabled,CommunityEvent.Live,DebugCamera.Disabled,GamePlay.FullPopulation,HighFrequencyEvents.NoSend,IsRecommenderServiceEnabled.RecommenderServiceEnabled,PopulationBasedChallenges.Group0,QC.LiveConfig,RemoteLogsV2.ByDefault,tg_CrashReport.UploadReport,Watermark.Enabled
  • ubi-sessionid: YOUR-SESSION-GUID
  • User-Agent: UbiServices_SDK_2020.Release.58_PC64_ansi_static

Not all of the above are required.

@SwiftCODA
Copy link
Contributor Author

use /v1/spaces/0d2ae42d-4c27-4cb7-af6c-2099062302bb/sandboxes/OSBOR_XPLAY_LNCH_A/

This looks like an old ranked system running in parrallel with ranked 2.0. I played 9 ranked matches and my rank is still zero (unranked), but I'm Copper 3 in terms of ranked 2.0. Literally yesterday I discovered that there's a new spaceId for crossplay.

UPD: Confirmed. After 10th game I got Silver 3 with 2340 MMR. Just like the good old days.

Did it update after 10 matches or after a time period?

@SwiftCODA
Copy link
Contributor Author

@floxay
Screenshot 2022-12-23 at 1 44 38 AM

Using your headers and parameters.

@aspriddell
Copy link

aspriddell commented Dec 23, 2022

I got this as well @SwiftCODA, if you re-authenticate but use the pc client app-id (e3d5ea9e-50bd-43b7-88bf-39794f4e3d40), the ticket you get should work properly. (edit: you'll need to keep two tickets working, one using the old app-id for the pre-existing urls and this one for the ones you're hitting errors with)

As for some other things I noticed, the full_profiles endpoint allows you to put any profile in and get data back but I found that detailed_ranked_profile only returned my profile (and only wanted the nb_past_seasons parameter). Neither of those two return previous seasons' information which is in line with what TRN has said

@SwiftCODA
Copy link
Contributor Author

(edit: you'll need to keep two tickets working, one using the old app-id for the pre-existing urls and this one for the ones you're hitting errors with)

Used the new appId, getting a good response now. However, on multiple profileIds, the data returned is basically zeroed out, all default stuff, even though TRN shows that the players have rank points, kills, etc.

@SwiftCODA
Copy link
Contributor Author

SwiftCODA commented Dec 24, 2022

(and only wanted the nb_past_seasons parameter).

@aspriddell
Screenshot 2022-12-23 at 10 34 05 PM

Need platform_family too. But you're right, it doesn't call for any profile_ids. Just returns data for the profile_id associated with the ticket.

@floxay
Copy link

floxay commented Dec 24, 2022

profile_ids param for /detailed_ranked_profile was an error on my part, probably left it there by accident when I copied the first endpoint's text, edited my comment above.

@SwiftCODA
Copy link
Contributor Author

(edit: you'll need to keep two tickets working, one using the old app-id for the pre-existing urls and this one for the ones you're hitting errors with)

Used the new appId, getting a good response now. However, on multiple profileIds, the data returned is basically zeroed out, all default stuff, even though TRN shows that the players have rank points, kills, etc.

Still unsure of above... Help is appreciated.

All responses I'm getting with the new spaceId path give me zeroed-out information, or "default" data. For example:
https://pastebin.com/kBYEsi1q
Using the headers:
Screenshot 2023-01-03 at 10 25 38 PM
Screenshot 2023-01-03 at 10 25 47 PM

@floxay @aspriddell @BadCoder1337

@aspriddell
Copy link

@SwiftCODA I've tried using the same headers you have and I can get some proper stats back.

image

I also did a check on the profile id you're using and also found it comes back blank. Does the id belong to a console account? I wouldn't be surprised if profile_ids is now misleading and it wants a set of ubisoft ids instead... (and all the ids I used have the same profile and ubisoft id)

@SwiftCODA
Copy link
Contributor Author

I also did a check on the profile id you're using and also found it comes back blank. Does the id belong to a console account? I wouldn't be surprised if profile_ids is now misleading and it wants a set of ubisoft ids instead... (and all the ids I used have the same profile and ubisoft id)

I recall the profileId I used above being one belonging to a random leaderboard champion player, not sure which platform.
For further testing, I am using the below information obtained from the below endpoint:
Screenshot 2023-01-04 at 10 46 40 AM
Screenshot 2023-01-04 at 10 46 34 AM

You can see the profileId and userId are only the same when the account is a uplay/pc account.

When using the new OSBOR_XPLAY_LNCH_A path, I get data when passing in a uplay profileId (the account's userId). Since the userId is synchronous between all sub-accounts on all platforms tied to a single Ubisoft account, the data returned should respect cross-progression.

Here, I use the userId shown above, in place of the profile_ids query param:
Screenshot 2023-01-04 at 10 52 18 AM
Screenshot 2023-01-04 at 10 53 08 AM

However, if you visit either:

@floxay
Copy link

floxay commented Jan 4, 2023

/v1/spaces/0d2ae42d-4c27-4cb7-af6c-2099062302bb/title/r6s/rewards/public_profile?profile_id=596a2b47-3df6-4c08-aa2c-5450f40900ae

{
    "level": 32,
    "xp": 7671
}

@SwiftCODA
Copy link
Contributor Author

@floxay You are an absolute g. ❤️💪

@SwiftCODA
Copy link
Contributor Author

Closing #91 with the following new information for developers:
This issue contains a large amount of information regarding new endpoints for Ubisoft's Rainbow Six: Siege stats service.
New endpoint data includes:

  • Rank points
  • Ranked 2.0 rank system
  • Ranked/Casual
  • Level/XP
  • Season 28 data (not preserved when future seasons release, as of now).

A big thank you to all contributors in this thread! Good luck with your projects, everyone.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants