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

create human readable log file #12

Open
jovezhong opened this issue Jan 20, 2014 · 5 comments
Open

create human readable log file #12

jovezhong opened this issue Jan 20, 2014 · 5 comments

Comments

@jovezhong
Copy link

I am not sure whether hsl is a standard file format. Looks like it's compressed.

It'll be great if this program can generate human readable game log file. Maybe generate both json file and hsl file and only upload the hsl to the server.

If I can get json or plain text of the game log, I can use other BI tool to analyze them

@chippydip
Copy link
Owner

The log files are compressed (using DEFLATE which is basically just zip/gzip without the file header). The contents then are basically just the raw network traffic captured during the game. I'm adding a timestamp to each message and the game version, but that's about it.

All of the actual parsing happens on the server to keep the client simple and avoid having to push out client updates with each new patch.

There actually is a human-readable log format on the website. If you go to a replay page and change "replay" to "log" in the URL you should see something like this: http://www.hearthlog.com/u/hanariri-hunter/1391114175/log

I may try to expose this sort of info through an API at some point as well, but not sure exactly when that might get added.

@jovezhong
Copy link
Author

Thank you, @chippydip

I've written some script to parse the game log on website, which can generate simplified event e.g.
turn=8 step=4 action=attack to=HERO_05 damage=damage card=EX1_506 left=20

Could you please open API to list game records?

Say, http://www.hearthlog.com/api/u/{user}/list to return a JSON array of 1391114175,1391314175,1391614175

and http://www.hearthlog.com/api/users to list all users ID

@jovezhong
Copy link
Author

One more question, sometimes {e|3} means the player, sometime means the enemy. How you determine it on web page?

@chippydip
Copy link
Owner

The client stores all game logs locally even after they are uploaded to the server. The names of the files are the numbers in the game URLs (they are timestamps of when the game was recorded). So, you should be able to at least get a full list of your own games without an API, but I'll consider adding something like that in the future. I'm somewhat hesitant to do this, though, since reading a huge number of records to generate those API pages could potentially be quite costly if it was used with any regularity. I definitely see the appeal, though, so I'll continue to think about how I can tweak the data model to make these sorts of things more efficient.

If two players upload a log for the same game then {e|3} would be the player in one case and the enemy in another (which is why it's not consistent). The server determines which is which by looking at which player's cards are visible after the initial draw. The player's cards are visible while the enemy's cards are not.

@jovezhong
Copy link
Author

thanks @chippydip I've indexed all my game logs in Splunk and created some interesting dashboards.

I sent you a few files to your gmail. Please check.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants