bnetlauncher icon indicating copy to clipboard operation
bnetlauncher copied to clipboard

BUG: Game updates cause error dialog

Open 2E0PGS opened this issue 5 years ago • 8 comments

First, Great little tool works well as a launcher proxy.

Second, When I launched BOPS4 today the battle.net wasn't open so this program launched it great! However the game needed updates which it then proceeded to download 4GB worth and install them. However this program didn't seem to be aware the game was updating and instead gave me the following error: image

Perhaps it would be possible to check if the game updater process/exe is running and wait?

2E0PGS avatar Oct 31 '18 22:10 2E0PGS

Luckily I waited until updates completed before clicking OK on that dialog as it did kill the bnet launcher after pressing OK.

2E0PGS avatar Oct 31 '18 22:10 2E0PGS

The battle.net client is the one doing the update so there's really no easy way to check if a game is updating or not.

I really didn't account for updates has I usually leave the battle.net client running, so will improve the message to allow waiting for the update to complete.

Has for doing it automatically, maybe i could hook into battle.net client agent and try and look what files it has open to deduce if it's updating, so I'll try to look into it for a later version.

dafzor avatar Oct 31 '18 23:10 dafzor

Partially address in https://github.com/dafzor/bnetlauncher/commit/3323f1b1b07a05bdecbd86f723904feffbfe8af5 which fixes teh bug part of it. There's a new pre-release 2.01 version with those changes.

As for the enhancement of detecting updates only way so far seems to doing kernel calls which are windows version dependent.

dafzor avatar Nov 01 '18 11:11 dafzor

You can pull update information from the ".patch.result" files in the game install directory (it's a hidden file) 0 means the game is up to date, I don't know what value it's set to for preload updates. Will check when the 8.1 WoW prepatch is scheduled. As for finding game install directories, either I’m not looking far enough, or blizzard are hiding it. This has been the main reason I never looked at submitting a pull for this since I’m going off hardcoded values at the moment.

reed216 avatar Nov 02 '18 01:11 reed216

@iMintty yeah, I suspect it's stored in C:\ProgramData\Battle.net\Agent\product.db but seems to be a internal struct dumped into a file.

There's also the case when the client itself might be updating, but it seems the "C:\ProgramData\Battle.net\Agent" folder also has a ".patch.result" so that might be an option (assuming it's the only place that gets updated.

So I think you might be onto something, if product.db is made properly readable it would be possible to match launch command with a path and search for the patch status.

A big unknown is how it changes during the launch process, could I just check it once the client is running? would i need to keep looking at while checking if the game is running? I don't know.

Regardless, implementing patch detection seems a lot more feasible.

dafzor avatar Nov 02 '18 08:11 dafzor

Leaving this note mostly for myself.

Tried to make some sense of products.db using a hex editor and binary templates but couldn't make sense of it. Managed to figure out strings where prefixed by a byte with their length but that's about it, no idea what the terminator byte is supposed to signal.

Attaching the binary template of the bit I uncovered. bnet_product.bt.txt

dafzor avatar Nov 15 '18 23:11 dafzor

product.db is in the protobuf format, schema has been decoded by other projects.

dafzor avatar Aug 14 '19 21:08 dafzor

After some testing i concluded that the .patch.result does not update in realtime when the game has an update. So it seems an unreliable method of verifying if it's updating or not.

dafzor avatar Sep 19 '19 23:09 dafzor