Class: Steam::Protocol::GcProtobufMessage

Inherits:
ProtobufMessage show all
Defined in:
lib/steam/protocol/gc_protobuf_message.rb

Overview

Represents a GC Message received or sent to the Steam network via the Game Coordinator.

Constant Summary

Constants included from Message

Message::PROTO_MASK

Instance Attribute Summary

Attributes included from Message

#body, #emsg, #header, #payload

Instance Method Summary collapse

Methods inherited from ProtobufMessage

#emsg, #initialize, #proto?, #session_id, #session_id=, #steam_id, #steam_id=

Methods included from Message

#decode, #encode, #initialize, #proto?, #session_id=, #steam_id=

Constructor Details

This class inherits a constructor from Steam::Protocol::ProtobufMessage

Instance Method Details

#as(klass) ⇒ Object

Convert the internal gc message into the message we care about

Parameters:

  • klass (Message)

    the type of message



10
11
12
13
14
15
# File 'lib/steam/protocol/gc_protobuf_message.rb', line 10

def as(klass)
  klass = klass.class unless klass.is_a?(Class)
  io = StringIO.new(body.payload)
  @header.decode_from(io)
  klass.decode(io.read)
end