Exemplo n.º 1
0
 /// <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 );
     }
 }
Exemplo n.º 2
0
 internal CommandBuilder(Connection connection)
 {
     this.connection = connection;
     commandBuffer = new StringBuilder(MAX_COMMAND_SIZE);
 }
Exemplo n.º 3
0
 /// <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;
 }
Exemplo n.º 4
0
        public void SetupConnection(ConnectionArgs args)
        {
            if (args.Nick == null)
                throw new ArgumentNullException("ConnectionArgs.Nick");

            Connection = new Connection(args, true, false) { HandleNickTaken = false };
        }
Exemplo n.º 5
0
 public Server(Connection connection)
 {
     Connection = connection;
     HookEvents();
 }
Exemplo n.º 6
0
 /// <summary>
 /// Create a new Sender for a specific connection.
 /// </summary>
 internal Sender(Connection connection)
     : base(connection)
 {
 }