PaulCombal / SamRewritten

Steam Achievement Manager For Linux. Rewritten in C++.
GNU General Public License v3.0
341 stars 32 forks source link

Hide / remove non-games from selection list ( DLCs, SDKs, Servers ) #20

Closed telans closed 4 years ago

telans commented 4 years ago

DLCs, SDKs and other Steam / game tools do not have achievements. Removing them from the list would declutter the menu especially for people with games that have dozens of DLCs.

However, keeping around various game tools may be useful for people that just wish to idle them for app hours on Steam, as some people do. Perhaps there could be a toggle for this in the settings.

wgpierce commented 4 years ago

Thanks telans. I'll dump the information I've figure out about this:

In gibbed's original SAM, he maintains his own list of games in an xml hosted on his website to figure out whether an app is a game or not, and just pulls that down and parses it.

If we want to autodetect the valid apps (which is what I would prefer), this is the only viable method I've found:

I looked to find out if there's any viable way to determine the type of an app to filter out non-games. It turns out there is! I found that steamdb seemed to know this information from in the "App Type" field for any app. e.g. https://steamdb.info/app/102510/ https://steamdb.info/app/760/ https://steamdb.info/app/10/ are a DLC, config, and an actual game respectively. I would like to filter on only including games.

So I went and found out how it knew. It actually accesses some hidden steam APIs via the SteamKit project. Unfortunately accessing these looked arcane and may require a key/login. Maybe one with webdev knowledge can make sense of them more.

Here are the files: Steamdb gets the AppType from this field after calling a ClientPICSProductInfoRequest ProductInfo.KeyValues["common"]["type"].AsString().ToLower(); https://github.com/SteamDatabase/SteamDatabaseBackend/blob/d5e9ca33658535c3597bf0bcd0dec1782e80cec6/Processors/AppProcessor.cs#L72 https://github.com/SteamDatabase/SteamDatabaseBackend/blob/d5e9ca33658535c3597bf0bcd0dec1782e80cec6/Steam/PICSProductInfo.cs

and Steamdb gets the info from here in steamkit https://github.com/SteamRE/SteamKit/blob/aa3e7f1750644286a8f4ee144992f80d157b1f71/SteamKit2/SteamKit2/Steam/Handlers/SteamApps/Callbacks.cs#L418

And this other python project isn't used by steamkit, but does the same stuff. Here are the enums the API we would want to use. ClientPICSProductInfoRequest = 8903 https://steam.readthedocs.io/en/stable/api/steam.enums.html https://github.com/ValvePython/steam/blob/12f5ae7520c230f721af6be871fcd653efcd7c51/steam/enums/emsg.py#L1821

wgpierce commented 4 years ago

Paul figured out he can use https://store.steampowered.com/api/appdetails/?filters=basic&appids= + appid to figure out the appid type, so now https://github.com/PaulCombal/SteamAppsList is implemented to parse that for all apps and store it in https://github.com/PaulCombal/SteamAppsListDumps . With above commit, SamRewritten now retrieves that info and uses it to fix this issue. Support for more fine-grained filtering can be added as needed.