Skip to content
Mattia Basaglia edited this page Apr 29, 2014 · 2 revisions

This page describes the most important classes and how they interact.

IRC

MelanoBot

This class handles the connection to the IRC network. Converts messages sent via the IRC protocol and creates corresponding MelanoBotCommand instances. Sends IRC messages and commands.

MelanoBotCommand

Contains information retrieved from IRC. The most important data members are cmd and params. If the bot has been addressed directly cmd will be the first word after the bot nick, and it's intended to be interpreted as a user explicitly issuing a command to the bot. Params contain the rest of the message as an array, each word as a separate element. If the bot hasn't been addressed directly, cmd is null.

CommandExecutor and related classes

A simple unit that takes a single MelanoBotCommand and does something with it. Every functionality visible by the end user is implemented as a CommandExecutor.

BotCommandDispatcher

Contains a collection of CommandExecutor. It represents a set of features connected to a set of channels. Different executors allow the bot to have different behaviors on different channels. Dispatcher attached to common channels can be disambiguated with by assigning them a different prefix.

BotDriver

Uses a MelanoBot instance to get MelanoBotCommand. Performs the main loop of the bot script and assign each MelanoBotCommand to the correct BotCommandDispatcher.

BotData

Shared data owned by the BotDriver. Can by dispatchers and executors.

RCON

Rcon

Low level class which sends and receive message from a rcon server.

Rcon_Communicator

Connects IRC to Rcon. It's a dispatcher, as such it can receive commands from IRC and forward them to Rcon. It's also an external communicator, meaning that it can retrieve information from rcon and make it available to the IRC classes.

Clone this wiki locally