1

I'm building a node application to read Blizzard's MOBA game 'Heroes of the Storm' replay files. Blizzard has provided a replay parser called heroprotocol and a gentleman later ported it a nodejs version he dubbed heroprotocoljs. However he has stopped maintaining the repository a year ago and the replay versions continue to change.

Ultimately I need a way to port the data structures from a python format like this to a javascript format like this.

I've tried pyjs, javascripthon, and transcrypt. None of them seem to produce the desired result about what I'm after. These formats are very similar and a near 1-to-1 translation should be possible even if I have to resort to using regular expressions to convert it line by line.

1 Answer 1

1

Have you tried exporting those structures as json? That might be what you're looking for. You can use something like this:

import json

typeinfos = [
             ('_int',[(0,7)]),  #0
             ('_int',[(0,4)]),  #1
            # ...
            ]

with open("hero.json", "w") as f:
    f.write(json.dumps(typeinfos))    
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.