有 Java 编程相关的问题?

你可以在下面搜索框中键入要查询的问题!

游戏名称中的java Steam Web Api空值

我第一次尝试使用Steam Web Api时遇到了一些问题

我想得到游戏的完整列表——在我的个人资料中是这样的——我收到带有APID等的列表,但每个游戏的名称字段中都有空值

下面是简单的代码:

public class SteamWebApiDemo {
    private static final String key = "MY_KEY";

    public static void main( String[] args ) throws SteamApiException {
        SteamWebApiClient client = new SteamWebApiClient.SteamWebApiClientBuilder( key ).build();
        GetOwnedGamesRequest req = new GetOwnedGamesRequest.GetOwnedGamesRequestBuilder( "76561198033046525" ).buildRequest();
        GetOwnedGames g = client.<GetOwnedGames> processRequest(req);

        for( com.lukaspradel.steamapi.data.json.ownedgames.Game game : g.getResponse().getGames() ) {
            System.out.println(
                    game.getAppid() + ": " + game.getName()
            );
        }
    }
}

在循环中,我试图提取appId和name,但每个游戏都有空值,我只是不明白为什么

简短的例子:

10: null 20: null 30: null 40: null 50: null 60: null 70: null


共 (0) 个答案