Sha256: 941d6d219be8fb7fd43a17e5ea18eef834bbc5d1929a7da23613f1274fd2afb5

Contents?: true

Size: 541 Bytes

Versions: 4

Compression:

Stored size: 541 Bytes

Contents

# frozen_string_literal: true
module Steam
  module Protocol
    # Represents a GC Message received or sent to the Steam
    # network via the Game Coordinator.
    class GcProtobufMessage < ProtobufMessage
      # Convert the internal gc message into the message we care about
      #
      # @param klass [Message] the type of message
      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
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
steamrb-0.1.3 lib/steam/protocol/gc_protobuf_message.rb
steamrb-0.1.2 lib/steam/protocol/gc_protobuf_message.rb
steamrb-0.1.1 lib/steam/protocol/gc_protobuf_message.rb
steamrb-0.1.0 lib/steam/protocol/gc_protobuf_message.rb