コード例 #1
0
ファイル: Autojoin.cs プロジェクト: Genesis2001/Lantea-extras
	    public void Initialize(Block config, IrcClient client)
	    {
	        client.ConnectionEstablishedEvent += OnClientConnect;
	        for (int i = 0; i < config.CountBlock("channel"); ++i)
	        {
	            Block c = config.GetBlock("channel", i);
                string channel = c.GetString("name");

	            if (string.IsNullOrEmpty(channel))
	                continue;

	            channels.Add(channel);
	        }
	    }
コード例 #2
0
ファイル: Execraws.cs プロジェクト: Genesis2001/Lantea-extras
        public void Initialize(Block config, IrcClient client)
        {
            client.ConnectionEstablishedEvent += OnClientConnect;

            for (int i = 0; i < config.CountBlock("command"); ++i)
            {
                Block cmd   = config.GetBlock("command", i);
                string exec = cmd.GetString("exec");

                if (!String.IsNullOrEmpty(exec))
                {
                    commands.Enqueue(exec);
                }
            }
        }
コード例 #3
0
        public static void Main(string[] args)
        {
            Console.Title = "Atlantis.Net.Irc.IrcClient TestApp";

            Console.WriteLine("[*] Setting IrcClient up.");
            IrcClient c = new IrcClient();
            c.Host = "irc.unifiedtech.org";
            c.Port = new PortInfo(6667, false);

            c.Nick = "irctest";

            c.IsBackgroundThread = false;
            c.WriteLog = true;

            c.ConnectionEstablishedEvent += (s, e) =>
            {
                Console.WriteLine("[*] Connected to IRC - Joining #unifiedtech");
                ((IrcClient)s).Send("JOIN #unifiedtech");
            };
            c.ChannelMessageReceivedEvent += (s, e) =>
            {
                var client = ((IrcClient)s);

                string[] toks = e.Message.Split(' ');

                if (toks[0].EqualsIgnoreCase("!test"))
                {
                    Console.WriteLine("[*] Test command initiated - Starting 100 lines of text using Queue.");

                    for (Int32 i = 0; i < 101; ++i)
                    {
                        var chan = client.GetChannel("#unifiedtech");
                        chan.Message("Test #{0} - Timestamp: {1} - User Count: {2}", i, DateTime.Now.ToShortTimeString(), chan.Users.Count);
                    }
                }
            };

            c.Start();

            Console.ReadLine();
        }
コード例 #4
0
 internal Channel(IrcClient client, string channelName) : this()
 {
     this.client = client;
     Name        = channelName;
 }
コード例 #5
0
        public void Initialize(Block config, IrcClient client)
        {
            Rehash(config);

            // TODO: Initialize
        }
コード例 #6
0
 public PrefixListComparer(IrcClient client)
 {
     _client = client;
 }
コード例 #7
0
 protected RfcCommand(IrcClient origin)
 {
     this.origin = origin;
 }
コード例 #8
0
 public PrefixList(IrcClient client)
 {
     _client  = client;
     prefixes = new char[client.Prefixes.Length];
 }