module Nova::Starbound::DefaultBehavior::Echoable

Public Class Methods

included(reciever) click to toggle source

Called when this module is included into another module. Sets up the echo packet management.

@param reciever [Module] @return [void]

# File lib/nova/starbound/default_behavior/echoable.rb, line 11
def self.included(reciever)
  reciever.handle :packet => :echo
end

Private Instance Methods

handle_packet_echo(packet, protocol) click to toggle source

Handles the echo packet by responding to it with the same body that was sent.

@return [void]

# File lib/nova/starbound/default_behavior/echoable.rb, line 21
def handle_packet_echo(packet, protocol)
  protocol.respond_to packet, :echo, packet.body
end