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

PS4 characters aren't returning proper ASP levels #299

Open
Maelstromeous opened this issue Mar 15, 2021 · 5 comments
Open

PS4 characters aren't returning proper ASP levels #299

Maelstromeous opened this issue Mar 15, 2021 · 5 comments
Labels
bug Something isn't working p3 Minor issues

Comments

@Maelstromeous
Copy link
Member

There's a bug in the PS4 API which doesn't return the ASP flag.

@RemainNA cites:

I noticed that on PS4 no players are listed as ASP. I know on PS4 the API doesn't actually return prestige level, so workarounds like checking if a character owns the ASP title or has (xp > x && br <= 100) are needed there.

@Maelstromeous Maelstromeous added bug Something isn't working p3 Minor issues labels Mar 15, 2021
@RemainNA
Copy link

I check for PS4 ASP in Auraxis Bot w/ the code below. This has the drawback of being rather slow, and not working on NSO (the item_full resolve is broken for them). It could also be checked by testing if (BR <= 100 && score > 19812398), which is the score needed for BR 101 before any boosts. This however may not be fully accurate due to boosts and any characters that got to BR 100 before BR 120 was introduced.

const checkASP = async function(cName, platform){
    let uri = 'https://census.daybreakgames.com/s:'+process.env.serviceID+'/get/'+platform+'/character?name.first_lower='+cName+'&c:resolve=item_full&c:lang=en';
    let response = "";
    try{
        response = await got(uri).json(); 
    }
    catch(err){
        if(err.message.indexOf('404') > -1){
            return new Promise(function(resolve, reject){
                reject("API Unreachable");
            })
        }
    }
    // Error handling removed for readability
    let data = response.character_list[0];
    let aspTitle = false;
    for (x in data.items){
        if(Number(data.items[x].item_id) == 6004399){
            aspTitle = true;
            break;
        }
    }
    return new Promise(function(resolve, reject){
        resolve(aspTitle);
    })
}

@Maelstromeous
Copy link
Member Author

@microwavekonijn do you know if you fixed this upstream?

@microwavekonijn
Copy link
Member

microwavekonijn commented Mar 7, 2022

No, decided not to go down that rabbit hole. Data returned will be unprocessed and not wrapped.

I am working on an wrapper api though which intends to fix these kind of things.

@Maelstromeous
Copy link
Member Author

Good news, thanks!

@Maelstromeous Maelstromeous added this to the Aggregator vTBC milestone Mar 7, 2022
@Maelstromeous
Copy link
Member Author

@ryanjsims isn't this effectively closed with your ASP changes?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working p3 Minor issues
Projects
Status: No status
Development

No branches or pull requests

3 participants