/// <summary> /// Create an instance and register handlers for /// CTCP events. The Connection's CtcpEnable property must /// be set to true or the connection will not send CTCP events /// to this responder. /// </summary> /// <param name="connection">The containing connection.</param> public CtcpResponder( Connection connection ) { this.connection = connection; nextTime = DateTime.Now.ToFileTime(); //Wait at least 2 second in between automatic CTCP responses floodDelay = 2000; //Send back user nick by default for finger requests. userMessage = "Thresher CTCP Responder"; fingerMessage = userMessage; versionMessage = "Thresher IRC library 1.1"; sourceMessage = "http://thresher.sourceforge.net"; clientInfoMessage = "This client supports: UserInfo, Finger, Version, Source, Ping, Time and ClientInfo"; if( connection.EnableCtcp ) { connection.CtcpListener.OnCtcpRequest += new CtcpRequestEventHandler( OnCtcpRequest ); connection.CtcpListener.OnCtcpPingRequest += new CtcpPingRequestEventHandler( OnCtcpPingRequest ); } }
internal CommandBuilder(Connection connection) { this.connection = connection; commandBuffer = new StringBuilder(MAX_COMMAND_SIZE); }
/// <summary> /// Create a new listener using a specific connection. /// </summary> /// <param name="connection">The connection to the IRC server.</param> internal CtcpListener(Connection connection) { this.connection = connection; }
public void SetupConnection(ConnectionArgs args) { if (args.Nick == null) throw new ArgumentNullException("ConnectionArgs.Nick"); Connection = new Connection(args, true, false) { HandleNickTaken = false }; }
public Server(Connection connection) { Connection = connection; HookEvents(); }
/// <summary> /// Create a new Sender for a specific connection. /// </summary> internal Sender(Connection connection) : base(connection) { }