IRCPluginState

An aggregate of all variables that make up the common state of plugins.

This neatly tidies up the amount of top-level variables in each plugin module. This allows for making more or less all functions top-level functions, since any state could be passed to it with variables of this type.

Plugin-specific state should be kept inside the IRCPlugin subclass itself.

Constructors

this
this(uint connectionID)

Constructor taking a connection ID uint.

Members

Enums

Update
enum Update

Bitfield enum of what member of an instance of IRCPluginState was updated (if any).

Functions

connectionID
auto connectionID()

Numeric ID of the current connection, to disambiguate between multiple connections in one program run. Accessor.

updateSchedule
void updateSchedule()

Updates the saved UNIX timestamp of when the next scheduled Fiber or delegate should be triggered.

Variables

abort
bool* abort;

Pointer to the global abort flag.

awaitingDelegates
void delegate(IRCEvent)[][] awaitingDelegates;

The list of awaiting void delegate(IRCEvent) delegates, keyed by IRCEvent.Type.

awaitingFibers
Fiber[][] awaitingFibers;

The list of awaiting Fibers, keyed by IRCEvent.Type.

bot
IRCBot bot;

The current IRCBot, containing information pertaining to the bot in the context of an IRC bot.

channels
IRCChannel[string] channels;

Hashmap of IRC channels.

client
IRCClient client;

The current IRCClient, containing information pertaining to the bot in the context of a client connected to an IRC server.

connSettings
ConnectionSettings connSettings;

The current program-wide ConnectionSettings.

hasPendingReplays
bool hasPendingReplays;

Whether or not pendingReplays has elements (i.e. is not empty).

mainThread
Tid mainThread;

Thread ID to the main thread.

nextScheduledTimestamp
long nextScheduledTimestamp;

The UNIX timestamp of when the next scheduled ScheduledFiber or delegate should be triggered.

pendingReplays
Replay[][string] pendingReplays;

Queued IRCEvents to replay.

previousWhoisTimestamps
long[string] previousWhoisTimestamps;

A copy of the main thread's previousWhoisTimestamps associative arrays of UNIX timestamps of when someone had a WHOIS query aimed at them, keyed by nickname.

readyReplays
Replay[] readyReplays;

Replays primed and ready to be replayed.

scheduledDelegates
ScheduledDelegate[] scheduledDelegates;

The list of scheduled delegate, UNIX time tuples.

scheduledFibers
ScheduledFiber[] scheduledFibers;

The list of scheduled Fiber, UNIX time tuples.

server
IRCServer server;

The current IRCServer, containing information pertaining to the bot in the context of an IRC server.

settings
CoreSettings settings;

The current program-wide CoreSettings.

specialRequests
SpecialRequest[] specialRequests;

This plugin's array of SpecialRequests.

updates
Update updates;

Bitfield of in what way the plugin state was altered during postprocessing or event handler execution.

users
IRCUser[string] users;

Hashmap of IRC user details.

See Also

Meta