X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=lib%2Frbot%2Fcore%2Fremote.rb;h=7ffb62e1bb6e5a2e7613e67b22456c486e5ff85e;hb=2ecf2f58c843895ce4ad143d0a05283c4b7e37e8;hp=de0ade5f32b7ff6986d2a5edd46f8074b3088d4c;hpb=6c3e3cb81675402f8fa8f74b514be6e8e489f8eb;p=user%2Fhenk%2Fcode%2Fruby%2Frbot.git diff --git a/lib/rbot/core/remote.rb b/lib/rbot/core/remote.rb index de0ade5f..7ffb62e1 100644 --- a/lib/rbot/core/remote.rb +++ b/lib/rbot/core/remote.rb @@ -11,11 +11,11 @@ # # TODO find a way to manage session id (logging out, manually and/or # automatically) -# require 'drb/drb' module ::Irc +class Bot module Auth @@ -36,9 +36,9 @@ module ::Irc end end - # We extend the AuthManagerClass to handle remote logins + # We extend the ManagerClass to handle remote logins # - class AuthManagerClass + class ManagerClass MAX_SESSION_ID = 2**128 - 1 @@ -193,9 +193,7 @@ module ::Irc end - class IrcBot - - # The Irc::IrcBot::RemoteObject class represents and object that will take care + # The Irc::Bot::RemoteObject class represents and object that will take care # of interfacing with remote clients # # Example client session: @@ -235,6 +233,8 @@ module ::Irc m = RemoteMessage.new(@bot, client, cmd) @bot.remote_dispatcher.handle(m) end + + private :instance_variables, :instance_variable_get, :instance_variable_set end # The bot also manages a single (for the moment) remote dispatcher. This method @@ -259,8 +259,6 @@ module ::Irc end end - end - module Plugins # We create a new Ruby module that can be included by BotModules that want to @@ -308,22 +306,23 @@ module ::Irc end end +end class RemoteModule < CoreBotModule include RemoteCoreBotModule - BotConfig.register BotConfigBooleanValue.new('remote.autostart', + Config.register Config::BooleanValue.new('remote.autostart', :default => true, :requires_rescan => true, :desc => "Whether the remote service provider should be started automatically") - BotConfig.register BotConfigIntegerValue.new('remote.port', + Config.register Config::IntegerValue.new('remote.port', :default => 7268, # that's 'rbot' :requires_rescan => true, :desc => "Port on which the remote interface will be presented") - BotConfig.register BotConfigStringValue.new('remote.host', + Config.register Config::StringValue.new('remote.host', :default => '', :requires_rescan => true, :desc => "Port on which the remote interface will be presented")