Class: S2A_INFO_DETAILED_Packet

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

Overview

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

This is deprecated by 10/24/2008. GoldSrc servers use the same format as Source servers now (see S2A_INFO2_Packet).

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 Attribute Summary

Attributes included from S2A_INFO_BasePacket

#info_hash

Instance Method Summary collapse

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
# File 'lib/steam/packets/s2a_info_detailed_packet.rb', line 24

def initialize(data)
  super S2A_INFO_DETAILED_HEADER, data

  @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 @is_mod
    @mod_info = {}
    @mod_info['url_info'] = @content_data.cstring
    @mod_info['url_dl'] = @content_data.cstring
    @content_data.byte
    if @content_data.remaining == 12
      @mod_info['mod_version'] = @content_data.long
      @mod_info['mod_size'] = @content_data.long
      @mod_info['sv_only'] = @content_data.byte == 1
      @mod_info['cl_dll'] = @content_data.byte == 1
      @secure = @content_data.byte == 1
      @number_of_bots = @content_data.byte
    end
  else
    @secure = @content_data.byte == 1
    @number_of_bots = @content_data.byte
  end

  generate_info_hash
end