从Steam API检索已安装游戏的列表 [英] Retrieve a list of installed games from the Steam API
问题描述
我正在研究Steam Roulette程序,并且正在尝试创建过滤器.我要实现的过滤器之一是(如果用户数据已随SteamWorks一起加载)是返回他/她已在计算机上安装的游戏列表(最好以App ID形式),然后我可以进行比较在我的原始完整列表中删除不需要的值;就像过滤器一样,可以从可能选择的游戏列表中删除用户未在其计算机上安装的游戏.
I'm working on a Steam Roulette program, and I'm trying to create filters. One of the filters I'd like to implement is (if the user data was loaded with SteamWorks), is to return a list of games (preferably in App ID form) that he/she has installed on his computer that I can then compare to my original full list to remove unneeded values; like a filter to get rid of games the user doesn't have installed on his machine from the list of possible games that can be picked.
万一:
Steam Roulette是一种在线趋势,以Web应用程序的形式出现,用户可以从他/她的Steam库中选择一个随机游戏并玩它.
Steam Roulette was an online trend, in the form of a web application in which the user picks a random game out of his/her Steam library and plays it.
现在,我正在使用Web API检索用户详细信息,该Web API使用通过 SteamUser.GetSteamID().ToString()
检索的Steam ID并将其输入:
Right now, I'm retrieving user details using the Web API using the Steam ID retrieved with SteamUser.GetSteamID().ToString()
and feeding it into:
string apiURL = "http://api.steampowered.com/IPlayerService/GetOwnedGames/v0001/?key=" + APIKey + "&steamid=" + id + "&format=json&include_appinfo=1";
并从那里读取返回的 .json
信息,以生成可供程序选择的游戏列表.
And reading the returned .json
information from there to generate a list of games that the program can pick from.
与 all 玩家拥有/拥有的游戏相反,我可以使用任何SteamWorks函数来检索计算机上安装的游戏列表的情况,而无需读取Steam库中的他们各自的文件夹?
Is there any SteamWorks function I can use to retrieve a list of games that is installed on the computer, as opposed to all the games that the player owns/has, without reading the steam libraries for their respective folders?
如果不存在可能的功能,是否有任何方法可以手动(在API之外)获取已安装游戏的列表?
If no possible function exist, is there any way to manually (outside the API) get a list of installed games?
推荐答案
此文件 C:\ Program Files(x86)\ Steam \ steamapps \ libraryfolders.vdf
包含所有本地蒸汽库的路径.(不包括默认库中的一个)
Contains the paths to all local steam libraries. (excluding the one in the default library)
然后只需获取位于每个游戏文件夹中的 steam_appid.txt
中的值( {library} \ steamapps \ common \ {game} \ steam_appid.txt
),您将获得所有已安装游戏的Steam应用ID的列表.
Then get just get the value in the steam_appid.txt
that's located in each game's folder ({library}\steamapps\common\{game}\steam_appid.txt
) and you will have a list of all installed games' steam app id.
这篇关于从Steam API检索已安装游戏的列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!