new framework
This commit is contained in:
@@ -7,17 +7,21 @@ module BBS
|
||||
include Telnet
|
||||
|
||||
attr_reader :session_id, :term_cols, :term_rows
|
||||
attr_accessor :idle_seconds
|
||||
|
||||
def initialize(client)
|
||||
@client = client
|
||||
@session_id = SecureRandom.hex(8)
|
||||
@client = client
|
||||
@session_id = SecureRandom.hex(8)
|
||||
@idle_seconds = BBS.config.idle_seconds
|
||||
end
|
||||
|
||||
def run
|
||||
negotiate
|
||||
enable_mouse if BBS.config.mouse
|
||||
flow = BBS.config.flow or raise "BBS.config.flow is not set"
|
||||
FlowRunner.new(self, @session_id, flow).run
|
||||
ensure
|
||||
disable_mouse rescue nil
|
||||
@client.close rescue nil
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user