DestinyItemManager / DIM

Destiny Item Manager
https://destinyitemmanager.com
MIT License
2.08k stars 643 forks source link

Add XP Progress Post 40 to Character #254

Closed SunburnedGoose closed 8 years ago

SunburnedGoose commented 9 years ago

image

bhollis commented 8 years ago

Is this information available? In the character hash, all the level/exp progression stuff seems to just top out at 40.

SunburnedGoose commented 8 years ago

I haven't been able to find it. On Thu, Jan 21, 2016 at 10:42 PM Ben Hollis notifications@github.com wrote:

Is this information available? In the character hash, all the level/exp progression stuff seems to just top out at 40.

— Reply to this email directly or view it on GitHub https://github.com/DestinyItemManager/DIM/issues/254#issuecomment-173805104 .

kyleshay commented 8 years ago
function getGuardianProgressionRequest(token, platform, membershipId, character) {
  return {
    method: 'GET',
    url: 'https://www.bungie.net/Platform/Destiny/' + platform.type + '/Account/' + membershipId + '/Character/' + character.id + '/Progression/?definitions=false',
    headers: {
      'X-API-Key': apiKey,
      'x-csrf': token
    },
    withCredentials: true
  };
}

and then for getting the progressionHash for prestige:

function processProgressionResponse(response) {

  // could theoretically process all of the progressions (factions, etc) this is just prestige.
  // https://github.com/TrackerNetwork/DestinyStatus/blob/master/app/destiny/Character/ProgressionCollection.php
  var payload = _.findWhere(response.data.Response.data.progressions, {progressionHash: 2030054750});

  console.log('progression', payload);

  return $q.when(payload);
}

function rejectProgressionResponse(error) {
  $q.reject(new Error('The store progression was not available.'));
}

and the response looks like this:

{
  "dailyProgress": 0,
  "weeklyProgress": 0,
  "currentProgress": 3965090,
  "level": 158,
  "step": 0,
  "progressToNextLevel": 15090,
  "nextLevelAt": 25000,
  "progressionHash": 2030054750
}

not sure where we want to throw it, getDestinyInventories?

kyleshay commented 8 years ago

closing in favor of #533