koraktor / steam-condenser

A multi-language library for querying the Steam Community, Source, GoldSrc servers and Steam master servers
https://koraktor.de/steam-condenser
Other
359 stars 65 forks source link

Problem getting information from steam community using JAVA version of steamcondenser #194

Closed laiboonh closed 11 years ago

laiboonh commented 11 years ago

Using: steam-condenser-0.13.1.jar

Code: SteamId id = SteamId.create("TheOneAndOnly"); System.out.println(id.getGames());

Error: com.github.koraktor.steamcondenser.exceptions.SteamCondenserException: XML data could not be parsed.

I tried doing this via URL and it seems there is nothing wrong with the steamserver as some previous issues have suggested URL: http://steamcommunity.com/id/TheOneAndOnly/games?tab=all&xml=1

I did a debug and found that the problem is with the games attribute in the SteamId object. The content is null when this player definitely has played some games.

koraktor commented 11 years ago

According to this thread linked in issue #183 Valve is now rate limiting all XML data globally. That means they're only accepting a given number of request in a specific time interval. If that limit is reached all other requests will be blocked (with HTTP status 503).

Sadly the error page is HTML even when requesting XML explicitly, so there's no reliable way to detect these errors.

laiboonh commented 11 years ago

Yes i saw that thread prior to posting this. Like i mentioned in my previous post i tried to do a url request to make sure there is a proper response from the server. I also did a debug after SteamId is created it has the proper contents just that the games attribute is null

koraktor commented 11 years ago

Games are not fetched during initial loading of the SteamId attributes, that's why the attribute is null first. It will only filled once getGames() or fetchGames() is called.

laiboonh commented 11 years ago

getGames() is when the error occurred in the code i posted above. I suspect the format of the XML has changed and your steam-condenser failed to handle it. Just a guess.

koraktor commented 11 years ago

Please read my first comment. It's a rate limit by Valve. I'm sorry there's nothing I can fix immediately. There will be improved error handling in the future, but the errors are caused by Valve's rate limiting and cannot be prevented.

laiboonh commented 11 years ago

Just to contribute back to this thread:

Previously i was using the packaged jar file steam-condenser-0.13.1.jar at https://github.com/koraktor/steam-condenser/downloads hence the problems

I wanted to debug steam-condenser myself and have checked out the source codes this time(should have done this at the beginning..i am quite new to Github and Maven and wanted something working fast). The latest codes work. The problem is probably some old files in the jar file.

koraktor commented 11 years ago

Damn. I should have seen this right away. Version 0.13.1 is outdated, it was released in April 2011.

The current version is 1.3.1. The newer versions are not available as downloads from GitHub, but only from Maven Central, e.g. here http://search.maven.org/#artifactdetails%7Ccom.github.koraktor%7Csteam-condenser%7C1.3.1%7Cjar.