Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Link to steam #142

Closed
micheljung opened this issue Oct 8, 2017 · 2 comments
Closed

Link to steam #142

micheljung opened this issue Oct 8, 2017 · 2 comments

Comments

@micheljung
Copy link
Member

No description provided.

@duk3luk3
Copy link
Member

duk3luk3 commented Oct 12, 2017

The "reference implementation" in the python api is here: https://github.com/FAForever/api/blob/develop/api/users_route.py#L366-L471

We've decided to explicitly require ownership of FA since it is required for FAF, making no exceptions for people with "non-standard setups" (aka people who pirated the game, with a tiny amount of exceptions).

It has a small problem in the steam response parsing that I haven't gotten around to fix yet -

    if steam_req.status_code == 200:
        try:
            steam_rep = steam_req.json()
            if steam_rep['response']['game_count'] > 0:
                for game in steam_rep['response']['games']:
                    if game['appid'] == FA_APPID:
                        found_game = True
                        break
        except:
logger.exception('Steam request parsing failed for steamid={}, user_id={}'.format(steamID, user_id))

steam_rep['response'] is sometimes empty. This should be just a regular failure, equivalent to the response status code not being 200.

You can debug the steam api using curl:

curl -s 'http://api.steampowered.com/IPlayerService/GetOwnedGames/v0001/?key=STEAMAPIKEY&steamid=76561198390983227&format=json&appids_filter\[0\]=9420'

You can get a STEAMAPIKEY for testing here: http://steamcommunity.com/dev/apikey
(We have a steam account for FAF with an API key to use in prod)

Please note that there's pretty heavy caching on the steam api, so changes you make to e.g. the public visibility of a profile you're testing against may not have an effect until several minutes later.

Brutus5000 added a commit that referenced this issue Nov 3, 2017
Brutus5000 added a commit that referenced this issue Nov 4, 2017
Brutus5000 added a commit that referenced this issue Nov 4, 2017
Brutus5000 added a commit that referenced this issue Nov 4, 2017
Brutus5000 added a commit that referenced this issue Nov 4, 2017
Brutus5000 added a commit that referenced this issue Nov 5, 2017
Brutus5000 added a commit that referenced this issue Nov 8, 2017
Brutus5000 added a commit that referenced this issue Nov 8, 2017
Brutus5000 added a commit that referenced this issue Nov 8, 2017
Brutus5000 added a commit that referenced this issue Nov 8, 2017
Brutus5000 added a commit that referenced this issue Nov 8, 2017
@Brutus5000
Copy link
Member

Needs testing on a proper test server in combination with the website.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants