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

WIP: [com.blizzard.Hearthstone] Add Hearthstone #88

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

TLATER
Copy link

@TLATER TLATER commented Jul 14, 2018

The branch is in a much better state, the game runs quite nicely :)

The sed hack works after some adjustments, but ultimately I think it's still too hacky for production use - currently, after the installer runs, the user has to close battle.net before signing in, so that we have time to go fiddle with the config file. If the user fails to do so, Hearthstone will end up not running with directx, which causes graphical glitches.

Other than that, the game seems to run fine. My main annoyance is having to run battle.net, especially during installation - is there any chance we can get that to run headless, like some winetricks installations do? That would be a massive UX improvement.

The branch could do with someone confirming that the various metadata files look correct in normal UIs too - I use a fairly barebones, custom DE, so I can't see much of the fancy images.

@julianrichen julianrichen self-requested a review July 14, 2018 01:55
Copy link
Contributor

@julianrichen julianrichen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the contribution! I've made some comments and if you can also add the following that would be great:

Add the Heartstone icon as com.blizzard.Hearthstone.svg so it shows up in the app center. You can get it here:
https://us.shop.battle.net/static/3.0.0/images/family-icons/hearthstone.svg

Add the desktop file so users can launch it from the desktop shell. Call it com.blizzard.Hearthstone.desktop. Contents:

[Desktop Entry]
Name=Hearthstone 
Comment=A fast-paced strategy card game
Exec=hearthstone %U
Icon=com.blizzard.Hearthstone 
StartupNotify=true
Terminal=false
Type=Application
MimeType=application/x-ms-dos-executable;application/x-msi;application/x-ms-shortcut;
Categories=Game;Strategy;
Keywords=Hearthstone;Blizzard;Strategy;Hearthstone;

Or I can pull it and edit the changes, up to you.

<metadata_license>CC0-1.0x</metadata_license>
<project_license>LicenseRef-proprietary</project_license>
<name>Hearthstone</name>
<!-- <description></description> -->
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For <description></description> tag:

Sheathe your sword, draw your deck, and get ready for Hearthstone - the fast-paced strategy card game that's easy to learn and massively fun. Start a free game and play your cards to sling spells, summon creatures, and command the heroes of Warcraft in duels of epic strategy.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Forgot to mention, text inside the description tag should be wrapped with a paragraph tag.

<description>
    <p>Sheathe your sword, draw your deck, and get ready for Hearthstone - the fast-paced strategy card game that's easy to learn and massively fun. Start a free game and play your cards to sling spells, summon creatures, and command the heroes of Warcraft in duels of epic strategy.</p>
</description>

<id>com.blizzard.Hearthstone.desktop</id>
<metadata_license>CC0-1.0x</metadata_license>
<project_license>LicenseRef-proprietary</project_license>
<name>Hearthstone</name>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add <summary></summary> tag:

A fast-paced strategy card game

<project_license>LicenseRef-proprietary</project_license>
<name>Hearthstone</name>
<!-- <description></description> -->
<!-- <screenshots> -->
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Screenshots are only 980x590 but they'll do:
https://playhearthstone.com/en-us/media/#screenshots

https://d2vkoy1na2a6o6.cloudfront.net/images/media/screenshots/en-us/ss4-full-aeeaacb3830c9c68ae0bf10c5418d8b56c5b68195a94fcc276d64d4f16e0d05c34f6012234531b09564ffe98bdb72a0898d7369643766ae255ec52ddb8539874.jpg
https://d2vkoy1na2a6o6.cloudfront.net/images/media/screenshots/en-us/ss5-full-7d4989a6037604c0ba10efb3029fa879a527c93f8ec07fa37e753dd6ec40712b71c96259225345d01de3453fc165d6d4bb398f201916dddebec74350e0970117.jpg
https://d2vkoy1na2a6o6.cloudfront.net/images/media/screenshots/en-us/ss1-full-72f425379264f9def23c9445d81c7f55740121789ff98f083f2a0f5e9b1f75ccb20315c42cc7d9142d5745a5d67d5c89900d608d3ecca721eb5827a3f53688a7.jpg
https://d2vkoy1na2a6o6.cloudfront.net/images/media/screenshots/en-us/ss2-full-244c09bab5752fb44972016c838ce4834e474685fc1e04860ddef035fe7ced61cc919cd5fad96e3b926e5ad7ae8775de091aa5fc283bf306ff36e66d4b757298.jpg
https://d2vkoy1na2a6o6.cloudfront.net/images/media/screenshots/en-us/ss3-full-358d2b15e8a699c615ba1c9fae7dd78747c37035330c84284b40a6643731c138315e22e39770f1597f5413531d5ddf26ae8e5e9cec5c77a4d862304d68f6b917.jpg

</content_rating>

<releases>
<release date="2018-07-14" version="0.1.0">
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

About an hour ago I switched to Calendar Versioning, if you can change it to 2018.07.14 that would be good.

- install -d /app/bin
- install hearthstone-installer /app/bin
- install hearthstone /app/bin
- install -Dm644 com.blizzard.Hearthstone.appdata.xml /app/share/appdata/com.blizzard.Hearthstone.appdata.xml
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will need to install desktop and svg file:

- install -Dm644 com.blizzard.Hearthstone.desktop /app/share/applications/com.blizzard.Hearthstone.desktop
- install -Dm664 com.blizzard.Hearthstone.svg /app/share/icons/hicolor/scalable/apps/com.blizzard.Hearthstone.svg

- wine64 "${WINEPREFIX}/dosdevices/c:/Program Files (x86)/Battle.net/Battle.net Launcher.exe" "battlenet://Hearthstone"

- type: file
path: com.blizzard.Hearthstone.appdata.xml
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will need desktop and svg file:

- type: file
  path: com.blizzard.Hearthstone.desktop
- type: file
  path: com.blizzard.Hearthstone.svg

<?xml version="1.0" encoding="UTF-8"?>
<component type="desktop">
<id>com.blizzard.Hearthstone.desktop</id>
<metadata_license>CC0-1.0x</metadata_license>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is a typo and should be CC0-1.0.

@TLATER
Copy link
Author

TLATER commented Jul 14, 2018

Thanks for the comments! I'll make the changes you suggest over the next day or so.

I feel the bigger issue is that this doesn't actually run yet ;)

- ' exit 1'
- fi
-
- source /app/bin/battlenet-installer "battlenet://Hearthstone"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be battlenet://WTCG instead of battlenet://Hearthstone.

- ' mv "${WINEPREFIX}/dosdevices/c:/Program Files (x86)/Battle.net/Battle.net*/Battle.net Helper.exe" "${WINEPREFIX}/dosdevices/c:/Program Files (x86)/Battle.net/Battle.net*/Battle.net Helper.exe.bak"'
- fi
-
- wine64 "${WINEPREFIX}/dosdevices/c:/Program Files (x86)/Battle.net/Battle.net Launcher.exe" "battlenet://Hearthstone"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be battlenet://WTCG instead of battlenet://Hearthstone.

@julianrichen
Copy link
Contributor

julianrichen commented Jul 14, 2018

Yah I just finished downloading it, it launches and I can hear the music and what sounds like me toggling menu items, and the cursor is visable but the screen is black. I'm going to take a guess and say it needs d3dx9 installed.

Also I believe you can force the game to launch in window mode, never played it but I see everyone play it in window mode. Assumingly so they can do other things when it's the opponents turn.

@julianrichen
Copy link
Contributor

Yup, need to add the d3dx9 extension and a launch option of -force-d3d9 for Battle.Net. I'm not sure how we can append to the existing json file that the battlenet-installer writes with bash. Bash is kind of limited in that regard. Maybe a sed command.

sed -i '$s/}/,"Games": { "hs_beta": { "AdditionalLaunchArguments": "-force-d3d9" } } }/' "${WINEPREFIX}/dosdevices/c:/users/${USER}/Application Data/Battle.net/Battle.net.config"'

- org.winepak.Platform.Extension.corefonts
- org.winepak.Platform.Extension.vcrun2015

add-extensions:
Copy link
Contributor

@julianrichen julianrichen Jul 14, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add:

org.winepak.Platform.Extension.d3dx9:
  directory: lib/extension/d3dx9
  version: 3.0
  no-autodownload: false

buildsystem: simple
build-commands:
- mkdir -p /app/lib/wine-32bit

Copy link
Contributor

@julianrichen julianrichen Jul 14, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add:

- name: setup
  buildsystem: simple
  build-commands:
    - mkdir -p /app/lib/extension/d3dx9

- ' echo "This prefix already has an exisiting ''Hearthstone'' install at ${WINEPREFIX}"'
- ' echo "In order to install ''Hearthstone'' you must move or delete the current prefix."'
- ' exit 1'
- fi
Copy link
Contributor

@julianrichen julianrichen Jul 14, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add:

-
- echo "Installing Extension(s)..."
- source /app/lib/extension/d3dx9/bin/d3dx9-install64
- source /app/lib/extension/d3dx9/bin/d3dx9-install64-wow64
- 
- echo "Installer finished"

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hum, it appears that the extension never creates those files. Setting -force-d3d9 still seems to function on my machine with the current configuration - could you confirm?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, I wonder if using Wine's native d3d9 libs are enough. Will test when I get a chance.

@julianrichen
Copy link
Contributor

This sed command should make it work

sed -i s'/}$/,"Games": { "hs_beta": { "AdditionalLaunchArguments": "-force-d3d9" } } }/' "${WINEPREFIX}/dosdevices/c:/users/${USER}/Application Data/Battle.net/Battle.net.config"

- echo "Installing Extension(s)..."
- source /app/lib/extension/d3dx9/bin/d3dx9-install64
- source /app/lib/extension/d3dx9/bin/d3dx9-install64-wow64
-
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add:

-
- echo "Performing tweak(s)..."
- 'sed -i s''/}$/,"Games": { "hs_beta": { "AdditionalLaunchArguments": "-force-d3d9" } } }/'' "${WINEPREFIX}/dosdevices/c:/users/${USER}/Application Data/Battle.net/Battle.net.config"'
- 

@julianrichen
Copy link
Contributor

Oh and no rush, whenever you find time to work on this. I kind threw a bunch of change request on you... sorry.

@TLATER
Copy link
Author

TLATER commented Jul 14, 2018

Haha, s'alright, I'm pretty excited to see this project actually going somewhere. This is the most awesome use of flatpak I've seen so far :)

s/Hearthstone/WTCG/ seems to have fixed most issues for me, seems like directx 9 isn't strictly required with my graphics card. That said, lots of card art is broken, so I'll try and see if that fixes it.

I'll go to sleep after, nearing 6 am here... Why do I always start these things so late at night?

@TLATER TLATER force-pushed the tlater/hearthstone branch 6 times, most recently from fa8e498 to 7920181 Compare July 14, 2018 13:36
@julianrichen
Copy link
Contributor

Other than that, the game seems to run fine. My main annoyance is having to run battle.net, especially during installation - is there any chance we can get that to run headless, like some winetricks installations do? That would be a massive UX improvement.

Unfortunately no, you can run the Hearstone.exe directly but it won't get updates unless you run Battle.net and it won't auto log you in.

Some of these arguments work if you prefix with --.

Install Options

  • install - Start a package installation
  • tomepath - Manual override of installation tome path
  • game - Game registration/installation uid
  • migrate - Game path of pre-0.5 installation
  • torrentinstall - Set package installation mode to torrent install
  • diskinstall - Set package installation mode to disk install
  • webinstall - Set package installation mode to web install
  • encrypted - Set encryption enabled
  • gamepath - Game registration path
  • installlocale - Set package installation locale
  • installregion - Set package installation region
  • majorinstallver - Set package installation max version
  • repair - Start a repair for a given uid

Internal Options

  • updatepid - Pid to wait for before initializing
  • bnetarg - Pass argument straight to battle.net
  • autostarted - Indicates program was started automatically
  • redirected - Indicates program was just redirected

Runtime Options

  • exec,e - Execute a command
  • unattendedpatch - Start with unattendedpatch mode
  • setlanguage - Set the application language
  • setregion - Set the application region
  • session - Analytics Session Hash
  • setgamelanguage - Set language for a game

For example

$PATH/Battle.Net Launcher.exe --game h3_beta --install

Will actually pull-up the installer for Heartsone directly but you can't pass the switch through the Battle.Net Setup.exe, only Battle.Net Launcher.exe or Battle.net.exe -_-

Which doesn't sound like a problem, except that Battle.Net Setup.exe auto-launches the client after install and you can't launch them with the correct arguments, EVEN THOUGH Battle.net Setup.exe PASS SOME OF THE OPTIONS TO THE CLIENT. So it'll pass the generic --install argument but no --game <game uuid>, so --install becomes pointless... And it's pointless after the fact because /app/bin/heartstone-launcher already did most of the setup and running --game --installin/app/bin/heartstone` would be bad ux.

Also battlenet://WTCG --install doesn't seem to work... because the battlenet:// protocol don't mix with argument flags. But yet you can mix --game & --uuid. Also --bnetargs seems to be totally ignored.

IDK if Blizzard would help but maybe shooting off an email to Blizzard support asking for advice and a proper list might help. But disguise the email as something like

I work for an Internet Cafe and we're looking to automate our Battle.net & Blizzard Game installation via some install scripts. Can you auto install games from the setup.exe? Can you provide advice?

They might be more willing to expose more info.


Sorry this turned into a rant and seems quickly typed. I'm leave soon and wanted give you some information regarding you question if you want to look into over the weekend.

@julianrichen
Copy link
Contributor

Also see #73 (comment) regarding sed and json issue.

@AsciiWolf
Copy link
Contributor

Any news?

@TLATER
Copy link
Author

TLATER commented Sep 18, 2018

@AsciiWolf Sorry, I have been to busy to push this further - I'm not sure when I will get enough time, unfortunately. I have received no reply from Blizzard so far.

If anyone else wants to continue the branch,
feel free to. I recommend following the discussions on #73 and #101.

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

Successfully merging this pull request may close these issues.

3 participants