X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=lib%2Frbot%2Fircbot.rb;h=b36cd36ded25a65ae74fd798ec7094c32939c615;hb=8246bd135ebf319beae8fec39620f4c4c7e54601;hp=89037255d50c490e148bfcf1bcd87074a5b9da8c;hpb=8b0e2e09f81a7d89ceb52e947e9db12a206a8c37;p=user%2Fhenk%2Fcode%2Fruby%2Frbot.git diff --git a/lib/rbot/ircbot.rb b/lib/rbot/ircbot.rb index 89037255..b36cd36d 100644 --- a/lib/rbot/ircbot.rb +++ b/lib/rbot/ircbot.rb @@ -122,8 +122,8 @@ class IrcBot exit 2 end - #botclass = "#{Etc.getpwnam(Etc.getlogin).dir}/.rbot" unless botclass - botclass = "#{ENV['HOME']}/.rbot" unless botclass + botclass = "#{Etc.getpwuid(Process::Sys.geteuid)[:dir]}/.rbot" unless botclass + #botclass = "#{ENV['HOME']}/.rbot" unless botclass @botclass = botclass.gsub(/\/$/, "") unless FileTest.directory? botclass @@ -302,7 +302,7 @@ class IrcBot } @client[:unknown] = proc {|data| #debug "UNKNOWN: #{data[:serverstring]}" - log data[:serverstring], ":unknown" + log data[:serverstring], ".unknown" } end @@ -329,8 +329,8 @@ class IrcBot def mainloop while true begin - connect - @timer.start + connect + @timer.start while true if @socket.select @@ -439,6 +439,7 @@ class IrcBot def log(message, where="server") message.chomp! stamp = Time.now.strftime("%Y/%m/%d %H:%M:%S") + where.gsub!(/[:!?$*()\/\\<>|"']/, "_") unless(@logs.has_key?(where)) @logs[where] = File.new("#{@botclass}/logs/#{where}", "a") @logs[where].sync = true @@ -496,7 +497,6 @@ class IrcBot # call the save method for bot's config, keywords, auth and all plugins def save - @registry.flush @config.save @keywords.save @auth.save