# 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