Class: Wc3Protocol::Message
- Inherits:
-
Object
- Object
- Wc3Protocol::Message
- Defined in:
- lib/wc3_protocol/message.rb
Instance Attribute Summary collapse
-
#game_computer_or_closed_slots ⇒ Object
readonly
Returns the value of attribute game_computer_or_closed_slots.
-
#game_filled_slots ⇒ Object
readonly
Returns the value of attribute game_filled_slots.
-
#game_flags ⇒ Object
readonly
Returns the value of attribute game_flags.
-
#game_id ⇒ Object
readonly
Returns the value of attribute game_id.
-
#game_map_height ⇒ Object
readonly
Returns the value of attribute game_map_height.
-
#game_map_name ⇒ Object
readonly
attr_reader :zero_flag.
-
#game_map_width ⇒ Object
readonly
Returns the value of attribute game_map_width.
-
#game_name ⇒ Object
readonly
Returns the value of attribute game_name.
-
#game_non_computer_slots ⇒ Object
readonly
Returns the value of attribute game_non_computer_slots.
-
#game_number_of_slots ⇒ Object
readonly
Returns the value of attribute game_number_of_slots.
-
#game_player_slots ⇒ Object
readonly
Returns the value of attribute game_player_slots.
-
#game_port ⇒ Object
readonly
attr_reader :unknown_byte.
-
#game_remaining_slots ⇒ Object
readonly
Returns the value of attribute game_remaining_slots.
-
#game_settings ⇒ Object
readonly
Returns the value of attribute game_settings.
-
#game_type ⇒ Object
readonly
Returns the value of attribute game_type.
-
#game_version ⇒ Object
readonly
Returns the value of attribute game_version.
-
#magic_byte ⇒ Object
readonly
Returns the value of attribute magic_byte.
-
#op_code ⇒ Object
readonly
Returns the value of attribute op_code.
-
#packet_size ⇒ Object
readonly
Returns the value of attribute packet_size.
-
#raw_bytes ⇒ Object
readonly
Returns the value of attribute raw_bytes.
-
#raw_bytes_hex ⇒ Object
readonly
Returns the value of attribute raw_bytes_hex.
-
#sender_address_family ⇒ Object
readonly
Returns the value of attribute sender_address_family.
-
#sender_hostname ⇒ Object
readonly
Returns the value of attribute sender_hostname.
-
#sender_ip_address ⇒ Object
readonly
Returns the value of attribute sender_ip_address.
-
#sender_port ⇒ Object
readonly
Returns the value of attribute sender_port.
-
#tick_counts_ms ⇒ Object
readonly
Returns the value of attribute tick_counts_ms.
Instance Method Summary collapse
- #battle_net? ⇒ Boolean
-
#initialize(raw_msg:, raw_sender_info:) ⇒ Message
constructor
A new instance of Message.
- #lan? ⇒ Boolean
Constructor Details
#initialize(raw_msg:, raw_sender_info:) ⇒ Message
Returns a new instance of Message.
38 39 40 |
# File 'lib/wc3_protocol/message.rb', line 38 def initialize(raw_msg:, raw_sender_info:) raw_msg, raw_sender_info end |
Instance Attribute Details
#game_computer_or_closed_slots ⇒ Object (readonly)
Returns the value of attribute game_computer_or_closed_slots.
32 33 34 |
# File 'lib/wc3_protocol/message.rb', line 32 def game_computer_or_closed_slots @game_computer_or_closed_slots end |
#game_filled_slots ⇒ Object (readonly)
Returns the value of attribute game_filled_slots.
34 35 36 |
# File 'lib/wc3_protocol/message.rb', line 34 def game_filled_slots @game_filled_slots end |
#game_flags ⇒ Object (readonly)
Returns the value of attribute game_flags.
29 30 31 |
# File 'lib/wc3_protocol/message.rb', line 29 def game_flags @game_flags end |
#game_id ⇒ Object (readonly)
Returns the value of attribute game_id.
20 21 22 |
# File 'lib/wc3_protocol/message.rb', line 20 def game_id @game_id end |
#game_map_height ⇒ Object (readonly)
Returns the value of attribute game_map_height.
27 28 29 |
# File 'lib/wc3_protocol/message.rb', line 27 def game_map_height @game_map_height end |
#game_map_name ⇒ Object (readonly)
attr_reader :zero_flag
25 26 27 |
# File 'lib/wc3_protocol/message.rb', line 25 def game_map_name @game_map_name end |
#game_map_width ⇒ Object (readonly)
Returns the value of attribute game_map_width.
26 27 28 |
# File 'lib/wc3_protocol/message.rb', line 26 def game_map_width @game_map_width end |
#game_name ⇒ Object (readonly)
Returns the value of attribute game_name.
23 24 25 |
# File 'lib/wc3_protocol/message.rb', line 23 def game_name @game_name end |
#game_non_computer_slots ⇒ Object (readonly)
Returns the value of attribute game_non_computer_slots.
31 32 33 |
# File 'lib/wc3_protocol/message.rb', line 31 def game_non_computer_slots @game_non_computer_slots end |
#game_number_of_slots ⇒ Object (readonly)
Returns the value of attribute game_number_of_slots.
28 29 30 |
# File 'lib/wc3_protocol/message.rb', line 28 def game_number_of_slots @game_number_of_slots end |
#game_player_slots ⇒ Object (readonly)
Returns the value of attribute game_player_slots.
30 31 32 |
# File 'lib/wc3_protocol/message.rb', line 30 def game_player_slots @game_player_slots end |
#game_port ⇒ Object (readonly)
attr_reader :unknown_byte
36 37 38 |
# File 'lib/wc3_protocol/message.rb', line 36 def game_port @game_port end |
#game_remaining_slots ⇒ Object (readonly)
Returns the value of attribute game_remaining_slots.
33 34 35 |
# File 'lib/wc3_protocol/message.rb', line 33 def game_remaining_slots @game_remaining_slots end |
#game_settings ⇒ Object (readonly)
Returns the value of attribute game_settings.
22 23 24 |
# File 'lib/wc3_protocol/message.rb', line 22 def game_settings @game_settings end |
#game_type ⇒ Object (readonly)
Returns the value of attribute game_type.
18 19 20 |
# File 'lib/wc3_protocol/message.rb', line 18 def game_type @game_type end |
#game_version ⇒ Object (readonly)
Returns the value of attribute game_version.
19 20 21 |
# File 'lib/wc3_protocol/message.rb', line 19 def game_version @game_version end |
#magic_byte ⇒ Object (readonly)
Returns the value of attribute magic_byte.
15 16 17 |
# File 'lib/wc3_protocol/message.rb', line 15 def magic_byte @magic_byte end |
#op_code ⇒ Object (readonly)
Returns the value of attribute op_code.
16 17 18 |
# File 'lib/wc3_protocol/message.rb', line 16 def op_code @op_code end |
#packet_size ⇒ Object (readonly)
Returns the value of attribute packet_size.
17 18 19 |
# File 'lib/wc3_protocol/message.rb', line 17 def packet_size @packet_size end |
#raw_bytes ⇒ Object (readonly)
Returns the value of attribute raw_bytes.
12 13 14 |
# File 'lib/wc3_protocol/message.rb', line 12 def raw_bytes @raw_bytes end |
#raw_bytes_hex ⇒ Object (readonly)
Returns the value of attribute raw_bytes_hex.
13 14 15 |
# File 'lib/wc3_protocol/message.rb', line 13 def raw_bytes_hex @raw_bytes_hex end |
#sender_address_family ⇒ Object (readonly)
Returns the value of attribute sender_address_family.
7 8 9 |
# File 'lib/wc3_protocol/message.rb', line 7 def sender_address_family @sender_address_family end |
#sender_hostname ⇒ Object (readonly)
Returns the value of attribute sender_hostname.
9 10 11 |
# File 'lib/wc3_protocol/message.rb', line 9 def sender_hostname @sender_hostname end |
#sender_ip_address ⇒ Object (readonly)
Returns the value of attribute sender_ip_address.
10 11 12 |
# File 'lib/wc3_protocol/message.rb', line 10 def sender_ip_address @sender_ip_address end |
#sender_port ⇒ Object (readonly)
Returns the value of attribute sender_port.
8 9 10 |
# File 'lib/wc3_protocol/message.rb', line 8 def sender_port @sender_port end |
#tick_counts_ms ⇒ Object (readonly)
Returns the value of attribute tick_counts_ms.
21 22 23 |
# File 'lib/wc3_protocol/message.rb', line 21 def tick_counts_ms @tick_counts_ms end |
Instance Method Details
#battle_net? ⇒ Boolean
46 47 48 |
# File 'lib/wc3_protocol/message.rb', line 46 def battle_net? @magic_byte == 'ff' end |
#lan? ⇒ Boolean
42 43 44 |
# File 'lib/wc3_protocol/message.rb', line 42 def lan? !battle_net? end |