HeroicGamesLauncher icon indicating copy to clipboard operation
HeroicGamesLauncher copied to clipboard

[Fix] Added check if heroic can communicate with internet (ping some common websites)

Open Nocccer opened this issue 2 years ago • 3 comments

Heroic checks if internet connection is available. Using ping command to ping google.com, store.epicgames.com and gog.com. If one succeed it will return true.

Tested on linux with a invalid url. Was succesfully marked as offline. TODO: Windows needs to be tested.


Use the following Checklist if you have changed something on the Backend or Frontend:

  • [ ] Tested the feature and it's working on a current and clean install.
  • [ ] Tested the main App features and they are still working on a current and clean install. (Login, Install, Play, Uninstall, Move games, etc.)
  • [ ] Created / Updated Tests (If necessary)
  • [ ] Created / Updated documentation (If necessary)

Nocccer avatar Aug 08 '22 14:08 Nocccer

Will do some testing on windows and macOS.

flavioislima avatar Aug 08 '22 17:08 flavioislima

Still not working as it should. If you start Heroic without internet connection and then connect again it won't update the status and wont update the game info. And GOG game pages are not working when offline as well.

flavioislima avatar Aug 08 '22 19:08 flavioislima

Still not working as it should. If you start Heroic without internet connection and then connect again it won't update the status and wont update the game info. And GOG game pages are not working when offline as well.

Where is the status? I mean it never worked before. Every function which needs a internet connection should listen to an event then?

Btw, what do you think about make the isOnline a boolean and create instead a interval function that checks connection each 10s. So all function which relies on the isOnline value, does not call ping.

Nocccer avatar Aug 09 '22 13:08 Nocccer

Actually i think this is was not needed since ariel pr!

Can we revert it?

Nocccer avatar Aug 18 '22 02:08 Nocccer

Which PR? I still think that pinging the websites is a good thing to have.

flavioislima avatar Aug 18 '22 09:08 flavioislima

Ah sorry thought this got also merged, because @arielj implemented a ping there aswell. https://github.com/Heroic-Games-Launcher/HeroicGamesLauncher/pull/1727

Nocccer avatar Aug 18 '22 13:08 Nocccer

Ah sorry thought this got also merged, because @arielj implemented a ping there aswell. https://github.com/Heroic-Games-Launcher/HeroicGamesLauncher/pull/1727

A-ha. That's true I'm blind. We can revert this one then or let's wait until Ariel put it in testing :)

flavioislima avatar Aug 18 '22 14:08 flavioislima

hey I'm traveling until the 28th so I won't have much time to continue that PR, I'll do a few more things there after I get back

arielj avatar Aug 18 '22 18:08 arielj