# bot's Language data
attr_reader :lang
- # bot's configured addressing prefixes
- attr_reader :addressing_prefixes
-
# channel info for channels the bot is in
attr_reader :channels
# begin event handling loop
def mainloop
while true
+ begin
connect
@timer.start
- begin
while true
if @socket.select
break unless reply = @socket.gets
end
puts "disconnected"
+ @last_ping = nil
@channels.clear
@socket.clearq
# we'll ping the server every 30 seconds or so, and expect a response
# before the next one come around..
def start_server_pings
+ @last_ping = nil
# stop existing timers if running
unless @ping_timer.nil?
@timer.remove @ping_timer
rescue
debug "couldn't shutdown connection (already shutdown?)"
end
+ @last_ping = nil
end
end
}