Class: S2C_CHALLENGE_Packet

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

Overview

This packet class represents a S2C_CHALLENGE response replied by a game server

It is used to provide a challenge number to a client requesting information from the game 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 SteamPacket

#to_s

Constructor Details

#initialize(challenge_number) ⇒ S2C_CHALLENGE_Packet

Creates a new S2C_CHALLENGE response object based on the given data

Parameters:

  • challenge_number (String)

    The raw packet data replied from the server



24
25
26
# File 'lib/steam/packets/s2c_challenge_packet.rb', line 24

def initialize(challenge_number)
  super S2C_CHALLENGE_HEADER, challenge_number
end

Instance Method Details

#challenge_numberFixnum

Returns the challenge number received from the game server

Returns:

  • (Fixnum)

    The challenge number provided by the game server



31
32
33
34
# File 'lib/steam/packets/s2c_challenge_packet.rb', line 31

def challenge_number
  @content_data.rewind
  @content_data.long
end