gamespy_query 0.2.0pre5 → 0.2.0pre6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/gamespy_query/socket_master.rb +3 -3
- data/lib/gamespy_query/version.rb +1 -1
- metadata +1 -1
@@ -73,7 +73,7 @@ module GamespyQuery
|
|
73
73
|
# @param [String] game Game to fetch info from
|
74
74
|
# @param [String] geo Geo location enabled?
|
75
75
|
# @param [Array] remote Hostname and path+filename strings if the list needs to be fetched from http server
|
76
|
-
def process_master(game = "arma2oapc", geo = nil, remote = nil, sm_dedicated_only = true)
|
76
|
+
def process_master(game = "arma2oapc", geo = nil, remote = nil, dedicated_only = false, sm_dedicated_only = true)
|
77
77
|
master = GamespyQuery::Master.new(geo, game)
|
78
78
|
list = if remote
|
79
79
|
Net::HTTP.start(remote[0]) do |http|
|
@@ -87,7 +87,7 @@ module GamespyQuery
|
|
87
87
|
dat = master.process list
|
88
88
|
|
89
89
|
ded = "1"
|
90
|
-
gm_dat = sm_dedicated_only ? dat.keys.select{|k| dat[k][:gamedata] && dat[k][:gamedata][:dedicated] == ded } : dat.keys
|
90
|
+
gm_dat = dedicated_only || sm_dedicated_only ? dat.keys.select{|k| dat[k][:gamedata] && dat[k][:gamedata][:dedicated] == ded } : dat.keys
|
91
91
|
sm = GamespyQuery::SocketMaster.new(gm_dat)
|
92
92
|
sockets = sm.process!
|
93
93
|
sockets.select{|s| s.valid? }.each do |s|
|
@@ -101,7 +101,7 @@ module GamespyQuery
|
|
101
101
|
end
|
102
102
|
end
|
103
103
|
|
104
|
-
dat.values
|
104
|
+
dedicated_only ? gm_dat : dat.values
|
105
105
|
end
|
106
106
|
end
|
107
107
|
end
|