C# Класс Squishy.Irc.IrcClient

Representing a fully working Irc connection class. Extend and override the sufficient OnEvent methods in order to customize it. The Dcc class offers sufficient events and commands for dealing with all Dcc matters.
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
Info string
Network IrcNetworkInfo
Privileges Privilege[]
ServerPassword string
WhiteSpace System.Text.RegularExpressions.Regex

Защищенные свойства (Protected)

Свойство Тип Описание
m_CommandHandler Squishy.Irc.Commands.IrcCommandHandler
m_MaxNickLen int
protHandler Squishy.Irc.Protocol.IrcProtocolHandler

Открытые методы

Метод Описание
BeginConnect ( string addr ) : void
BeginConnect ( string addr, int port ) : void

Saves the sufficient information and lets the Client instance start to connect to a Server. It will not connect if it is already connected or currently connecting. (Use Disconnect first in that case) When the Client connected successfully it dumps its ThrottledSendQueue.

GetChannel ( string name ) : IrcChannel
GetOrCreateChannel ( string name ) : IrcChannel

Gets the channel with the current name or creates a new Channel object, if it doesn't exist yet

GetOrCreateUser ( string mask ) : IrcUser
GetPrivForFlag ( char flag ) : Privilege
GetSymbolForFlag ( char flag ) : char

Returns the symbol for the specified flag ("@" would usually be the symbol for "o" e.g.).

GetUser ( string nick ) : IrcUser
GetUsers ( string mask ) : Squishy.Irc.IrcUser[]

Loops through all Users to find those who match the given mask.

HasChanMode ( string modes ) : bool

Indicates wether or not the current Irc Network offers the specified Channel modes - Independent on the sequence.

IrcClient ( ) : System
IrcClient ( Encoding encoding ) : System
IsOn ( string channame ) : bool

Indicates wether or not this IrcClient is on the Channel with the specified name.

MayTriggerCommand ( CmdTrigger cmdTrigger ) : bool

Return wether or not a command may be triggered. Is called everytime, a command is triggered.

MayTriggerCommand ( CmdTrigger trigger, Command cmd ) : bool

Return wether or not a command may be triggered. Is called everytime, a command is triggered.

Send ( string text ) : void

Uses the Client.Send(string) to enqueue the corresponding text into the ThrottledSendQueue.

SendNow ( string text ) : void

Uses the Client.SendNow(text) to send a line of text immediately to the server.

SupportsSymbols ( string symbols ) : bool

Indicates wether or not the current Irc 4rk supports the specified Channel symbols (such as @,+ etc) - Independent on the sequence.

TriggersCommand ( IrcUser user, IrcChannel chan, Squishy.Network.StringStream input ) : bool

Защищенные методы

Метод Описание
OnBanListComplete ( IrcChannel chan ) : void

Fires when the BanList for a Channel has been sent completely.

OnBanListEntry ( IrcChannel chan, BanEntry entry ) : void

Fires when an already established BanEntry has been sent (raw 367).

OnBeforeSend ( string text ) : void

Fires when something is sent by the Client. (When Client.SendNow(string) is called.)

OnCannotJoin ( IrcChannel chan, string reason ) : void
OnChanCreationTime ( IrcChannel chan, System.DateTime creationTime ) : void

Fires when the CreationTime of a Channel has been sent (raw 329)

OnChannelMsg ( IrcUser user, IrcChannel chan, Squishy.Network.StringStream text ) : void

Fires when the Client receives a PRIVMSG which was directed to a Channel.

OnCommandFail ( CmdTrigger trigger, Exception ex ) : void

Fires when a Command raises an Exception while being executed.

OnConnectFail ( Exception ex ) : void

Fires when the Client raises the specified Exception during the Connect process.

OnConnected ( ) : void

Fires when the Client instance of this IrcClient established a connection with a server.

OnConnecting ( ) : void

Is called when the Client instance connects to a new server.

OnConnectionInfo ( IrcPacket packet, string>.Dictionary pairs ) : void

Fires when network-specific Informations are sent (raw 005).

OnCtcpReply ( IrcUser user, IrcChannel chan, string reply, string args ) : void

Fires when the Client receives any kind of CTCP reply.

OnCtcpRequest ( IrcUser user, IrcChannel chan, string request, string args ) : void

Fires when the Client receives any kind of CTCP request. Automatically replies to the VERSION request with the content of the Version variable if not overridden.

OnDisconnected ( bool conLost ) : void

Fires when the Client disconnected.

OnError ( IrcPacket packet ) : void

Fires when an Error reply has been sent by the network (raw is greater than 399).

OnExceptionRaised ( Exception e ) : void

Fires when an exception is raised during the protocol handling.

OnFlagAdded ( IrcUser user, IrcChannel chan, Privilege priv, IrcUser target ) : void

Fires when a User adds a Channel flag to another User.

OnFlagDeleted ( IrcUser user, IrcChannel chan, Privilege priv, IrcUser target ) : void

Fires when a User deletes a Channel flag from another User.

OnInvalidNick ( string err, string nick, string args ) : void

Fires when a chosen nick is already in use.

OnInvite ( IrcUser user, string chan ) : void

Fires when the specified User sends an invitation for the specified Channel.

OnJoin ( IrcUser user, IrcChannel chan ) : void

Fires when the specified User joins the specified Channel.

OnKick ( IrcUser from, IrcChannel chan, IrcUser target, string reason ) : void

Fires when a User is kicked from a Channel.

OnModeAdded ( IrcUser user, IrcChannel chan, string mode, string param ) : void

Fires when a User adds a Channel mode.

OnModeDeleted ( IrcUser user, IrcChannel chan, string mode, string param ) : void

Fures when a User deletes a Channel mode.

OnNick ( IrcUser user, string oldNick, string newNick ) : void

Fires when a User has changed the nick.

OnNotice ( IrcUser user, IrcChannel chan, Squishy.Network.StringStream text ) : void

Fires when the Client receives any kind of NOTICE.

OnPart ( IrcUser user, IrcChannel chan, string reason ) : void

Fires when a User parts from a Channel.

OnQueryMsg ( IrcUser user, Squishy.Network.StringStream text ) : void

Fires when the Client receives a PRIVMSG, directed to this Client itself.

OnQuit ( IrcUser user, string reason ) : void

Fires when a User quits.

OnText ( IrcUser user, IrcChannel chan, Squishy.Network.StringStream text ) : void

Fires when the Client receives any kind of PRIVMSG or NOTICE.

OnTopic ( IrcUser user, IrcChannel chan, string text, bool initial ) : void

Fires when the Topic for a Channel has been sent. Either when joining a Channel or when modified by a User.

OnUnknownCommandUsed ( CmdTrigger trigger ) : void

Fires when the aliasing engine cannot find a command. Sends the command to the Server when not overridden.

OnUnspecifiedInfo ( IrcPacket packet ) : void

Fires when an information is sent that is not captured by the intern protocol handler.

OnUserDisappeared ( IrcUser user ) : void

Called whenever a User quits or parts all common Channels

OnUserEncountered ( IrcUser user ) : void
OnUserLeftChannel ( IrcChannel chan, IrcUser user, string reason ) : void

Fires when a user is kicked from or parts from a channel or quits.

OnUserModeChanged ( ) : void

Fires when own Usermodes have been changed.

OnUsersAdded ( IrcChannel chan, IrcUser users ) : void

Fires when the Client receives the Names list for the specified Channel.

OnWhoReply ( string channame, string username, string host, string server, string nick, string flags, string hops, string info ) : void

Fires when the Client receives a Who-reply (raw 352).

Perform ( ) : void

Fires when the Client is fully logged on the network and the End of Motd is sent (raw 376).

Приватные методы

Метод Описание
AuthNotify ( IrcUser user ) : void
BanListCompleteNotify ( IrcChannel chan ) : void
BanListEntryNotify ( IrcChannel chan, BanEntry entry ) : void
BeforeSendNotify ( string text ) : void
CannotJoinNotify ( IrcChannel channel, string reason ) : void
ChanCreationTimeNotify ( IrcChannel chan, System.DateTime creationTime ) : void
ChannelMsgNotify ( IrcUser user, IrcChannel chan, Squishy.Network.StringStream text ) : void
CheckUserKnown ( IrcUser user ) : void
CommandFailNotify ( CmdTrigger trigger, Exception ex ) : void
ConnectFailNotify ( Exception ex ) : void
ConnectNotify ( ) : void
ConnectingNotify ( ) : void
ConnectionInfoNotify ( IrcPacket packet ) : void
CtcpReplyNotify ( IrcUser user, IrcChannel chan, string reply, string args ) : void
CtcpRequestNotify ( IrcUser user, IrcChannel chan, string request, string text ) : void
DisconnectNotify ( bool conLost ) : void
ErrorNotify ( IrcPacket packet ) : void
ExceptionNotify ( Exception e ) : void
FlagAddedNotify ( IrcUser user, IrcChannel chan, Privilege priv, IrcUser target ) : void
FlagDeletedNotify ( IrcUser user, IrcChannel chan, Privilege priv, IrcUser target ) : void
InvalidNickNotify ( string err, string nick, string args ) : void
InviteNotify ( IrcUser user, string chan ) : void
JoinNotify ( IrcUser user, string name ) : void
KickNotify ( IrcUser user, IrcChannel chan, IrcUser target, string reason ) : void
ModeAddedNotify ( IrcUser user, IrcChannel chan, string mode, string param ) : void
ModeDeletedNotify ( IrcUser user, IrcChannel chan, string mode, string param ) : void
NickNotify ( IrcUser user, string newNick ) : void
NoticeNotify ( IrcUser user, IrcChannel chan, Squishy.Network.StringStream text ) : void
OnUserParsed ( IrcUser user ) : void
PartNotify ( IrcUser user, IrcChannel chan, string reason ) : void
PerformNotify ( ) : void
QueryMsgNotify ( IrcUser user, Squishy.Network.StringStream text ) : void
QuitNotify ( IrcUser user, string reason ) : void
Reset ( ) : void
TextNotify ( IrcUser user, IrcChannel chan, Squishy.Network.StringStream text ) : void
TopicNotify ( IrcUser user, IrcChannel chan, string text, bool initial ) : void
UnkownCommandUsedNotify ( CmdTrigger trigger ) : void
UnspecifiedInfoNotify ( IrcPacket packet ) : void
UserLeftChannelNotify ( IrcChannel chan, IrcUser user, string reason ) : void
UserModeChangedNotify ( ) : void
UsersAddedNotify ( IrcChannel chan, IrcUser users ) : void
WhoReplyNotify ( string channame, string username, string host, string server, string nick, string flags, string hops, string info ) : void

Описание методов

BeginConnect() публичный Метод

public BeginConnect ( string addr ) : void
addr string
Результат void

BeginConnect() публичный Метод

Saves the sufficient information and lets the Client instance start to connect to a Server. It will not connect if it is already connected or currently connecting. (Use Disconnect first in that case) When the Client connected successfully it dumps its ThrottledSendQueue.
public BeginConnect ( string addr, int port ) : void
addr string The address where the Client should connect to
port int The port on the Server where the Client should connect to
Результат void

GetChannel() публичный Метод

public GetChannel ( string name ) : IrcChannel
name string The case-insensitive Channel name.
Результат IrcChannel

GetOrCreateChannel() публичный Метод

Gets the channel with the current name or creates a new Channel object, if it doesn't exist yet
public GetOrCreateChannel ( string name ) : IrcChannel
name string The case-insensitive Channel name.
Результат IrcChannel

GetOrCreateUser() публичный Метод

public GetOrCreateUser ( string mask ) : IrcUser
mask string
Результат IrcUser

GetPrivForFlag() публичный Метод

public GetPrivForFlag ( char flag ) : Privilege
flag char
Результат Privilege

GetSymbolForFlag() публичный Метод

Returns the symbol for the specified flag ("@" would usually be the symbol for "o" e.g.).
public GetSymbolForFlag ( char flag ) : char
flag char
Результат char

GetUser() публичный Метод

public GetUser ( string nick ) : IrcUser
nick string The case-insensitive User'str nick.
Результат IrcUser

GetUsers() публичный Метод

Loops through all Users to find those who match the given mask.
public GetUsers ( string mask ) : Squishy.Irc.IrcUser[]
mask string The mask of the users that are to be found.
Результат Squishy.Irc.IrcUser[]

HasChanMode() публичный Метод

Indicates wether or not the current Irc Network offers the specified Channel modes - Independent on the sequence.
public HasChanMode ( string modes ) : bool
modes string A sequence of chars, representing Channel modes
Результат bool

IrcClient() публичный Метод

public IrcClient ( ) : System
Результат System

IrcClient() публичный Метод

public IrcClient ( Encoding encoding ) : System
encoding System.Text.Encoding
Результат System

IsOn() публичный Метод

Indicates wether or not this IrcClient is on the Channel with the specified name.
public IsOn ( string channame ) : bool
channame string
Результат bool

MayTriggerCommand() публичный Метод

Return wether or not a command may be triggered. Is called everytime, a command is triggered.
public MayTriggerCommand ( CmdTrigger cmdTrigger ) : bool
cmdTrigger Squishy.Irc.Commands.CmdTrigger
Результат bool

MayTriggerCommand() публичный Метод

Return wether or not a command may be triggered. Is called everytime, a command is triggered.
public MayTriggerCommand ( CmdTrigger trigger, Command cmd ) : bool
trigger Squishy.Irc.Commands.CmdTrigger
cmd Squishy.Irc.Commands.Command A command.
Результат bool

OnBanListComplete() защищенный Метод

Fires when the BanList for a Channel has been sent completely.
protected OnBanListComplete ( IrcChannel chan ) : void
chan IrcChannel
Результат void

OnBanListEntry() защищенный Метод

Fires when an already established BanEntry has been sent (raw 367).
protected OnBanListEntry ( IrcChannel chan, BanEntry entry ) : void
chan IrcChannel
entry BanEntry
Результат void

OnBeforeSend() защищенный Метод

Fires when something is sent by the Client. (When Client.SendNow(string) is called.)
protected OnBeforeSend ( string text ) : void
text string The line of text which is supposed to be sent.
Результат void

OnCannotJoin() защищенный Метод

protected OnCannotJoin ( IrcChannel chan, string reason ) : void
chan IrcChannel
reason string
Результат void

OnChanCreationTime() защищенный Метод

Fires when the CreationTime of a Channel has been sent (raw 329)
protected OnChanCreationTime ( IrcChannel chan, System.DateTime creationTime ) : void
chan IrcChannel
creationTime System.DateTime
Результат void

OnChannelMsg() защищенный Метод

Fires when the Client receives a PRIVMSG which was directed to a Channel.
protected OnChannelMsg ( IrcUser user, IrcChannel chan, Squishy.Network.StringStream text ) : void
user IrcUser
chan IrcChannel
text Squishy.Network.StringStream
Результат void

OnCommandFail() защищенный Метод

Fires when a Command raises an Exception while being executed.
protected OnCommandFail ( CmdTrigger trigger, Exception ex ) : void
trigger Squishy.Irc.Commands.CmdTrigger
ex System.Exception
Результат void

OnConnectFail() защищенный Метод

Fires when the Client raises the specified Exception during the Connect process.
protected OnConnectFail ( Exception ex ) : void
ex System.Exception
Результат void

OnConnected() защищенный Метод

Fires when the Client instance of this IrcClient established a connection with a server.
protected OnConnected ( ) : void
Результат void

OnConnecting() защищенный Метод

Is called when the Client instance connects to a new server.
protected OnConnecting ( ) : void
Результат void

OnConnectionInfo() защищенный Метод

Fires when network-specific Informations are sent (raw 005).
protected OnConnectionInfo ( IrcPacket packet, string>.Dictionary pairs ) : void
packet Squishy.Irc.Protocol.IrcPacket
pairs string>.Dictionary A Dictionary, containing all information, indexed case-insensitively. Value is "" if the information isnt a pair.
Результат void

OnCtcpReply() защищенный Метод

Fires when the Client receives any kind of CTCP reply.
protected OnCtcpReply ( IrcUser user, IrcChannel chan, string reply, string args ) : void
user IrcUser The User who sent the text
chan IrcChannel
reply string The reply type (such as VERSION)
args string The text which was sent in addition to the reply
Результат void

OnCtcpRequest() защищенный Метод

Fires when the Client receives any kind of CTCP request. Automatically replies to the VERSION request with the content of the Version variable if not overridden.
protected OnCtcpRequest ( IrcUser user, IrcChannel chan, string request, string args ) : void
user IrcUser The User who sent the text
chan IrcChannel The Channel where it was sent (can be null)
request string The request type (such as VERSION)
args string The text which was sent in addition to the request
Результат void

OnDisconnected() защищенный Метод

Fires when the Client disconnected.
protected OnDisconnected ( bool conLost ) : void
conLost bool
Результат void

OnError() защищенный Метод

Fires when an Error reply has been sent by the network (raw is greater than 399).
protected OnError ( IrcPacket packet ) : void
packet Squishy.Irc.Protocol.IrcPacket
Результат void

OnExceptionRaised() защищенный Метод

Fires when an exception is raised during the protocol handling.
protected OnExceptionRaised ( Exception e ) : void
e System.Exception The Exception thrown during the handling.
Результат void

OnFlagAdded() защищенный Метод

Fires when a User adds a Channel flag to another User.
protected OnFlagAdded ( IrcUser user, IrcChannel chan, Privilege priv, IrcUser target ) : void
user IrcUser
chan IrcChannel
priv Privilege
target IrcUser
Результат void

OnFlagDeleted() защищенный Метод

Fires when a User deletes a Channel flag from another User.
protected OnFlagDeleted ( IrcUser user, IrcChannel chan, Privilege priv, IrcUser target ) : void
user IrcUser
chan IrcChannel
priv Privilege
target IrcUser
Результат void

OnInvalidNick() защищенный Метод

Fires when a chosen nick is already in use.
protected OnInvalidNick ( string err, string nick, string args ) : void
err string
nick string
args string
Результат void

OnInvite() защищенный Метод

Fires when the specified User sends an invitation for the specified Channel.
protected OnInvite ( IrcUser user, string chan ) : void
user IrcUser
chan string
Результат void

OnJoin() защищенный Метод

Fires when the specified User joins the specified Channel.
protected OnJoin ( IrcUser user, IrcChannel chan ) : void
user IrcUser
chan IrcChannel
Результат void

OnKick() защищенный Метод

Fires when a User is kicked from a Channel.
protected OnKick ( IrcUser from, IrcChannel chan, IrcUser target, string reason ) : void
from IrcUser
chan IrcChannel
target IrcUser
reason string
Результат void

OnModeAdded() защищенный Метод

Fires when a User adds a Channel mode.
protected OnModeAdded ( IrcUser user, IrcChannel chan, string mode, string param ) : void
user IrcUser The User who has added the mode
chan IrcChannel
mode string The mode which has been changed
param string "" if the mode does not have any parameter
Результат void

OnModeDeleted() защищенный Метод

Fures when a User deletes a Channel mode.
protected OnModeDeleted ( IrcUser user, IrcChannel chan, string mode, string param ) : void
user IrcUser The User who has added the mode
chan IrcChannel
mode string The mode which has been changed
param string "" if the mode does not have any parameter
Результат void

OnNick() защищенный Метод

Fires when a User has changed the nick.
protected OnNick ( IrcUser user, string oldNick, string newNick ) : void
user IrcUser
oldNick string
newNick string
Результат void

OnNotice() защищенный Метод

Fires when the Client receives any kind of NOTICE.
protected OnNotice ( IrcUser user, IrcChannel chan, Squishy.Network.StringStream text ) : void
user IrcUser The User who sent the text
chan IrcChannel The Channel where it was sent (is null if its a private notice)
text Squishy.Network.StringStream The text which was sent
Результат void

OnPart() защищенный Метод

Fires when a User parts from a Channel.
protected OnPart ( IrcUser user, IrcChannel chan, string reason ) : void
user IrcUser
chan IrcChannel
reason string
Результат void

OnQueryMsg() защищенный Метод

Fires when the Client receives a PRIVMSG, directed to this Client itself.
protected OnQueryMsg ( IrcUser user, Squishy.Network.StringStream text ) : void
user IrcUser
text Squishy.Network.StringStream
Результат void

OnQuit() защищенный Метод

Fires when a User quits.
protected OnQuit ( IrcUser user, string reason ) : void
user IrcUser
reason string
Результат void

OnText() защищенный Метод

Fires when the Client receives any kind of PRIVMSG or NOTICE.
protected OnText ( IrcUser user, IrcChannel chan, Squishy.Network.StringStream text ) : void
user IrcUser The User who sent the text
chan IrcChannel
text Squishy.Network.StringStream The text which was sent
Результат void

OnTopic() защищенный Метод

Fires when the Topic for a Channel has been sent. Either when joining a Channel or when modified by a User.
protected OnTopic ( IrcUser user, IrcChannel chan, string text, bool initial ) : void
user IrcUser
chan IrcChannel
text string
initial bool
Результат void

OnUnknownCommandUsed() защищенный Метод

Fires when the aliasing engine cannot find a command. Sends the command to the Server when not overridden.
protected OnUnknownCommandUsed ( CmdTrigger trigger ) : void
trigger Squishy.Irc.Commands.CmdTrigger
Результат void

OnUnspecifiedInfo() защищенный Метод

Fires when an information is sent that is not captured by the intern protocol handler.
protected OnUnspecifiedInfo ( IrcPacket packet ) : void
packet Squishy.Irc.Protocol.IrcPacket
Результат void

OnUserDisappeared() защищенный Метод

Called whenever a User quits or parts all common Channels
protected OnUserDisappeared ( IrcUser user ) : void
user IrcUser
Результат void

OnUserEncountered() защищенный Метод

protected OnUserEncountered ( IrcUser user ) : void
user IrcUser
Результат void

OnUserLeftChannel() защищенный Метод

Fires when a user is kicked from or parts from a channel or quits.
protected OnUserLeftChannel ( IrcChannel chan, IrcUser user, string reason ) : void
chan IrcChannel
user IrcUser
reason string
Результат void

OnUserModeChanged() защищенный Метод

Fires when own Usermodes have been changed.
protected OnUserModeChanged ( ) : void
Результат void

OnUsersAdded() защищенный Метод

Fires when the Client receives the Names list for the specified Channel.
protected OnUsersAdded ( IrcChannel chan, IrcUser users ) : void
chan IrcChannel
users IrcUser An Array of Users who are on the Channel
Результат void

OnWhoReply() защищенный Метод

Fires when the Client receives a Who-reply (raw 352).
protected OnWhoReply ( string channame, string username, string host, string server, string nick, string flags, string hops, string info ) : void
channame string The name of the channel which the Who-reply was for or the User did something on last
username string The username of the User
host string The hostmask of the User
server string The server which the User is connected to
nick string The nick of the User
flags string The network flags of the User
hops string The hops of the User
info string Additional Info about the User
Результат void

Perform() защищенный Метод

Fires when the Client is fully logged on the network and the End of Motd is sent (raw 376).
protected Perform ( ) : void
Результат void

Send() публичный Метод

Uses the Client.Send(string) to enqueue the corresponding text into the ThrottledSendQueue.
public Send ( string text ) : void
text string
Результат void

SendNow() публичный Метод

Uses the Client.SendNow(text) to send a line of text immediately to the server.
public SendNow ( string text ) : void
text string
Результат void

SupportsSymbols() публичный Метод

Indicates wether or not the current Irc 4rk supports the specified Channel symbols (such as @,+ etc) - Independent on the sequence.
public SupportsSymbols ( string symbols ) : bool
symbols string A sequence of symbols, representing Channel flags (such as '@')
Результат bool

TriggersCommand() публичный Метод

public TriggersCommand ( IrcUser user, IrcChannel chan, Squishy.Network.StringStream input ) : bool
user IrcUser
chan IrcChannel
input Squishy.Network.StringStream
Результат bool

Описание свойств

Info публичное свойство

public string Info
Результат string

Network публичное свойство

Contains information and tools to operate on this specific Network.
public IrcNetworkInfo,Squishy.Irc Network
Результат IrcNetworkInfo

Privileges публичное статическое свойство

public static Privilege[] Privileges
Результат Privilege[]

ServerPassword публичное свойство

public string ServerPassword
Результат string

WhiteSpace публичное статическое свойство

public static Regex,System.Text.RegularExpressions WhiteSpace
Результат System.Text.RegularExpressions.Regex

m_CommandHandler защищенное свойство

protected IrcCommandHandler,Squishy.Irc.Commands m_CommandHandler
Результат Squishy.Irc.Commands.IrcCommandHandler

m_MaxNickLen защищенное свойство

protected int m_MaxNickLen
Результат int

protHandler защищенное свойство

protected IrcProtocolHandler,Squishy.Irc.Protocol protHandler
Результат Squishy.Irc.Protocol.IrcProtocolHandler