apugh / realm-api-docs

Central collaboration point for HiRez Realm Royale Game API definition.
21 stars 8 forks source link

PS4/Xbox #36

Closed Negativitet closed 5 years ago

Negativitet commented 5 years ago

Is PS4/XB1 users available in the API yet?

apugh commented 5 years ago

Yes, I'm adding 3 fields to getPlayer() to help make the distinction

portal (Hi-Rez, Steam, PSN, Xbox) portal_id portal_userid

Negativitet commented 5 years ago

So we only send into getPlayer() the display name and then check which portal it returns, gotcha =)

Negativitet commented 5 years ago

Hi again! Noticed something that might be a problem: Searching a name on the PSN/Xbox portal can at some times give the first matching Steam player ID on that name.

Example: Xbox Gamertag: Julie Should return HiRez Player ID: 5261617 Just sending it into the getPlayer() with portal Xbox seem to return a steam users ID.

// Joakim

apugh commented 5 years ago

Good catch.

Should now be fixed.

Negativitet commented 5 years ago

Hi again @apugh there still seems to be some issue with this :/

Running getPlayer() on username adammanson on PSN returns 7857945 but from everything I can see it should return 5460555

// Joakim

apugh commented 5 years ago

hmm ... adammanson isn't enough to uniquely identify this player because that value is a gamer_tag for both PSN (portal_id = 9, player_id 5460555 ) and Discord (portal_id = 25, player_id 7857945).

How did you know that 5460555 was correct/desired? Can you use that in your calls? Otherwise we may need to add an optional portal_id field to the getPlayer() call for Realm.

Negativitet commented 5 years ago

I searched for adammanson on trackernetwork and they returned both PSN 5460555 and Discord 7857945 and as I wanted the PSN I choose the PSN one.

However when I tell the getPlayer endpoint to search for "adammanson/PSN" it returns the ID 7857945 and not 5460555

Should I do it another way?

apugh commented 5 years ago

I've ordered it to give PSN priority over Discord. Beyond that I'll need to make some changes to the API inline with SMITE & Paladins.

Negativitet commented 5 years ago

Is there a better way to find the correct ID instead of specifying which platform you want, maybe as an array result with each platform ID it could find the user on that I can traverse to find the PSN/XBOX/Steam ID for every new users that connects?

Since the fix you did it is return the correct ID. But what happens if the same username exists for all 4 platforms Steam/Xbox/PSN/Discord, which one will it return?

apugh commented 5 years ago

Currently, if you specify playerIdType as Steam it will definitely be Steam.

If not explicitly Steam the order is portal_id, 1, 9, 10, 22, 25 (PC, PSN, Xbox, Switch, Discord) depending on what exists.

Let me think about how to improve this.

Negativitet commented 5 years ago

Suggestion would be Instead of a priority order I would recommend returning all matches on the searched name and their respective platforms. Then we can select the ID to use from the list.

apugh commented 5 years ago

For consistency with SMITE/Paladins, I've added these 3 endpoints to Realm:

I didn't want the Realm logic to diverge to much from the other 2 APIs.

I will update this github endpoint documentation today with additional details.

In short, you could have found adammanson with this type of call:

http://api.realmroyale.com/Realmapi.svc/getplayeridsbygamertagjson/xxx/yyy/zzz/20190221162102/9/adammanson

Negativitet commented 5 years ago

That seems to work great! Thanks for that =)