Skip to content

Commit

Permalink
* Ruby:
Browse files Browse the repository at this point in the history
   * Fixed ByteBuffer.get() method
   * Fixed several parenthesize warnings
  • Loading branch information
koraktor committed Aug 10, 2008
1 parent eb94db9 commit d4e67b6
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions lib/byte_buffer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def self.allocate(length)

# Creates a new buffer from an existing String
def self.wrap(byte_array)
return ByteBuffer.new byte_array.to_s
return ByteBuffer.new(byte_array.to_s)
end

#
Expand Down Expand Up @@ -107,7 +107,7 @@ def rewind
end

def put(source_byte_array)
new_position = %w{source_byte_array.length self.remaining}.min
new_position = [source_byte_array.length, self.remaining].min

@byte_array[@position, new_position] = source_byte_array
@position = new_position
Expand Down
2 changes: 1 addition & 1 deletion lib/steam/packets/master_server_query_request_packet.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,6 @@ def initialize(region_code = MasterServerQueryRequestPacket::REGION_ALL, start_i
end

def to_s
return [@header_data, @region_code, @start_ip, @filter].pack "c2Z*Z*"
return [@header_data, @region_code, @start_ip, @filter].pack("c2Z*Z*")
end
end
2 changes: 1 addition & 1 deletion lib/steam/sockets/master_server_socket.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def get_reply
self.receive_packet 1500

if @buffer.get_long != -1
raise Exception.new "Master query response has wrong packet header."
raise Exception.new("Master query response has wrong packet header.")
end

self.create_packet
Expand Down
2 changes: 1 addition & 1 deletion lib/steam/sockets/steam_socket.rb
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def finalize
def create_packet
packet_data = @buffer.get

return SteamPacket.create_packet packet_data
return SteamPacket.create_packet(packet_data)
end

end

0 comments on commit d4e67b6

Please sign in to comment.