Class: A2M_GET_SERVERS_BATCH2_Packet

Inherits:
Object
  • Object
show all
Includes:
SteamPacket
Defined in:
lib/steam/packets/a2m_get_servers_batch2_packet.rb

Overview

This packet class represents a A2M_GET_SERVERS_BATCH2 request sent to a master server

It is used to receive a list of game servers matching the specified filters.

Filtering: Instead of filtering the results sent by the master server locally, you should at least use the following filters to narrow down the results sent by the master server. Receiving all servers from the master server is taking quite some time.

Available filters:

  • ‘typed`: Request only dedicated servers

  • ‘secure1`: Request only secure servers

  • gamedir`: Request only servers of a specific mod

  • map`: Request only servers running a specific map

  • ‘linux1`: Request only linux servers

  • ‘emtpy1`: Request only non-empty servers

  • ‘full`: Request only servers not full

  • ‘proxy1`: Request only spectator proxy servers

Constant Summary

Constants included from SteamPacket

SteamPacket::A2M_GET_SERVERS_BATCH2_HEADER, SteamPacket::A2S_INFO_HEADER, SteamPacket::A2S_PLAYER_HEADER, SteamPacket::A2S_RULES_HEADER, SteamPacket::A2S_SERVERQUERY_GETCHALLENGE_HEADER, SteamPacket::C2M_CHECKMD5_HEADER, SteamPacket::M2A_SERVER_BATCH_HEADER, SteamPacket::M2C_ISVALIDMD5_HEADER, SteamPacket::M2S_REQUESTRESTART_HEADER, SteamPacket::RCON_GOLDSRC_CHALLENGE_HEADER, SteamPacket::RCON_GOLDSRC_NO_CHALLENGE_HEADER, SteamPacket::RCON_GOLDSRC_RESPONSE_HEADER, SteamPacket::S2A_INFO2_HEADER, SteamPacket::S2A_INFO_DETAILED_HEADER, SteamPacket::S2A_LOGSTRING_HEADER, SteamPacket::S2A_PLAYER_HEADER, SteamPacket::S2A_RULES_HEADER, SteamPacket::S2C_CHALLENGE_HEADER, SteamPacket::S2C_CONNREJECT_HEADER, SteamPacket::S2M_HEARTBEAT2_HEADER

Instance Method Summary collapse

Constructor Details

#initialize(region_code = MasterServer::REGION_ALL, start_ip = '0.0.0.0:0', filter = '') ⇒ A2M_GET_SERVERS_BATCH2_Packet

Creates a master server request, filtering by the given paramters



44
45
46
47
48
49
50
# File 'lib/steam/packets/a2m_get_servers_batch2_packet.rb', line 44

def initialize(region_code = MasterServer::REGION_ALL, start_ip = '0.0.0.0:0', filter = '')
  super A2M_GET_SERVERS_BATCH2_HEADER

  @filter = filter
  @region_code = region_code
  @start_ip = start_ip
end

Instance Method Details

#to_sString

Returns the raw data representing this packet



55
56
57
# File 'lib/steam/packets/a2m_get_servers_batch2_packet.rb', line 55

def to_s
  [@header_data, @region_code, @start_ip, @filter].pack('c2Z*Z*')
end