Class: SteamCondenser::Servers::Packets::S2A_INFO_DETAILED_Packet Deprecated

Inherits:
Object
  • Object
show all
Includes:
S2A_INFO_BasePacket
Defined in:
lib/steam-condenser/servers/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 BasePacket

BasePacket::A2M_GET_SERVERS_BATCH2_HEADER, BasePacket::A2S_INFO_HEADER, BasePacket::A2S_PLAYER_HEADER, BasePacket::A2S_RULES_HEADER, BasePacket::A2S_SERVERQUERY_GETCHALLENGE_HEADER, BasePacket::C2M_CHECKMD5_HEADER, BasePacket::M2A_SERVER_BATCH_HEADER, BasePacket::RCON_GOLDSRC_CHALLENGE_HEADER, BasePacket::RCON_GOLDSRC_NO_CHALLENGE_HEADER, BasePacket::RCON_GOLDSRC_RESPONSE_HEADER, BasePacket::S2A_INFO2_HEADER, BasePacket::S2A_INFO_DETAILED_HEADER, BasePacket::S2A_PLAYER_HEADER, BasePacket::S2A_RULES_HEADER, BasePacket::S2C_CHALLENGE_HEADER, BasePacket::S2C_CONNREJECT_HEADER

Instance Method Summary collapse

Methods included from S2A_INFO_BasePacket

#info

Methods included from BasePacket

#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

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
63
64
# File 'lib/steam-condenser/servers/packets/s2a_info_detailed_packet.rb', line 26

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.getbyte,
    :max_players => @content_data.getbyte,
    :network_version => @content_data.getbyte,
    :dedicated => @content_data.getc,
    :operating_system => @content_data.getc,
    :password_needed => @content_data.getbyte == 1,
    :is_mod => @content_data.getbyte == 1
  })

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