예제 #1
0
        public static IRCSettings New(string path)
        {
            var settings = new IRCSettings();

            Console.WriteLine("Hostname?");
            settings.Hostname = Console.ReadLine();
            Console.WriteLine("Port?");
            var port_str = Console.ReadLine();
            int port     = 6667;

            int.TryParse(port_str, out port);
            settings.Port = port;
            Console.WriteLine("Nickname?");
            settings.Nickname = Console.ReadLine();
            Console.WriteLine("Nickserv password?");
            settings.NickservPassword = Console.ReadLine();
            Console.WriteLine("Username?");
            settings.Username = Console.ReadLine();
            Console.WriteLine("Realname?");
            settings.Realname = Console.ReadLine();
            Console.WriteLine("Channels? (comma separated)");
            var chans = Console.ReadLine();

            settings.AutoJoinChannels.AddRange(chans.Split(','));
            settings.Save(path);
            return(settings);
        }
예제 #2
0
파일: IRCClient.cs 프로젝트: tabaha/meguca
        public IRCClient()
        {
            ReadLine  += Ping;
            ReadLine  += Identify;
            ReadLine  += DisplayLine;
            WriteLine += DisplayLine;

            Settings        = new IRCSettings();
            DecideCommand   = new Decide();
            UrlTitleCommand = new UrlTitle();

            ReadLine += DecideCommand.Process;
            ReadLine += UrlTitleCommand.Process;
        }