Example #1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="nick"></param>
        /// <param name="server"></param>
        /// <param name="chan"></param>
        /// <param name="game"></param>
        /// <param name="mainWin"></param>
        /// <param name="identify"></param>
        /// <param name="pass">used to indetify with NickServ</param>
        /// <param name="bot">Name of NickServ bot</param>
        public WChatClient(String nick, String server, String chan, int game, MainWindow mainWin, bool identify, string pass, string bot)
        {
            mw                 = mainWin;
            this.nick          = nick;
            this.server        = server;
            this.chan          = chan;
            clientId           = game;
            identifyToNickServ = identify;
            userpass           = pass;
            nickservbot        = bot;
            ini                = new IniFile(System.IO.Path.Combine(Environment.CurrentDirectory, @"config.ini"));
            rnd                = new Random();

            users = new List <User>();
            try
            {
                firstRun = (Boolean.Parse(ini.IniReadValue("Settings", "firstrun")));
            }
            catch (FormatException e)
            {
                firstRun = false;
            }
            try
            {
                secondRun = (Boolean.Parse(ini.IniReadValue("Settings", "2ndrun")));
            }
            catch (FormatException e)
            {
                secondRun = false;
            }
            try
            {
                elnotif = (Boolean.Parse(ini.IniReadValue("Settings", "enterleave")));
            }
            catch (FormatException e)
            {
                elnotif = false;
            }
            cw = new WChatWindow(nick, chan, mw, this);
            sw = new WSettingsWindow(cw, this);
            sm = new SpawnMaster(nick, server, chan, cw.getBanner());
            DoConnect();
            if (firstRun)
            {
                cw.AddToChatWindow(8, null, sm.clientMsg[0]);
                ini.IniWriteValue("Settings", "2ndrun", true.ToString());
                ini.IniWriteValue("Settings", "firstrun", false.ToString());
            }
            if (secondRun)
            {
                cw.AddToChatWindow(8, null, sm.clientMsg[1]);
                ini.IniWriteValue("Settings", "2ndrun", false.ToString());
            }
        }
Example #2
0
 public void openSettings()
 {
     try
     {
         sw.loadSettings();
         sw.Show();
     }
     catch (InvalidOperationException e)
     {
         sw = new WSettingsWindow(cw, this);
         openSettings();
     }
 }