JSON IDs not permuted to in-game IDs.
Closed this issue · 3 comments
Raijinili commented
If a user ID in the JSON is 123456789, it should be displayed as 159638247 (which is the in-game display).
Code:
def dispID(ID):
"""Permutes internal PAD ID to the displayed form.
"""
ID = str(ID).zfill(9)
return ''.join(ID[x-1] for x in [1,5,9,6,3,8,2,4,7])
izenn commented
do you have an example on where this is happening? (or where in the json the internal id is?)
Raijinili commented
I'm AFK right now, but player IDs are stored unpermuted and displayed
permuted. Look at your PAD API calls. `pid=...` uses the unpermuted ID,
which is different from the in-game displayed ID.
The friend list in `get_player_data` has unpermuted IDs. Compare them to
your in-game friend list. I forget the JSON key that holds the friend list,
but it's one of the first values. Edit: The key is "friends". The ID is the second (i.e. arr[1]) item of each friend data.
izenn commented
unable to replicate