Class: MCP::Packet

Inherits:
BinData::Record
  • Object
show all
Defined in:
lib/mcp/packets_util.rb

Constant Summary collapse

Id =
-1
Type =
:both

Instance Method Summary collapse

Instance Method Details

#with_idObject



18
19
20
21
22
# File 'lib/mcp/packets_util.rb', line 18

def with_id
    packet = self.class
    id = packet::Id rescue 0
    MCUbyte.new(id).to_binary_s + to_binary_s
end