Class: Steam::Protocol::GcProtobufMessage
- Inherits:
-
ProtobufMessage
- Object
- ProtobufMessage
- Steam::Protocol::GcProtobufMessage
- 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
Instance Attribute Summary
Attributes included from Message
#body, #emsg, #header, #payload
Instance Method Summary collapse
-
#as(klass) ⇒ Object
Convert the internal gc message into the message we care about.
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
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 |