Getting information on an UberId (from outside the game)

Discussion in 'Mod Support' started by Raevn, November 20, 2014.

  1. Raevn

    Raevn Moderator Alumni

    Messages:
    4,226
    Likes Received:
    4,324
    I need to get the display name of an UberId via a GET call to a URL from javascript running outside of PA. From the ladder, I found the following bit of code:

    Code:
    var query = 'UberIds=' + uberIds.join('&UberIds=');
    engine.asyncCall('ubernet.call', '/GameClient/UserNames?' + query, false)
        .done(function (data) {
            var result = JSON.parse(data);
            _.forOwn(result.Users, function(user, uberid) {
                if (!_.isEmpty(user.TitleDisplayName))
                    self.displayNames[uberid](user.TitleDisplayName);
                else
                    self.displayNames[uberid](user.UberName);
            });
        })
    So it looks like I should be able to call

    http://<something>/GameClient/UserNames?UberIds=[uberID]

    then use data.TitleDisplayName or data.UberName. However, I can't tell what <something> is. I've tried "http://4.uberent.com/" (which is what the ladder data is retrieved from), but no luck.

    Context:
    Trying to get player names from the ladder information pulled from
    http://4.uberent.com/MatchMaking/GetRankLeaderboard?GameType=Ladder1v1&TitleId=4&Rank=1
    which only gives UberIds.

    upload_2014-11-20_23-17-16.png
    Fr33Lancer likes this.
  2. cptconundrum

    cptconundrum Post Master General

    Messages:
    4,186
    Likes Received:
    4,900
    @yrrep Would probably know the most about this. A quick look at it with Wireshark seems to be trying to tell me that it's not using HTTP, but I could be missing it.
  3. cola_colin

    cola_colin Moderator Alumni

    Messages:
    12,074
    Likes Received:
    16,221
    It's https, but you can guess what is and how to use it by looking at the internals of pa.exe and a bit of guessing.

    An example curl session looks like this:
    Code:
    curl --data '{TitleId: 4, AuthMethod: "UberCredentials", UberName: "<playfab-user>", Password: "<playfab-pass>"}' --header "Content-Type: application/json" https://uberent.com/GC/Authenticate
    
    returns something like:

    Code:
    {"SessionTicket":"<session-ticket>", ....}
    
    Code:
    curl --header "X-Authorization: <session ticket>" https://uberent.com/GameClient/UserNames?UberIds=123
    
    returns

    Code:
    {"Users":{"123":{"UberName":"ubername","TitleDisplayName":"displayname"}}}
    
    Raevn, yrrep and cptconundrum like this.
  4. Raevn

    Raevn Moderator Alumni

    Messages:
    4,226
    Likes Received:
    4,324
    Ah thanks :).

    upload_2014-11-23_20-33-59.png
    cola_colin likes this.
  5. cola_colin

    cola_colin Moderator Alumni

    Messages:
    12,074
    Likes Received:
    16,221
    Observation: If I start PA directly without logging in it still shows the leaderboard with names.
    Either it is cached or there is a way to get the names without authorization.
  6. Raevn

    Raevn Moderator Alumni

    Messages:
    4,226
    Likes Received:
    4,324
    Yep, they changed it so you no longer need to logon :)

    Nope, spoke too soon.
    Last edited: November 26, 2014
  7. Mereth

    Mereth Active Member

    Messages:
    330
    Likes Received:
    164
  8. Raevn

    Raevn Moderator Alumni

    Messages:
    4,226
    Likes Received:
    4,324
    Ok, now I'm just confused. That's what I thought in the post above, then I tried it on a browser I wasn't logged into the forums on, and it didn't work. Now I try again and it does o_O:p

    Edit: Turns out I was missing the TitleId=4 parameter - this is contained within the session, so it's not needed when you are logged in, hence why it worked before.

    Ladder being shown when not yet logged in:
    upload_2014-11-28_7-43-30.png
    Last edited: November 28, 2014

Share This Page