Problems when decoding a passive tree build URL

I'm currently working on a PoE application that calculates dps given a set of gear, passive URL, active skill gems and supports etcetera, and I'm currently in the process of decoding and parsing a passive tree build URL.

The problem that I'm having is that when I try converting the utf-16 encoded strings to 16 bit integers (These integers are the node IDs that can be used to retrieve the information about the node). The problem I run into, is that certain nodes result in an error when decoding a string. I'm getting the following error:

Traceback (most recent call last):
File "C:\Users\Prutser\Documents\GitHub\poe-app\passives.py", line 53, in <module>
nodes = calc.convert_to_node_ids(decoded_url)
File "C:\Users\Prutser\Documents\GitHub\poe-app\passives.py", line 31, in convert_to_node_ids
c = (build[i+1] + build[i+0]).decode("utf-16")
File "C:\Python27\lib\encodings\utf_16.py", line 16, in decode
return codecs.utf_16_decode(input, errors, True)
UnicodeDecodeError: 'utf16' codec can't decode bytes in position 0-1: unexpected end of data

This error occurs only for certain nodes. I can't find out for which ones yet, but it only happens for some nodes.

Am I doing something wrong with the decoding? Am I using an incorrect encoding/decoding type? Any help/leads would be appreciated. I verified that all the strings that are successfully decoded actually are nodes that really exist, so that part works fine.
Last edited by PrutsendePrutser on Apr 14, 2014, 9:54:46 AM
This isn't an issue with your account or technical problems with the game itself.

As far as I know, there is no official API for developers with that system... which means if you choose to attempt to use the, they're "at your own ability/risk". GGG DOES have some web apis for other things, but not for the skill tree afaik.

While I think you're more than welcome to attempt to parse that data however you want, you won't likely be getting any official support on doing it here.

Best bet is one of the discussion forums or a specific place for people who hack this stuff to figure out how it all works... not the official support forum.

Good luck on your quest.
any way you can log the data before attempting to decode it? That is always my first debug option, adding a output right before the step that breaks, so you can analyze the input creating the error.
Hey...is this thing on?
Hi

I'm planing to do the exact same thing. I took a look at the source code of the Offline Skilltree Calculator. I found the part about decoding and encoding the url, but my knowledge is not good enough to fully understand every line.


SkillTree.cs

i posted the code here:

http://pastebin.com/ekJnb1KU



line 457 "public void LoadFromURL(string url)"

and

line 484 public string SaveToURL()


maybe that helps ;)




you're probably not running the right base 64 decoding variant, the passive tree uses a URL variant, if you don't have the right decoder available, simply replace the '-' character with '+' and '_' with '/' and then run a normal base64 decode.
Go GGG!
Last edited by ggimkaas on Aug 13, 2014, 9:36:16 PM

Report Forum Post

Report Account:

Report Type

Additional Info