Class: Wc3Protocol::Broadcast
- Inherits:
-
Object
- Object
- Wc3Protocol::Broadcast
- Defined in:
- lib/wc3_protocol/broadcast.rb
Constant Summary collapse
- GAME_TYPE =
{ 'TFT' => 'W3XP', 'ROC' => 'WAR3' }
Class Method Summary collapse
-
.find_games(port: 6112, version: '1.27', game_type: 'TFT') ⇒ Array<Wc3Protocol::ServerInfo>
Server info of found games.
Class Method Details
.find_games(port: 6112, version: '1.27', game_type: 'TFT') ⇒ Array<Wc3Protocol::ServerInfo>
Returns server info of found games.
21 22 23 24 25 26 |
# File 'lib/wc3_protocol/broadcast.rb', line 21 def self.find_games port: 6112, version: '1.27', game_type: 'TFT' _broadcast_request port: port, version: version, game_type: game_type # @type [Array<Wc3Protocol::Message>] = _broadcast_receive .select { |m| Protocol::BYTE_OP_CODE[m.op_code] == :GAME_INFORMATION }.map { |m| Wc3Protocol::ServerInfo.new(m) } end |