2

我目前正在尝试将我的应用程序从 Steam Xml Api 移动到 Steam Web Api。

在旧的 Xml Api 中,我对 xml 之后的每个成就都有:

<achievement closed="0">
    <iconClosed>http://media.steampowered.com/steamcommunity/public/images/apps/205830/d21efac1184e37b4b344d18639db18cf40979018.jpg</iconClosed>
    <iconOpen>http://media.steampowered.com/steamcommunity/public/images/apps/205830/7a4517495fba9f34642efd3983a561f55770f36c.jpg</iconOpen>
    <name>Manic Matcher</name>
    <apiname>st_ach_24</apiname>
    <description>Achieve 5 Consecutive Quick Matches</description>
</achievement>

这是包含成就图片。

在 ISteamUserStats 界面中,我只得到以下响应:

{
"apiname": "ST_ACH_05",
"achieved": 0,
"name": "Silver Medal",
"description": "50 shot streak"
}

那么,是否有一个接口可以为我提供来自 ST_ACH_05 的图像?如果不是我该怎么办?可以使用已弃用的 XML Api 吗?

参考:

4

1 回答 1

7

您想使用GetSchemaForGame API 调用。

http://api.steampowered.com/ISteamUserStats/GetSchemaForGame/v0002/?key=YOURKEY&appid=APPID&l=english&format=json

YOURKEY是您从 Valve 获得的 API 密钥。APPID是您要查找的游戏的应用程序 ID。

API 具有以下格式(取自上述 Wiki 链接)

game

    gameName (string)
        Steam internal (non-localized) name of game. 
    gameVersion (int)
        Steam release version number currently live on Steam. 
    availableGameStats

        achievements (Optional) (array)

            name (string)
                API Name of achievement. 
            defaultvalue (int)
                Always 0 (player's default state is unachieved). 
            displayName (string)
                Display title string of achievement. 
            hidden (int)
                If achievement is hidden to the user before earning achievement, value is 1. 0 if public. 
            description (string)
                Display description string of achievement. 
            icon (string)
                Absolute URL of earned achievement icon art. 
            icongray (string)
                Absolute URL of un-earned achievement icon art. 

        stats (Optional) (array)

            name (string)
                API name of stat. 
            defaultvalue (int)
                Default value of stat. 
            displayName (string)
                Developer provided name of string. 

数据结果(来自 TF2,appid 440)如下所示:

"achievements": [
                {
                    "name": "TF_PLAY_GAME_EVERYCLASS",
                    "defaultvalue": 0,
                    "displayName": "Head of the Class",
                    "hidden": 0,
                    "description": "Play a complete round with every class.",
                    "icon": "http://media.steampowered.com/steamcommunity/public/images/apps/440/tf_play_game_everyclass.jpg",
                    "icongray": "http://media.steampowered.com/steamcommunity/public/images/apps/440/tf_play_game_everyclass_bw.jpg"
                },
于 2014-03-09T18:22:42.620 回答