Class: Steam::Handler::Auth

Inherits:
Object
  • Object
show all
Includes:
Base
Defined in:
lib/steam/handler/auth.rb

Overview

Steam Auth handler. Handles channel encryption and decryption.

Examples:

Using the handler inside Handler::Collection

collection = Handler::Collection.new
collection << Handler::Auth.new
collection.handle(packet)

Using the handler stand alone

handler = Handler::Auth.new
handler.handle_packet(packet)

Instance Attribute Summary

Attributes included from Base

#client

Instance Method Summary collapse

Methods included from Base

#handles?, included, #send_msg

Constructor Details

#initializeAuth

Override the constructor to set our key to nil. This key will be used if the encryption is a success to decode and encode all future packet data.



23
24
25
26
# File 'lib/steam/handler/auth.rb', line 23

def initialize(*)
  super
  @key = nil
end

Instance Method Details

#handle(packet) ⇒ Object

Handles the given packet. This handler is only concerned about the channel encryption request and result.

Parameters:



32
33
34
35
36
37
38
39
# File 'lib/steam/handler/auth.rb', line 32

def handle(packet)
  case packet.msg_type
  when EMsg::CHANNEL_ENCRYPT_REQUEST
    handle_channel_encrypt_request(packet)
  when EMsg::CHANNEL_ENCRYPT_RESULT
    handle_channel_encrypt_result(packet)
  end
end