def build_response_packet
      rpacket = Packet::Source.new
      total_size = 0
      request_id = 0
      type = 0
      response = ""
      message = ""
      message2 = ""

      tmp = @socket.recv(4)
      if tmp.nil?
        return nil
      end
      size = tmp.unpack("V1")
      tmp = @socket.recv(size[0])
      request_id, type, message, message2 = tmp.unpack("V1V1a*a*")
      total_size = size[0]
    
      rpacket.packet_size = total_size
      rpacket.request_id = request_id
      rpacket.command_type = type
    
      # strip nulls (this is actually the end of string1 and string2)
      message.sub! /\x00\x00$/, ""
      message2.sub! /\x00\x00$/, ""
      rpacket.string1 = message
      rpacket.string2 = message2
      return rpacket
    end
def build_response_packet
      rpacket = Packet::Source.new
      total_size = 0
      request_id = 0
      type = 0
      response = ""
      message = ""
      message2 = ""

      tmp = @socket.recv(4)
      if tmp.nil?
        return nil
      end
      size = tmp.unpack("V1")
      tmp = @socket.recv(size[0])
      request_id, type, message, message2 = tmp.unpack("V1V1a*a*")
      total_size = size[0]
    
      rpacket.packet_size = total_size
      rpacket.request_id = request_id
      rpacket.command_type = type
    
      # strip nulls (this is actually the end of string1 and string2)
      message.sub! /\x00\x00$/, ""
      message2.sub! /\x00\x00$/, ""
      rpacket.string1 = message
      rpacket.string2 = message2
      return rpacket
    end
Builds a Packet::Source packet based on the response
 given by the server.