Class: Steam::Protocol::ProtobufMessage
- Inherits:
-
Object
- Object
- Steam::Protocol::ProtobufMessage
- Includes:
- Message
- Defined in:
- lib/steam/protocol/protobuf_message.rb
Overview
Represents a Protobuf message. They have a protobuf header, and body. Their emsg is masked with the PROTO_MASK flag
Direct Known Subclasses
Constant Summary
Constants included from Message
Instance Attribute Summary
Attributes included from Message
Instance Method Summary collapse
-
#emsg ⇒ Object
Returns the masked protobuf emsg.
-
#initialize(header, body, emsg) ⇒ ProtobufMessage
constructor
A Protobuf Message contains a steam id and a session id.
- #proto? ⇒ Boolean
-
#session_id ⇒ Integer
Get the steam_id associated with this message.
-
#session_id=(sid) ⇒ Object
The session id associated with the message.
-
#steam_id ⇒ Integer
Get the steam_id associated with this message.
-
#steam_id=(sid) ⇒ Object
The steam id associated with the message.
Methods included from Message
Constructor Details
#initialize(header, body, emsg) ⇒ ProtobufMessage
A Protobuf Message contains a steam id and a session id. It also uses the PROTO_MASK on the EMsg.
11 12 13 |
# File 'lib/steam/protocol/protobuf_message.rb', line 11 def initialize(header, body, emsg) super(header, body, emsg | PROTO_MASK) end |
Instance Method Details
#emsg ⇒ Object
Returns the masked protobuf emsg
16 17 18 |
# File 'lib/steam/protocol/protobuf_message.rb', line 16 def emsg @emsg & ~PROTO_MASK end |
#proto? ⇒ Boolean
49 50 51 |
# File 'lib/steam/protocol/protobuf_message.rb', line 49 def proto? true end |
#session_id ⇒ Integer
Get the steam_id associated with this message
31 32 33 |
# File 'lib/steam/protocol/protobuf_message.rb', line 31 def session_id @header.proto.client_sessionid end |
#session_id=(sid) ⇒ Object
The session id associated with the message
45 46 47 |
# File 'lib/steam/protocol/protobuf_message.rb', line 45 def session_id=(sid) @header.proto.client_sessionid = sid end |
#steam_id ⇒ Integer
Get the steam_id associated with this message
23 24 25 |
# File 'lib/steam/protocol/protobuf_message.rb', line 23 def steam_id @header.proto.steamid end |
#steam_id=(sid) ⇒ Object
The steam id associated with the message
38 39 40 |
# File 'lib/steam/protocol/protobuf_message.rb', line 38 def steam_id=(sid) @header.proto.steamid = sid end |