Class: S2A_INFO_DETAILED_Packet Deprecated

Inherits:
Object
  • Object
show all
Includes:
S2A_INFO_BasePacket
Defined in:
lib/steam/packets/s2a_info_detailed_packet.rb

Overview

Deprecated.

Only outdated GoldSrc servers (before 10/24/2008) use this format. Newer ones use the same format as Source servers now (see S2A_INFO2_Packet).

This class represents a S2A_INFO_DETAILED response packet sent by a GoldSrc server

See Also:

Author:

  • Sebastian Staudt

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

Methods included from S2A_INFO_BasePacket

#info

Methods included from SteamPacket

#to_s

Constructor Details

#initialize(data) ⇒ S2A_INFO_DETAILED_Packet

Creates a new S2A_INFO_DETAILED response object based on the given data

Parameters:

  • data (String)

    The raw packet data replied from the server

See Also:

  • S2A_INFO_BasePacket#generate_info_hash


24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
# File 'lib/steam/packets/s2a_info_detailed_packet.rb', line 24

def initialize(data)
  super S2A_INFO_DETAILED_HEADER, data

  info.merge!({
    :game_ip => @content_data.cstring,
    :server_name => @content_data.cstring,
    :map_name => @content_data.cstring,
    :game_directory => @content_data.cstring,
    :game_description => @content_data.cstring,
    :number_of_players => @content_data.byte,
    :max_players => @content_data.byte,
    :network_version => @content_data.byte,
    :dedicated => @content_data.byte.chr,
    :operating_system => @content_data.byte.chr,
    :password_needed => @content_data.byte == 1,
    :is_mod => @content_data.byte == 1
  })

  if info[:is_mod]
    info[:mod_info] = {
      :url_info => @content_data.cstring,
      :url_dl => @content_data.cstring
    }
    @content_data.byte
    if @content_data.remaining == 12
      info[:mod_info].merge!({
        :mod_version => @content_data.long,
        :mod_size => @content_data.long,
        :sv_only => @content_data.byte == 1,
        :cl_dll => @content_data.byte == 1,
      })
      info[:secure] = @content_data.byte == 1
      info[:number_of_bots] = @content_data.byte
    end
  else
    info[:secure] = @content_data.byte == 1
    info[:number_of_bots] = @content_data.byte
  end
end