mirror of
https://github.com/cyberarm/i-mic-fps.git
synced 2025-12-16 08:02:36 +00:00
Stubbed out files for networking
This commit is contained in:
18
lib/networking/packet.rb
Normal file
18
lib/networking/packet.rb
Normal file
@@ -0,0 +1,18 @@
|
||||
class IMICFPS
|
||||
module Networking
|
||||
class Packet
|
||||
def initialize(type:, payload:)
|
||||
end
|
||||
|
||||
def self.encode(packet)
|
||||
"#{packet.type}|#{packet.payload}"
|
||||
end
|
||||
|
||||
def self.decode(string)
|
||||
split = string.split("|")
|
||||
|
||||
Packet.new(split.first, split.last)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user