Sha256: 728bb446ebeafb9073254f291c37b7b0e2886175be17c2e9f9630f1773f78e95

Contents?: true

Size: 726 Bytes

Versions: 3

Compression:

Stored size: 726 Bytes

Contents

module Wc3Protocol

  class ServerInfo
    attr_reader :name
    attr_reader :taken_slots
    attr_reader :max_slots
    attr_reader :map_name

    attr_reader :game_type
    attr_reader :game_version

    attr_reader :remote_address
    attr_reader :remote_port

    # @param [Wc3Protocol::Message] message
    def initialize(message)
      @name = message.game_name
      @taken_slots = message.game_number_of_slots - message.game_remaining_slots
      @max_slots = message.game_number_of_slots
      @map_name = message.game_map_name
      @remote_address = message.sender_ip_address
      @remote_port = message.sender_port
      @game_version = message.game_version
      @game_type = message.game_type
    end
  end

end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
wc3_protocol-0.0.3 lib/wc3_protocol/server_info.rb
wc3_protocol-0.0.2 lib/wc3_protocol/server_info.rb
wc3_protocol-0.0.1 lib/wc3_protocol/server_info.rb