gamespy_query 0.2.0pre4 → 0.2.0pre5

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile CHANGED
File without changes
data/Rakefile CHANGED
File without changes
data/bin/gamespy_query CHANGED
File without changes
@@ -0,0 +1,8 @@
1
+ Feature: Sync gamespy master list
2
+ To be able to view information about all the servers
3
+ As a user
4
+ I want to be able to query the master server and retrieve the information
5
+
6
+ Scenario: Query a non existent game
7
+
8
+ Scenario: Query an existing game
@@ -0,0 +1,4 @@
1
+ GamespyQuery
2
+ =============
3
+
4
+ Low level library, with commandline interface, to communicate with Gamespy enabled game servers, and Gamespy master servers.
@@ -0,0 +1,8 @@
1
+ # Include the spec
2
+ #require File.join(Rails.root, 'spec/spec_helper')
3
+ # Requires supporting ruby files with custom matchers and macros, etc,
4
+ # in spec/support/ and its subdirectories.
5
+ Dir[File.join(File.dirname(__FILE__), "../../spec/support/**/*.rb")].each {|f| require f}
6
+
7
+ # Include the helper methods for shorthand (create, build etc)
8
+ #World(FactoryGirl::Syntax::Methods)
@@ -0,0 +1,8 @@
1
+ Feature: Sync gamespy info
2
+ To be able to view information about a server
3
+ As a user
4
+ I want to be able to query the server and retrieve the information
5
+
6
+ Scenario: Query a non existent server
7
+
8
+ Scenario: Query an existing server
@@ -20,5 +20,7 @@ Gem::Specification.new do |s|
20
20
 
21
21
  s.add_runtime_dependency "cri"
22
22
  s.add_development_dependency "riot"
23
+ s.add_development_dependency "cucumber"
24
+ s.add_development_dependency "rspec"
23
25
  s.add_development_dependency "yard"
24
26
  end
@@ -69,6 +69,8 @@ STR
69
69
  str
70
70
  end
71
71
 
72
+ PLATFORM_IR = /-mswin32/
73
+
72
74
  # Float Regex
73
75
  RX_F = /\A\-?[0-9]+\.[0-9]*\Z/
74
76
  # Integer Regex
@@ -40,8 +40,6 @@ module GamespyQuery
40
40
  RX_CHALLENGE2 = /[^0-9\-]/si
41
41
  RX_SPLITNUM = /^splitnum\x00(.)/i
42
42
 
43
- PLATFORM_IR = /-mswin32/
44
-
45
43
  # TODO: Support pings
46
44
  # TODO: Handle .NET native sockets
47
45
  STATE_INIT, STATE_SENT_CHALLENGE, STATE_RECEIVED_CHALLENGE, STATE_SENT_CHALLENGE_RESPONSE, STATE_RECEIVE_DATA, STATE_READY = 0, 1, 2, 3, 4, 5
@@ -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)
76
+ def process_master(game = "arma2oapc", geo = nil, remote = nil, 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|
@@ -86,7 +86,9 @@ module GamespyQuery
86
86
 
87
87
  dat = master.process list
88
88
 
89
- sm = GamespyQuery::SocketMaster.new(dat.keys)
89
+ ded = "1"
90
+ gm_dat = sm_dedicated_only ? dat.keys.select{|k| dat[k][:gamedata] && dat[k][:gamedata][:dedicated] == ded } : dat.keys
91
+ sm = GamespyQuery::SocketMaster.new(gm_dat)
90
92
  sockets = sm.process!
91
93
  sockets.select{|s| s.valid? }.each do |s|
92
94
  begin
@@ -1,4 +1,4 @@
1
1
  module GamespyQuery
2
2
  # Version of the library
3
- VERSION = "0.2.0pre4"
3
+ VERSION = "0.2.0pre5"
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.0pre4
4
+ version: 0.2.0pre5
5
5
  prerelease: 5
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-03-10 00:00:00.000000000 Z
12
+ date: 2012-05-11 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: cri
16
- requirement: &19620600 !ruby/object:Gem::Requirement
16
+ requirement: !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,15 @@ dependencies:
21
21
  version: '0'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *19620600
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ! '>='
28
+ - !ruby/object:Gem::Version
29
+ version: '0'
25
30
  - !ruby/object:Gem::Dependency
26
31
  name: riot
27
- requirement: &19619540 !ruby/object:Gem::Requirement
32
+ requirement: !ruby/object:Gem::Requirement
28
33
  none: false
29
34
  requirements:
30
35
  - - ! '>='
@@ -32,10 +37,47 @@ dependencies:
32
37
  version: '0'
33
38
  type: :development
34
39
  prerelease: false
35
- version_requirements: *19619540
40
+ version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ! '>='
44
+ - !ruby/object:Gem::Version
45
+ version: '0'
46
+ - !ruby/object:Gem::Dependency
47
+ name: cucumber
48
+ requirement: !ruby/object:Gem::Requirement
49
+ none: false
50
+ requirements:
51
+ - - ! '>='
52
+ - !ruby/object:Gem::Version
53
+ version: '0'
54
+ type: :development
55
+ prerelease: false
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ none: false
58
+ requirements:
59
+ - - ! '>='
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ - !ruby/object:Gem::Dependency
63
+ name: rspec
64
+ requirement: !ruby/object:Gem::Requirement
65
+ none: false
66
+ requirements:
67
+ - - ! '>='
68
+ - !ruby/object:Gem::Version
69
+ version: '0'
70
+ type: :development
71
+ prerelease: false
72
+ version_requirements: !ruby/object:Gem::Requirement
73
+ none: false
74
+ requirements:
75
+ - - ! '>='
76
+ - !ruby/object:Gem::Version
77
+ version: '0'
36
78
  - !ruby/object:Gem::Dependency
37
79
  name: yard
38
- requirement: &19618960 !ruby/object:Gem::Requirement
80
+ requirement: !ruby/object:Gem::Requirement
39
81
  none: false
40
82
  requirements:
41
83
  - - ! '>='
@@ -43,7 +85,12 @@ dependencies:
43
85
  version: '0'
44
86
  type: :development
45
87
  prerelease: false
46
- version_requirements: *19618960
88
+ version_requirements: !ruby/object:Gem::Requirement
89
+ none: false
90
+ requirements:
91
+ - - ! '>='
92
+ - !ruby/object:Gem::Version
93
+ version: '0'
47
94
  description: ''
48
95
  email:
49
96
  - sb@dev-heaven.net
@@ -57,6 +104,10 @@ files:
57
104
  - README.md
58
105
  - Rakefile
59
106
  - bin/gamespy_query
107
+ - features/master/sync.feature
108
+ - features/readme.md
109
+ - features/support/rspec.rb
110
+ - features/sync.feature
60
111
  - gamespy_query.gemspec
61
112
  - lib/gamespy_query.rb
62
113
  - lib/gamespy_query/base.rb
@@ -93,7 +144,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
93
144
  version: 1.3.1
94
145
  requirements: []
95
146
  rubyforge_project: gamespy_query
96
- rubygems_version: 1.8.15
147
+ rubygems_version: 1.8.24
97
148
  signing_key:
98
149
  specification_version: 3
99
150
  summary: Ruby library for accessing Gamespy services