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; } }
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; } }
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()); } }
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()); } }
private void Ping(object sender, ElapsedEventArgs e) { _lastPing = DateTime.Now; _context.Write("PING {0}", _server); }