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

_connectionID
uint _connectionID;

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

abort
Flag!"abort"* 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.

deferredActions
Appender!(DeferredAction[]) deferredActions;

This plugin's array of DeferredActions.

hasPendingReplays
bool hasPendingReplays;

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

messages
Appender!(ThreadMessage[]) messages;

Messages for the main thread to take action on.

nextScheduledTimestamp
long nextScheduledTimestamp;

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

outgoingMessages
Appender!(Message[]) outgoingMessages;

Events to send to the IRC server.

pendingReplays
Replay[][string] pendingReplays;

Queued IRCEvents to replay.

previousWhoisTimestamps
RehashingAA!(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.

priorityMessages
Appender!(ThreadMessage[]) priorityMessages;

Messages for the main thread to take action on with a higher priority.

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.

updates
Update updates;

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

users
RehashingAA!(IRCUser[string]) users;

Hashmap of IRC user details.

See Also