HearthSim / HSTracker

A deck tracker and deck manager for Hearthstone on macOS
https://hsreplay.net/downloads/
MIT License
1.15k stars 173 forks source link

HSTracker doesn't work because of Hearthstone log directory change #1313

Closed ziggyJ closed 1 year ago

ziggyJ commented 1 year ago

Describe the bug HSTracker did not show up after I started a game.

It seems that the Hearthstone log directory is changed. From the HSTracker log, I can see it try to read log from /Applications/Hearthstone//Logs/ but actually HearthStone created a sub directory every time after I launch it. I can see the log directory is something like /Applications/Hearthstone//Logs/Hearthstone_2023_06_01_10_35_09. That made HSTracker failed to read the log.

fmoraes74 commented 1 year ago

I ran into some other issue that is blocking the tracker from working. I hope to debug it more tonight but it may take a little longer if I can't find a solution for that.

fmoraes74 commented 1 year ago

Please try version 2.4.5

alsospacebar commented 1 year ago

I've had no luck with 2.4.5 (I play BG only) - it shows the overlay with what appears to be information from an old game., but does not update at all. I've attached a log from a session today. hstracker.log.zip

fmoraes74 commented 1 year ago

I've had no luck with 2.4.5 (I play BG only) - it shows the overlay with what appears to be information from an old game., but does not update at all. I've attached a log from a session today. hstracker.log.zip

There seems to be a timing issue with initializing the log readers and the mirror code. If this happens, just restart HSTracker and it should be fine. I will try to improve that going forward but this HS change made it much more complicated and I cannot use the same change as HDT because Mac file system works differently.

alsospacebar commented 1 year ago

Thanks! I've tried restarting tracker a few times based on your advice and I'm not sure what the expected behavior is, but it's definitely not normal. It picked up on some opponents boards, sometimes, then appears to lose track of them (or not keep them updated). It feels like the tracker loses it's place some time after the. restart. Another log attached from today. hstracker.log.zip

(I don't know if it matters but my HS directory is /Applications/Blizzard/Hearthstone, slightly non-default).

MrLyle commented 1 year ago

Just replying to say I have the same issue with 2.4.5. It'll work for a game, then stop working. Restart and it'll work again and then stop. Sometimes it stops mid game. This is in constructed, not BGs.

You're obviously aware of the issue, let me know if you need any more logs.

fmoraes74 commented 1 year ago

Can someone get a log showing the issue, but first delete the existing log, restart HSTracker, take note of the times when you start the game and when the problem happens? I still haven't had time to investigate more closely to see what went wrong.

alsospacebar commented 1 year ago

Attached is a log from such a session. I started HS at 2023-06-05 07:11:26. I started HSTracker at 7:13. The tracker worked as it should until turn 7, and then got stuck on turn 7.

I was monitorning the HS log directory as well, and it now looks to me like there's no file in there that was modified after 7:23 - I'm wondering if there's a HS bug?

hstracker 2.log.zip

Another one. HS Log directory: Hearthstone_2023_06_05_07_45_01 Got stuck after turn 7 and no modifications to log files happened after 7:55.

hstracker-2.log.zip

fmoraes74 commented 1 year ago

@alsospacebar can you check if the file limit was configured? It should be under /Applications/Hearthstone/client.config and the content should be:

[Log]
FileSizeLimit.Int=-1
alsospacebar commented 1 year ago

@fmoraes74 on my system this file is /Applications/Blizzard/Hearthstoneclient.config

and the contents are [Log] FileSizeLimit.Int=-1

(my HS home directory is /Applications/Blizzard/Hearthstone )

fmoraes74 commented 1 year ago

If you add a section like this on that file:

[Cheats]
ShowFakeBreakingNews=true

and restart HS, does it show you the fake news popup?

alsospacebar commented 1 year ago

I'm assuming that's supposed to come after HS starts (as opposed to after starting a game). I do not get a popup.

fmoraes74 commented 1 year ago

I'm assuming that's supposed to come after HS starts (as opposed to after starting a game). I do not get a popup.

I forgot to say you should stop HSTracker before trying this as it will overwrite the file.

mwr commented 1 year ago

I had the same / similar issue, with the tracker no working past Turn 7.

For me there was a file /Applications/Blizzard/Hearthstoneclient.config. /Applications/Blizzard/Hearthstone/client.config was missing.

I have saved both files with this content:

[Log]
FileSizeLimit.Int=-1

[Cheats]
ShowFakeBreakingNews=true

/Applications/Blizzard/Hearthstoneclient.config got overwritten instantly after starting the game.

/Applications/Blizzard/Hearthstone/client.config stayed unchanged.

I played one game and the HSTracker was working past Turn 7 until the end of the game.

After restarting Hearthstone, I got the FakeBreakingNews again, which could mean that the config is taken from /Applications/Blizzard/Hearthstone/client.config.

For now it seems that creating /Applications/Blizzard/Hearthstone/client.config fixed the issue for me.

PS: Battleground Games also got uploaded again to hsreplay

fmoraes74 commented 1 year ago

Interesting that the path is missing the / and writing the wrong file name. I will take a look at the code and make sure it includes the trailing / on the next update. Anybody having the issue, please create the file inside the correct directory.

Also check the directory listed in the HSTracker preferences:

image

As you can see, mine includes the trailing slash, so that is probably where things went wrong.

mwr commented 1 year ago

This is how the setting looks for me:

CleanShot 2023-06-05 at 18 12 22@2x

Could be a possible cause

fmoraes74 commented 1 year ago

I will have a fix for the missing slash causing the file limit change not taking effect in the next update. If you are having the issue, you can run the following command, changing the path to match where your Hearthstone is installed and adding the trailing slash. After running it, restart HSTracker:

defaults write net.hearthsim.hstracker hearthstone_log_path /Applications/Hearthstone/
alsospacebar commented 1 year ago

Success! Works normally in BG again. Thanks so much!

alsospacebar commented 1 year ago

Although... the attached crash log appears to show a crash in logReaderManager. Related? crashreport.txt

fmoraes74 commented 1 year ago

Although... the attached crash log appears to show a crash in logReaderManager. Related? crashreport.txt

Looks like thread 29 crashed. Let me see if this has been pushed to AppCenter.

fmoraes74 commented 1 year ago

That crash has not been uploaded, so I will need to symbolicate it later to see what the code was doing on that thread.

alsospacebar commented 1 year ago

Hm, my privacy settings suggest it should upload and that's what the crashreporter says. I'll double check the reporting if I see it again.

fmoraes74 commented 1 year ago

Hm, my privacy settings suggest it should upload and that's what the crashreporter says. I'll double check the reporting if I see it again.

The reporting is done via App Center, not Apple as it is not distributed via AppStore. You can check if one of the settings here is disabling the permission to upload:

defaults read net.hearthsim.hstracker

It would probably be one of the NSAppCenter* keys. You may have clicked no in past, so your crash is not being reported.

fmoraes74 commented 1 year ago

Is version 2.4.6 better?

MrLyle commented 1 year ago

It hasn't crashed for me so far since 2.4.6.

fmoraes74 commented 1 year ago

I consider this now fixed, closing