gamespy_query 0.2.0pre8 → 0.2.0pre9

Sign up to get free protection for your applications and to get access to all the features.
@@ -87,12 +87,22 @@ module GamespyQuery
87
87
  dat = master.process list
88
88
 
89
89
  ded = "1"
90
- gm_dat = dedicated_only || sm_dedicated_only ? dat.select{|item| item[:gamedata] && item[:gamedata][:dedicated] == ded } : dat
90
+ gm_dat = if dedicated_only || sm_dedicated_only
91
+ h = {}
92
+ dat.each_pair do |k, v|
93
+ next unless v[:gamedata] && v[:gamedata][:dedicated] == ded
94
+ h[k] = v
95
+ end
96
+ h
97
+ else
98
+ dat
99
+ end
100
+
91
101
  sm = GamespyQuery::SocketMaster.new(gm_dat.keys)
92
102
  sockets = sm.process!
93
103
  sockets.select{|s| s.valid? }.each do |s|
94
104
  begin
95
- data = dat[s.addr]
105
+ data = gm_dat[s.addr]
96
106
  data[:ip], data[:port] = s.addr.split(":")
97
107
  data[:gamename] = game
98
108
  data[:gamedata].merge!(s.sync(s.data))
@@ -1,4 +1,4 @@
1
1
  module GamespyQuery
2
2
  # Version of the library
3
- VERSION = "0.2.0pre8"
3
+ VERSION = "0.2.0pre9"
4
4
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gamespy_query
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0pre8
4
+ version: 0.2.0pre9
5
5
  prerelease: 5
6
6
  platform: ruby
7
7
  authors: