C# Class CTFBot.Program

Show file Open project: countervandalism/Cluekie

Public Properties

Property Type Description
botNick string
irc Meebey.SmartIrc4net.IrcClient
mainConfig System.Collections.SortedList
msgs System.Collections.SortedList
sourceAccount string
sourceChannel string
sourceServerName string
sourceirc SourceReader
targetBlacklistDuration string
targetWikiproject string

Public Methods

Method Description
Application_UnhandledException ( object sender, UnhandledExceptionEventArgs e ) : void

Catches all unhandled exceptions in the main thread

BotConfigMsg ( string destChannel ) : void
Exit ( ) : void
PartIRC ( string quitMessage ) : void
ReactToSourceEvent ( SourceEvent r ) : void

Reacts to the Source Event, passed from SourceReader. Remember: this runs in the SourceReader thread!

Restart ( ) : void
SendMessageF ( SendType type, string destination, string message, bool IsDroppable, bool IsPriority ) : void

Route all irc.SendMessage() calls through this to use the queue

SendMessageFMulti ( SendType type, string destination, string message, bool IsDroppable, bool IsPriority ) : void

Splitting messages by line breaks and in chucks if they're too long and forward to SendMessageF

getFormatMessage ( int msgCode ) : string

Get a message from the msgs store, and format it using the parameters specified. Messages should be those with a "1" prefix, incompatible with CVUBot.

Private Methods

Method Description
Main ( string args ) : void
calculateByteLength ( QueuedMessage qm ) : int

Calculates the rough length, in bytes, of a queued message

getMessage ( int msgCode, Hashtable &attributes ) : string

Gets a message from the msgs store

hasPrivileges ( char minimum, IrcEventArgs &e ) : bool
irc_OnChannelMessage ( object sender, IrcEventArgs e ) : void
irc_OnChannelNotice ( object sender, IrcEventArgs e ) : void

This event handler detects incoming notices

irc_OnConnected ( object sender, EventArgs e ) : void
irc_OnConnectionError ( object sender, EventArgs e ) : void
irc_OnError ( object sender, Meebey e ) : void
irc_OnPong ( object sender, PongEventArgs e ) : void
msgthread ( ) : void

Thread function that runs continuously in the background, sending messages

readMessages ( string filename ) : void

Reads messages from filename (Console.msgs) into SortedList msgs

Method Details

Application_UnhandledException() public static method

Catches all unhandled exceptions in the main thread
public static Application_UnhandledException ( object sender, UnhandledExceptionEventArgs e ) : void
sender object
e System.UnhandledExceptionEventArgs
return void

BotConfigMsg() public static method

public static BotConfigMsg ( string destChannel ) : void
destChannel string
return void

Exit() public static method

public static Exit ( ) : void
return void

PartIRC() public static method

public static PartIRC ( string quitMessage ) : void
quitMessage string
return void

ReactToSourceEvent() public static method

Reacts to the Source Event, passed from SourceReader. Remember: this runs in the SourceReader thread!
public static ReactToSourceEvent ( SourceEvent r ) : void
r SourceEvent
return void

Restart() public static method

public static Restart ( ) : void
return void

SendMessageF() public static method

Route all irc.SendMessage() calls through this to use the queue
public static SendMessageF ( SendType type, string destination, string message, bool IsDroppable, bool IsPriority ) : void
type SendType
destination string
message string
IsDroppable bool
IsPriority bool
return void

SendMessageFMulti() public static method

Splitting messages by line breaks and in chucks if they're too long and forward to SendMessageF
public static SendMessageFMulti ( SendType type, string destination, string message, bool IsDroppable, bool IsPriority ) : void
type SendType
destination string
message string
IsDroppable bool
IsPriority bool
return void

getFormatMessage() public static method

Get a message from the msgs store, and format it using the parameters specified. Messages should be those with a "1" prefix, incompatible with CVUBot.
public static getFormatMessage ( int msgCode ) : string
msgCode int The five-digit message code
return string

Property Details

botNick public static property

public static string botNick
return string

irc public static property

public static IrcClient,Meebey.SmartIrc4net irc
return Meebey.SmartIrc4net.IrcClient

mainConfig public static property

public static SortedList,System.Collections mainConfig
return System.Collections.SortedList

msgs public static property

public static SortedList,System.Collections msgs
return System.Collections.SortedList

sourceAccount public static property

public static string sourceAccount
return string

sourceChannel public static property

public static string sourceChannel
return string

sourceServerName public static property

public static string sourceServerName
return string

sourceirc public static property

public static SourceReader,CTFBot sourceirc
return SourceReader

targetBlacklistDuration public static property

public static string targetBlacklistDuration
return string

targetWikiproject public static property

public static string targetWikiproject
return string