rcon 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/bin/rcontool +2 -2
  2. data/lib/rcon.rb +12 -6
  3. metadata +4 -4
@@ -174,13 +174,13 @@ def get_options
174
174
  s2 = ARGV.shift
175
175
 
176
176
  begin
177
- options.ip_address = IP::Address.new(s1)
177
+ options.ip_address = IP::Address::IPv4.new(s1)
178
178
  options.command = s2
179
179
  rescue IP::AddressException => e
180
180
  # attempt to split it first... not sure how to best handle this situation
181
181
  begin
182
182
  ip,port = s1.split(/:/, 2)
183
- options.ip_address = IP::Address.new(ip)
183
+ options.ip_address = IP::Address::IPv4.new(ip)
184
184
  options.port = port.to_i
185
185
  options.command = s2
186
186
  rescue Exception => e
@@ -5,10 +5,10 @@ require 'socket'
5
5
  # 2 (Source Engine) RCon (Remote Console) protocols.
6
6
  #
7
7
  # Version:: 0.2.0
8
- #
9
8
  # Author:: Erik Hollensbe <erik@hollensbe.org>
10
- #
11
9
  # License:: BSD
10
+ # Contact:: erik@hollensbe.org
11
+ # Copyright:: Copyright (c) 2005-2006 Erik Hollensbe
12
12
  #
13
13
  # The relevant modules to query RCon are in the RCon::Query namespace,
14
14
  # under RCon::Query::Original (for Quake 1/2/3 and Half-Life), and
@@ -29,7 +29,7 @@ require 'socket'
29
29
  #
30
30
  # rcon.cvar("mp_friendlyfire") => 1
31
31
  #
32
- # ================================================================
32
+ #--
33
33
  #
34
34
  # The compilation of software known as rcon.rb is distributed under the
35
35
  # following terms:
@@ -52,6 +52,7 @@ require 'socket'
52
52
  # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
53
53
  # SUCH DAMAGE.
54
54
  #
55
+ #++
55
56
 
56
57
 
57
58
  class RCon
@@ -284,10 +285,9 @@ class RCon::Query::Original < RCon::Query
284
285
  return "" if @socket.nil?
285
286
 
286
287
  retval = ""
287
- packet = ""
288
288
  loop do
289
289
  break unless IO.select([@socket], nil, nil, 10)
290
- packet << @socket.recv(8192)
290
+ packet = @socket.recv(8192)
291
291
  retval << packet
292
292
  break if packet.length < 8192
293
293
  end
@@ -445,8 +445,14 @@ class RCon::Query::Source < RCon::Query
445
445
  response = ""
446
446
  message = ""
447
447
 
448
+
448
449
  loop do
449
- break unless IO.select([@socket], nil, nil, 1)
450
+ break unless IO.select([@socket], nil, nil, 10)
451
+
452
+ #
453
+ # TODO: clean this up - read everything and then unpack.
454
+ #
455
+
450
456
  tmp = @socket.recv(14)
451
457
  if tmp.nil?
452
458
  return nil
metadata CHANGED
@@ -3,14 +3,14 @@ rubygems_version: 0.8.11
3
3
  specification_version: 1
4
4
  name: rcon
5
5
  version: !ruby/object:Gem::Version
6
- version: 0.2.0
7
- date: 2006-02-08 00:00:00 -08:00
6
+ version: 0.2.1
7
+ date: 2006-05-21 00:00:00 -07:00
8
8
  summary: Ruby class to work with Quake 1/2/3, Half-Life and Source Engine rcon (remote console)
9
9
  require_paths:
10
10
  - lib
11
11
  email: erik@hollensbe.org
12
12
  homepage:
13
- rubyforge_project:
13
+ rubyforge_project: rcon
14
14
  description:
15
15
  autorequire: rcon
16
16
  default_executable:
@@ -50,5 +50,5 @@ dependencies:
50
50
  requirements:
51
51
  - - ">="
52
52
  - !ruby/object:Gem::Version
53
- version: 0.1.1
53
+ version: 0.2.1
54
54
  version: