示例#1
0
 //Overload Constructor - safe way to get variables
 public IrcConnect(string IP, int Port, string Username, string Password, string Channel, SimpleIRC sirc)
 {
     newIP = IP;
     newPort = Port;
     newUsername = Username;
     newPassword = Password;
     newChannel = Channel;
     simpleirc = sirc;
     isConnectionEstablised = false;
     dcc = new DCCClient(simpleirc, this);
 }
示例#2
0
 //Overload Constructor - safe way to get variables
 public IrcConnect(string IP, int Port, string Username, string Password, string Channel, SimpleIRC sirc)
 {
     newIP                  = IP;
     newPort                = Port;
     newUsername            = Username;
     newPassword            = Password;
     newChannel             = Channel;
     simpleirc              = sirc;
     isConnectionEstablised = false;
     dcc = new DCCClient(simpleirc, this);
 }
示例#3
0
 //overload constructor
 public DCCClient(SimpleIRC sirc, IrcConnect ircCon)
 {
     simpleirc  = sirc;
     ircConnect = ircCon;
 }
示例#4
0
 //creates a thread for the pinger
 public Pinger(SimpleIRC sirc, IrcConnect ircCon)
 {
     simpleirc = sirc;
     ircConnect = ircCon;
     pingSender = new Thread(new ThreadStart(this.Run));
 }
示例#5
0
 //creates a thread for the pinger
 public Pinger(SimpleIRC sirc, IrcConnect ircCon)
 {
     simpleirc  = sirc;
     ircConnect = ircCon;
     pingSender = new Thread(new ThreadStart(this.Run));
 }
示例#6
0
        /// <Main>
        /// <summary>
        ///  Prompts user with the options for saving a log file and printing log messages to the console window
        ///  After that, it sets the default download directory
        ///  Following it checks the current operating system, and performs actions related to the operating system, see '<RunningPlatform>'
        ///  After that, it tries to locate all already downloaded files
        ///  Then initiates the IRC client for later usage
        ///  And after all that, starts the http servers (see class for more information)
        /// </summary
        /// </Main>
        static void Main(string[] args)
        {
            Console.WriteLine("Do you want to save debug messages to a log file? (Yes/No) (Left Empty means No): ");
            string shouldSaveDebug = Console.ReadLine();

            if (shouldSaveDebug.ToLower().Contains("yes"))
            {
                saveDebug = true;
            } else{
                saveDebug = false;
            }

            Console.WriteLine("Do you want to show debug messages in console? (Yes/No) (Left Empty means No): ");

            string shouldShowDebug = Console.ReadLine();

            if (shouldShowDebug.ToLower().Contains("yes"))
            {
                showDebug = true;
            }
            else
            {
                showDebug = false;
            }

            Console.WriteLine("URL To use in your webbrowser: " + GetLocalIPAddress() + ":" + port.ToString());

            SetupDownloadDir(Directory.GetCurrentDirectory() + @"/Downloads/");

            RunningPlatform();

            GetCurrentFiles();

            irc = new SimpleIRC();

            webserver = new HttpServer(HttpMessageReceived, port);
            webserver.SetWebHomeDir(Directory.GetCurrentDirectory() + @"/Views");
            webserver.SetFileDir(Directory.GetCurrentDirectory() + "/Downloads");
            webserver.SetDefaultPage("index.html");
            streamserver = new HttpServer(HttpMessageReceived, port+1);
            streamserver.SetWebHomeDir(Directory.GetCurrentDirectory() + @"/Downloads");
            streamserver.SetFileDir(Directory.GetCurrentDirectory() + "/Downloads");
            streamserver.SetDefaultPage("index.html");

            while (true)
            {
                string toSend = Console.ReadLine();
                if(toSend != "")
                {
                    if(toSend == "curanime"){
                        ParseAnimeSeason("http://myanimelist.net/anime/season", "current");
                        Console.WriteLine("starting to parse anime!");
                    } else {
                        webserver.SendMessage(toSend);
                    }

                }
            }
        }
示例#7
0
        static void Main(string[] args)
        {
            //setup vars
            string ip;
            int port;
            string username;
            string password;
            string channel;

            //setup screen:
            Console.WriteLine("Server IP(default is : 54.229.0.87(irc.rizon.net)) = ");
            if ((ip = Console.ReadLine()) == "")
            {
                ip = "54.229.0.87";
            }

            Console.WriteLine("Server Port(default is : 6667) = ");
            if (Console.ReadLine() != "")
            {
                port = Convert.ToInt32(Console.ReadLine());
            }
            else
            {
                port = 6667;
            }

            Console.WriteLine("Username(default is : RareIRC_Client) = ");
            if ((username = Console.ReadLine()) == "")
            {
                username = "******";
            }

            Console.WriteLine("Password(not working yet, default is : ) = ");
            if ((password = Console.ReadLine()) == "")
            {
                password = "";
            }

            Console.WriteLine("Channel(default is : #RareIRC) = ");
            if ((channel = Console.ReadLine()) == "")
            {
                channel = "#RareIRC";
            }

            irc = new SimpleIRC();
            irc.setupIrc(ip, port, username, password, channel, chatOutputCallback);
            irc.setDebugCallback(debugOutputCallback);
            irc.startClient();
            irc.setDownloadStatusChangeCallback(downloadStatusChanged);

            while (true)
            {

                string Input = Console.ReadLine();
                if (Input != null || Input != "" || Input != String.Empty)
                {
                    irc.sendMessage(Input);
                }
                if (!irc.isClientRunning())
                {

                    Console.WriteLine("CLIENT NOT RUNNING :S");
                    break;
                }

            }
        }
示例#8
0
文件: Home.cs 项目: RareAMV/WeebIRC
        private void Start_Click(object sender, EventArgs e)
        {
            SetupDownloadDir(Directory.GetCurrentDirectory() + @"/Downloads/");

            RunningPlatform();

            GetCurrentFiles();

            irc = new SimpleIRC();

            webserver = new HttpServer(HttpMessageReceived, port);
            webserver.SetWebHomeDir(Directory.GetCurrentDirectory() + @"/");
            webserver.SetFileDir(Directory.GetCurrentDirectory() + "/Downloads");
            webserver.SetDefaultPage("index.html");
            streamserver = new HttpServer(HttpMessageReceived, port + 1);
            streamserver.SetWebHomeDir(Directory.GetCurrentDirectory() + @"/Downloads");
            streamserver.SetFileDir(Directory.GetCurrentDirectory() + "/Downloads");
            streamserver.SetDefaultPage("index.html");

            State.Text = "Running (" + GetLocalIPAddress() + ":" + port.ToString() + ")";
        }
示例#9
0
 //overload constructor
 public DCCClient(SimpleIRC sirc, IrcConnect ircCon)
 {
     simpleirc = sirc;
     ircConnect = ircCon;
 }