Class: Wc3Protocol::ServerInfo

Inherits:
Object
  • Object
show all
Defined in:
lib/wc3_protocol/server_info.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(message) ⇒ ServerInfo

Returns a new instance of ServerInfo.

Parameters:



16
17
18
19
20
21
22
23
24
25
# File 'lib/wc3_protocol/server_info.rb', line 16

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

Instance Attribute Details

#game_typeObject (readonly)

Returns the value of attribute game_type.



9
10
11
# File 'lib/wc3_protocol/server_info.rb', line 9

def game_type
  @game_type
end

#game_versionObject (readonly)

Returns the value of attribute game_version.



10
11
12
# File 'lib/wc3_protocol/server_info.rb', line 10

def game_version
  @game_version
end

#map_nameObject (readonly)

Returns the value of attribute map_name.



7
8
9
# File 'lib/wc3_protocol/server_info.rb', line 7

def map_name
  @map_name
end

#max_slotsObject (readonly)

Returns the value of attribute max_slots.



6
7
8
# File 'lib/wc3_protocol/server_info.rb', line 6

def max_slots
  @max_slots
end

#nameObject (readonly)

Returns the value of attribute name.



4
5
6
# File 'lib/wc3_protocol/server_info.rb', line 4

def name
  @name
end

#remote_addressObject (readonly)

Returns the value of attribute remote_address.



12
13
14
# File 'lib/wc3_protocol/server_info.rb', line 12

def remote_address
  @remote_address
end

#remote_portObject (readonly)

Returns the value of attribute remote_port.



13
14
15
# File 'lib/wc3_protocol/server_info.rb', line 13

def remote_port
  @remote_port
end

#taken_slotsObject (readonly)

Returns the value of attribute taken_slots.



5
6
7
# File 'lib/wc3_protocol/server_info.rb', line 5

def taken_slots
  @taken_slots
end