### Home Classes Methods

### In Files

- lib/rbot/core/remote.rb

### Parent

CoreBotModule

### Methods

- ::new
- #cleanup
- #handle_start
- #remote_login
- #remote_test
- #start_service
- #stop_service

### Included Modules

- RemoteCoreBotModule

### Class/Module Index

Quicksearch

- Irc
- Irc::AsciiCasemap
- Irc::BanlistMessage
- Irc::BasicUserMessage
- Irc::Bot
- Irc::Bot::Auth
- Irc::Bot::Auth::BotOwnerClass
- Irc::Bot::Auth::BotUser
- Irc::Bot::Auth::Command
- Irc::Bot::Auth::DefaultBotUserClass
- Irc::Bot::Auth::InvalidPassword
- Irc::Bot::Auth::ManagerClass
- Irc::Bot::Auth::PermissionSet
- Irc::Bot::Config
- Irc::Bot::Config::ArrayValue
- Irc::Bot::Config::BooleanValue
- Irc::Bot::Config::EnumValue
- Irc::Bot::Config::FloatValue
- Irc::Bot::Config::IntegerValue
- Irc::Bot::Config::ManagerClass
- Irc::Bot::Config::StringValue
- Irc::Bot::Config::Value
- Irc::Bot::Config::Wizard
- Irc::Bot::DataFilter
- Irc::Bot::DataStream
- Irc::Bot::Language
- Irc::Bot::MessageMapper
- Irc::Bot::MessageMapper::Failure
- Irc::Bot::MessageMapper::FriendlyFailure
- Irc::Bot::MessageMapper::NoActionFailure
- Irc::Bot::MessageMapper::NoMatchFailure
- Irc::Bot::MessageMapper::NotPrivateFailure
- Irc::Bot::MessageMapper::NotPublicFailure
- Irc::Bot::MessageMapper::PartialMatchFailure
- Irc::Bot::MessageParameter
- Irc::Bot::MessageTemplate
- Irc::Bot::Plugins
- Irc::Bot::Plugins::BotModule
- Irc::Bot::Plugins::CoreBotModule
- Irc::Bot::Plugins::Plugin
- Irc::Bot::Plugins::PluginManagerClass
- Irc::Bot::Plugins::RecurseTooDeep
- Irc::Bot::Plugins::RemoteBotModule
- Irc::Bot::Plugins::RemoteCoreBotModule
- Irc::Bot::Plugins::RemotePlugin
- Irc::Bot::Registry
- Irc::Bot::Registry::Accessor
- Irc::Bot::RemoteDispatcher
- Irc::Bot::RemoteMessage
- Irc::Bot::RemoteObject
- Irc::Bot::Wordlist
- Irc::BotConfig
- Irc::Casemap
- Irc::Channel
- Irc::Channel::Mode
- Irc::Channel::ModeHash
- Irc::Channel::ModeTypeA
- Irc::Channel::ModeTypeB
- Irc::Channel::ModeTypeC
- Irc::Channel::ModeTypeD
- Irc::Channel::Topic
- Irc::Channel::UserMode
- Irc::ChannelList
- Irc::Client
- Irc::DBHash
- Irc::DBTree
- Irc::InviteMessage
- Irc::JoinMessage
- Irc::KickMessage
- Irc::MessageQueue
- Irc::ModeChangeMessage
- Irc::MotdMessage
- Irc::NamesMessage
- Irc::Netmask
- Irc::NetmaskDb
- Irc::NetmaskDb::Tree
- Irc::NetmaskList
- Irc::NickMessage
- Irc::NoSuchTargetMessage
- Irc::NoticeMessage
- Irc::PartMessage
- Irc::PrivMessage
- Irc::QueueRing
- Irc::QuitMessage
- Irc::RfcCasemap
- Irc::Server
- Irc::ServerOrCasemap
- Irc::Socket
- Irc::Socket::IdentityFilter
- Irc::StrictRfcCasemap
- Irc::TopicMessage
- Irc::UnknownMessage
- Irc::User
- Irc::UserList
- Irc::UserMessage
- Irc::Utils
- Irc::Utils::HttpUtil
- Irc::Utils::HttpUtil::CachedObject
- Irc::Utils::ParseTime
- Irc::WelcomeMessage
- Irc::WhoisMessage
- BDB
- BDB::CIBtree
- MonitorMixin
- MonitorMixin::ConditionVariable
- Net
- Net::HTTPResponse
- Regexp
- Regexp::Irc
- Singleton
- Singleton::SingletonClassMethods
- Timer
- Timer::Action
- TokyoCabinet
- TokyoCabinet::CIBDB
- UnicodePlugin
- UnicodePlugin::UnicodeFilter
- Array
- ArrayOf
- AuthModule
- BasicsModule
- ConditionVariable
- ConfigModule
- DottedIndex
- Enumerable
- Exception
- FiltersModule
- GetText
- GetTextVersionError
- HttpUtilPlugin
- IrcLogModule
- Module
- Numeric
- Object
- Range
- RemoteModule
- ServerError
- String
- Symbol
- UserDataModule
- WordlistModule
- YAML

No matching classes.

# RemoteModule

### Public Class Methods

new() click to toggle source

    # File lib/rbot/core/remote.rb, line 328
    def initialize
      super
      @port = @bot.config['remote.port']
      @host = @bot.config['remote.host']
      @drb = nil
      begin
        start_service if @bot.config['remote.autostart']
      rescue => e
        error "couldn't start remote service provider: #{e.inspect}"
      end
    end

### Public Instance Methods

cleanup() click to toggle source

    # File lib/rbot/core/remote.rb, line 350
    def cleanup
      stop_service
      super
    end

handle_start(m, params) click to toggle source

    # File lib/rbot/core/remote.rb, line 355
    def handle_start(m, params)
      if @drb
        rep = "remote service provider already running"
        rep << " on port #{@port}" if m.private?
      else
        begin
          start_service(@port)
          rep = "remote service provider started"
          rep << " on port #{@port}" if m.private?
        rescue
          rep = "couldn't start remote service provider"
        end
      end
      m.reply rep
    end

remote_login(m, params) click to toggle source

    # File lib/rbot/core/remote.rb, line 375
    def remote_login(m, params)
      id = @bot.auth.remote_login(params[:botuser], params[:password])
      raise "login failed" unless id
      return id
    end

remote_test(m, params) click to toggle source

    # File lib/rbot/core/remote.rb, line 371
    def remote_test(m, params)
      @bot.say params[:channel], "This is a remote test"
    end

start_service() click to toggle source

    # File lib/rbot/core/remote.rb, line 340
    def start_service
      raise "Remote service provider already running" if @drb
      @drb = DRb.start_service("druby://#{@host}:#{@port}", @bot.remote_object)
    end

stop_service() click to toggle source

    # File lib/rbot/core/remote.rb, line 345
    def stop_service
      @drb.stop_service if @drb
      @drb = nil
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.