mirror of
https://github.com/TimeCrafters/timecrafters_configuration_tool_desktop.git
synced 2025-12-15 21:32:35 +00:00
Added basic dialogs, added 'blindman' implementation of TACNET networking code, added font
This commit is contained in:
22
lib/tacnet.rb
Normal file
22
lib/tacnet.rb
Normal file
@@ -0,0 +1,22 @@
|
||||
module TAC
|
||||
class TACNET
|
||||
DEFAULT_HOSTNAME = "192.168.49.1"
|
||||
DEFAULT_PORT = 8962
|
||||
|
||||
SYNC_INTERVAL = 250 # ms
|
||||
HEARTBEAT_INTERVAL = 1_500 # ms
|
||||
|
||||
def initialize
|
||||
@connection = nil
|
||||
@server = nil
|
||||
end
|
||||
|
||||
def connect(hostname = DEFAULT_HOSTNAME, port = DEFAULT_PORT, error_callback = proc {})
|
||||
return if @connection && @connect.connected?
|
||||
|
||||
@connection = Connection.new(hostname, port)
|
||||
puts "Connecting..."
|
||||
@connection.connect(error_callback)
|
||||
end
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user