class Telnet

Public Class Methods

new() click to toggle source
Calls superclass method
# File bin/iniquity, line 35
def initialize
    super

    # Disable line-wrapping (SyncTerm does not honor, careful!)
    send_data "\x1b[7l"

    # Save xterm icon and window title on stack.
    # send_data "\x1b[22;0"

    send_data "\n #{ANSI::Code.white}Iniquity BBS :: #{ANSI::Code.red }Build 0.0.19 - #{ANSI::Code.blue_on_white}Telnet Connection!\n"

    artwork = File.join(File.dirname(File.expand_path(__FILE__)), "../artwork/we-iniq3.ans")

    IO.readlines(artwork).each do |line|
        EM.next_tick { send_data line }
    end
end

Public Instance Methods

post_init() click to toggle source
# File bin/iniquity, line 53
def post_init
    puts "iniquity - Someone connected to the system..."
end
receive_data(data) click to toggle source
# File bin/iniquity, line 57
def receive_data data
    #send_data ">>>you sent: #{data}"
    close_connection if data =~ /quit|q|goodbye|g|logoff|l/i

end
unbind() click to toggle source
# File bin/iniquity, line 63
def unbind
    puts "iniquity - Someone disconnected from the system..."
end