HeroicGamesLauncher
HeroicGamesLauncher copied to clipboard
Sync playtime with Epic/GOG
Problem description
Currently playtime is only saved locally, it's not synced between launchers on user devices.
Feature description
After a ended game session let Epic/GOG backends know about time spent in game. If some people wish to not send data like that I think it should be a opt-in or opt-out feature.
Alternatives
No response
Additional information
For gog it's as simple as making a following request.
POST https://gameplay.gog.com/games/GameID/users/UserId/sessions
{"session_date":1641978480,"time":2}
where session_date is a timestamp of game started. time is a number of minutes of the session. I assume there is similar endpoint for Epic.
For legendary I belive Rodney would need to develop it, and I don't know if that would be possible.
For Epic, we have really similar request
PUT https://library-service.live.use1a.on.epicgames.com/library/api/public/playtime/account/<ACCOUNT>/bulk
{
"playtimeAddList": [{
"machineId": "X",
"artifactId": "Macaw",
"startTime": "2022-04-25T15:54:20.805Z",
"endTime": "2022-04-25T15:55:29.972Z"
}]
}
Hmm, interesting. So then we can open a PR on Legendary or implement this in Heroic directly.
And the counterpart to know how far we have come is:
https://launcher.store.epicgames.com/graphql?operationName=playtimeTracking&variables={"accountId":"ACCOUNTID","artifactId":"Macaw"}&extensions={"persistedQuery":{"version":1,"sha256Hash":"HASH"}}
which returns a json object
{
"data": {
"PlaytimeTracking": {
"artifact": {
"artifactId": "Macaw",
"totalTime": 2440
}
}
},
"extensions": {}
}
I am not sure what is happening above, but I hope you can make it :)
I am just waiting for THIS to install Heroic and don't bother with EGS clunkiness anymore ^^
And the counterpart to know how far we have come is:
https://launcher.store.epicgames.com/graphql?operationName=playtimeTracking&variables={"accountId":"ACCOUNTID","artifactId":"Macaw"}&extensions={"persistedQuery":{"version":1,"sha256Hash":"HASH"}}which returns a json object
{ "data": { "PlaytimeTracking": { "artifact": { "artifactId": "Macaw", "totalTime": 2440 } } }, "extensions": {} }
No progress? :/
Done
Epic's still not done yet 👀
Oops
I would love to see this done in a way that accounts for time the device is asleep, specifically for Steam Deck. Steam Deck users often suspend their machine in the middle of play sessions for a long time, so that one hour of play in an evening, then suspending the deck until the following evening gets counted as 24ish hours of playtime instead of one.
I think Steam on Steam Deck tracks game launch and close times, then also the times of sleep and wake events, subtracting the time asleep from playtime after a game is closed. Epic and GOG have no plans to do this natively with their launchers, so you could win over a ton of Steam Deck users if you implement this.
Is this the right place to put this or should I open a new issue as a Feature Request (or do something else)?