Class: GameOverseer::PacketHandler

Inherits:
Object
  • Object
show all
Defined in:
lib/gameoverseer/packet_handler/packet_handler.rb

Direct Known Subclasses

JsonPacketHandler, MessagePackPacketHandler

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializePacketHandler

Returns a new instance of PacketHandler.



4
5
6
7
# File 'lib/gameoverseer/packet_handler/packet_handler.rb', line 4

def initialize
  PacketHandler.instance = self
  setup
end

Class Method Details

.instanceObject



21
22
23
# File 'lib/gameoverseer/packet_handler/packet_handler.rb', line 21

def self.instance
  @instance
end

.instance=(_instance) ⇒ Object



25
26
27
# File 'lib/gameoverseer/packet_handler/packet_handler.rb', line 25

def self.instance=(_instance)
  @instance = _instance
end

Instance Method Details

#pre_processor(packet, sending) ⇒ Object



12
13
# File 'lib/gameoverseer/packet_handler/packet_handler.rb', line 12

def pre_processor(packet, sending)
end

#receive(client_id, packet) ⇒ Object



15
16
# File 'lib/gameoverseer/packet_handler/packet_handler.rb', line 15

def receive(client_id, packet)
end

#setupObject



9
10
# File 'lib/gameoverseer/packet_handler/packet_handler.rb', line 9

def setup
end

#transmit(client_id, data) ⇒ Object



18
19
# File 'lib/gameoverseer/packet_handler/packet_handler.rb', line 18

def transmit(client_id, data)
end