Exemplo n.º 1
0
        private void HandleCtcpCommand(IrcContext context)
        {
            var msg = context.Parameters.Last().Trim(DELIM);
            var cmd = msg.Split(' ')[0];

            switch (cmd.ToUpper())
            {
            case "VERSION":
                context.Write("{1} {2}: {0}VERSION {3}:{4}:{5}{0}", DELIM, context.Command, context.Nickname, "Nothing Special", "0.1b", "Windows 3.11");
                break;
            }
        }
Exemplo n.º 2
0
        private void HandleCtcpCommand(IrcContext context)
        {
            var msg = context.Parameters.Last().Trim(DELIM);
            var cmd = msg.Split(' ')[0];

            switch(cmd.ToUpper())
            {
                case "VERSION":
                    context.Write("{1} {2}: {0}VERSION {3}:{4}:{5}{0}", DELIM, context.Command, context.Nickname, "Nothing Special", "0.1b", "Windows 3.11");
                    break;
            }
        }
Exemplo n.º 3
0
        public void IncomingMessage(IrcContext context)
        {
            if(context.Command.Equals("PONG", StringComparison.InvariantCultureIgnoreCase))
            {
                Latency = DateTime.Now.Subtract(_lastPing);
            }

            if(context.Command == "001")
            {
                _server = context.Prefix;
                _context = context;
                _timer.Start();
            }

            if(context.Command == "PING")
            {
                // the server pings the client?!  It happens!
                context.Write("PONG {0}", context.Parameters.Last());
            }
        }
Exemplo n.º 4
0
        public void IncomingMessage(IrcContext context)
        {
            if (context.Command.Equals("PONG", StringComparison.InvariantCultureIgnoreCase))
            {
                Latency = DateTime.Now.Subtract(_lastPing);
            }

            if (context.Command == "001")
            {
                _server  = context.Prefix;
                _context = context;
                _timer.Start();
            }

            if (context.Command == "PING")
            {
                // the server pings the client?!  It happens!
                context.Write("PONG {0}", context.Parameters.Last());
            }
        }
Exemplo n.º 5
0
 private void Ping(object sender, ElapsedEventArgs e)
 {
     _lastPing = DateTime.Now;
     _context.Write("PING {0}", _server);
 }