Module: Gt06Server::Protocol

Defined in:
lib/gt06_server/protocol.rb

Class Method Summary collapse

Class Method Details

.acknowledgment_pack_for(pack) ⇒ Object

Parameters:



22
23
24
25
26
27
28
# File 'lib/gt06_server/protocol.rb', line 22

def acknowledgment_pack_for(pack)
  ack_pack = ServerAckPacket.new
  ack_pack.protocol_number = pack.payload.protocol_number
  ack_pack.serial_number = pack.payload.serial_number

  ack_pack
end

.command_pack(command) ⇒ Object

TODO



31
32
# File 'lib/gt06_server/protocol.rb', line 31

def command_pack(command)
end

.read_pack(io) ⇒ Object

Parameters:

  • io (IO)


8
9
10
# File 'lib/gt06_server/protocol.rb', line 8

def read_pack(io)
  TerminalPacket.read(io)
end

.replay_on(pack) ⇒ ServerAckPacket?

Parameters:

Returns:



14
15
16
17
18
# File 'lib/gt06_server/protocol.rb', line 14

def replay_on(pack)
  if [:login_message, :status_information].include?(pack.payload.message_type.to_sym)
    acknowledgment_pack_for(pack)
  end
end