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

Exception in `SteamId#fetch_games` #322

Closed Lavode closed 5 years ago

Lavode commented 5 years ago

Ruby version:

› ruby --version
ruby 2.6.1p33 (2019-01-30 revision 66950) [x86_64-linux]

Gem version:

› gem list steam-condenser
*** LOCAL GEMS ***
steam-condenser (1.3.11)

Sample code:

require 'steam-condenser'

WebApi.api_key = '*snip*'

id = SteamId.from_steam_id('STEAM_0:1:38735346')
puts "Profile is public: #{ id.public? }"
id.fetch_games

Output & exception:

Profile is public: true
Traceback (most recent call last):
    5: from /tmp/sc.rb:7:in `<main>'
    4: from /home/michael/.gem/ruby/2.6.1/gems/steam-condenser-1.3.11/lib/steam/community/steam_id.rb:326:in `fetch_games'
    3: from /home/michael/.gem/ruby/2.6.1/gems/steam-condenser-1.3.11/lib/steam/community/steam_id.rb:326:in `each'
    2: from /home/michael/.gem/ruby/2.6.1/gems/steam-condenser-1.3.11/lib/steam/community/steam_id.rb:328:in `block in fetch_games'
    1: from /home/michael/.gem/ruby/2.6.1/gems/steam-condenser-1.3.11/lib/steam/community/steam_game.rb:64:in `new'
/home/michael/.gem/ruby/2.6.1/gems/steam-condenser-1.3.11/lib/steam/community/steam_game.rb:182:in `initialize': undefined method `[]' for nil:NilClass (NoMethodError)
Lavode commented 5 years ago

Would have liked to tag with ruby, but seems I lack permission to do so - sorry!

Lavode commented 5 years ago

Adding to the above - I noticed that there have been (a few years of) changes to master since the last release. Using latest master this bug is not present anymore - likely disappearing as a result of https://github.com/koraktor/steam-condenser-ruby/commit/9861ec9a9b27304b33f8e6a26e482548266d33f0#diff-613e733e42e2379e57c6b1f96fe1da70.

Do you intend to release a new version anytime soon, or would you advise to simply use master for the time being? :)

koraktor commented 5 years ago

Due to Valve‘s undocumented changes to various parts of Steam‘s APIs the released version (1.x) are probably defunct for interacting with Steam Community.

Please use the code from master as of now.

Gemfile example:

gem 'steam-condenser', :git => 'https://github.com/koraktor/steam-condenser-ruby.git'