private void btnSend_Click(object sender, EventArgs e)
        {
            if (textBox1.Text != "" && textBox2.Text != "" && textBox3.Text != "" && textBox4.Text != "" && classVars.b_upl_filesize_ok)
            {
                try
                {
                    int    rng;
                    Random rnd = new Random();
                    rng = rnd.Next(0, 9999);
                    var    ini      = new ini(classVars.s_settingspath);
                    string username = ini.Read("user");
                    string path     = "C:\\users\\public\\"
                                      + username + "_" + rng + "_bugreport.txt";
                    File.WriteAllText(path, "\n" + DateTime.Now.ToString() + " Account Name: " + textBox1.Text + " Ort: " + textBox2.Text +
                                      " Was genau : " + textBox3.Text + " Sonstiges : " + textBox4.Text + "\n");
                    WebClient uploader = new WebClient();
                    uploader.Headers.Add("Content-Type", "binary/octet-stream");
                    byte[] result = uploader.UploadFile(classVars.url_upl_bugreport, "POST", path);

                    if (attatchedfilepath != "")
                    {
                        long length   = new System.IO.FileInfo(attatchedfilepath).Length;
                        int  filesize = Convert.ToInt32(length);
                        if (classVars.b_upl_filesize_ok)
                        {
                            WebClient up2 = new WebClient();
                            up2.Headers.Add("Content-Type", "image/jpeg");
                            string final = username + "_" + rng + "_" + attachedfileName;

                            try { File.Delete("C:\\users\\public\\" + final); } catch { }

                            File.Copy(attatchedfilepath, "C:\\users\\public\\" + final);
                            MessageBox.Show("Now uploading the attatchment..");
                            new Thread(() =>
                            {
                                Thread.CurrentThread.IsBackground = false;
                                byte[] result2 = up2.UploadFile(classVars.url_upl_bugreport_att, "POST", "C:\\users\\public\\" + final);
                            }).Start();
                        }
                        else
                        {
                        }
                    }
                }
                catch (Exception ex)  { MessageBox.Show("Something went wrong, please try again later \n" + ex); }
                MessageBox.Show("Thank you for your help! " +
                                "\n" +
                                "A gamemaster will take care now");
                this.Close();
            }
            else
            {
                MessageBox.Show("Please fill in all fields.\nAlso please do not attach large file bigger than 9MB.");
            }
        }
Esempio n. 2
0
 private void frmBugtracker_Load(object sender, EventArgs e)
 {
     this.TopMost = true;
     try
     {
         var    ini      = new ini(classVars.s_settingspath);
         string username = ini.Read("user");
         textBox1.Text = username;
     }
     catch { }
 }
Esempio n. 3
0
        public static void clearCacheFolder()
        {
            var    ini  = new ini(classVars.s_settingspath);
            string path = ini.Read("path");

            if (path != null)
            {
                try
                {
                    Directory.Delete(path.Replace("Wow.exe", "") + "Cache", true);
                }
                catch
                {
                }
            }
        }
Esempio n. 4
0
        private void clearCacheToolStripMenuItem_Click(object sender, EventArgs e)
        {
            var    ini  = new ini(classVars.s_settingspath);
            string path = ini.Read("path");

            if (path != null)
            {
                try
                {
                    Directory.Delete(path.Replace("Wow.exe", "") + "Cache", true);
                }
                catch
                {
                }
            }
        }
Esempio n. 5
0
        public void LoadSettings()
        {
            if (!File.Exists(classVars.s_settingspath))
            {
                var myFile = File.Create(classVars.s_settingspath);
                myFile.Close();
                MessageBox.Show("Please setup your launcher now!");
                frmSettings sf = new frmSettings();
                sf.Show();
            }
            else if (File.Exists(classVars.s_settingspath))
            {
                string read;
                read = File.ReadAllText(classVars.s_settingspath);
                if (read == null)
                {
                    MessageBox.Show("Settings not ready yet");
                }
            }

            var    ini           = new ini(classVars.s_settingspath);
            string path          = ini.Read("path");
            string user          = ini.Read("user");
            string pass          = ini.Read("pass");
            string show_pw       = ini.Read("show_pw");
            string update_checks = ini.Read("update_checks");
            string playandclose  = ini.Read("playandclose");
            string autologin     = ini.Read("autologin");
            string decoded       = Crypto.Atom128.Decode(pass);

            pass = decoded;
            string clientversion = ini.Read("clVersion");
            string lanmode       = ini.Read("lanmode");
            string rl            = ini.Read("fullrealmlist");

            classVars.s_realmlistFullContent = rl;
            classVars.s_lanmode       = lanmode;
            classVars.cl_version      = clientversion;
            classVars.s_autologin     = autologin;
            classVars.s_path          = path;
            classVars.s_user          = user;
            classVars.s_update_checks = update_checks;
            classVars.s_show_pw       = show_pw;
            classVars.s_pass          = pass;
            classVars.s_playandclose  = playandclose;
        }
        private void btnChoose_Click(object sender, EventArgs e)
        {
            OpenFileDialog ofd = new OpenFileDialog();

            if (ofd.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                string fullPath = ofd.FileName;
                string fileName = ofd.SafeFileName;
                string path     = fullPath.Replace(fileName, "");
                txtPath.Text  = fullPath;
                setPath       = fullPath;
                realmlistPath = path + "\\realmlist.wtf";
            }
            var ini = new ini(classVars.s_settingspath);

            ini.Write("path", setPath);
        }
Esempio n. 7
0
        private void btnPlay_Click(object sender, EventArgs e)
        {
            bool b1 = false;
            bool b2 = false;

            if (lblServerStatus.ForeColor == System.Drawing.Color.Green)
            {
                b1 = true;
            }
            if (classVars.s_lanmode == "true")
            {
                b2 = true;
            }
            if (b1 || b2)
            {
                var    ini       = new ini(classVars.s_settingspath);
                string path      = ini.Read("path");
                string autoclean = ini.Read("autoclear");
                LoadSettings();

                try
                {
                    int i = Convert.ToInt32(classVars.cl_version.Replace(".", ""));
                    classPatcher.PatchRealmlist(i);
                }
                catch (Exception re)
                {
                    MessageBox.Show(re.ToString());
                }

                if (classVars.s_lanmode == "false")
                {
                    if (lblServerStatus.ForeColor == System.Drawing.Color.Red)
                    {
                        MessageBox.Show("The worldserver seems to be offline , please check back later. "
                                        + "\nIf you want to play on a local server please enable LAN Mode in the settings to skip this message.");
                    }
                }


                if (path != null && autoclean == "true")
                {
                    try
                    {
                        Directory.Delete(path.Replace("Wow.exe", "") + "Cache", true);
                    }
                    catch
                    {
                    }
                }
                if (classVars.s_autologin == "false")
                {
                    Process.Start(classVars.s_path);
                }
                this.TopMost = false;
                if (!File.Exists(classVars.s_settingspath))
                {
                    MessageBox.Show("Cannot launch game , update your settings please.");
                }
                else if (classVars.s_autologin == "true")
                {
                    Process proc = Process.Start(classVars.s_path);

                    while (!proc.WaitForInputIdle())
                    {
                        System.Threading.Thread.Sleep(4000);
                    }

                    string u = classVars.s_user;
                    System.Threading.Thread.Sleep(2000);
                    string p = classVars.s_pass;

                    foreach (char accNameLetter in u)
                    {
                        SendMessage(proc.MainWindowHandle, classVars.WM_CHAR, new IntPtr(accNameLetter), IntPtr.Zero);
                        System.Threading.Thread.Sleep(100);
                    }

                    SendMessage(proc.MainWindowHandle, classVars.WM_KEYUP, new IntPtr(classVars.VK_TAB), IntPtr.Zero);
                    SendMessage(proc.MainWindowHandle, classVars.WM_KEYDOWN, new IntPtr(classVars.VK_TAB), IntPtr.Zero);

                    foreach (char accPassLetter in p)
                    {
                        SendMessage(proc.MainWindowHandle, classVars.WM_CHAR, new IntPtr(accPassLetter), IntPtr.Zero);
                        System.Threading.Thread.Sleep(100);
                    }

                    SendMessage(proc.MainWindowHandle, classVars.WM_KEYUP, new IntPtr(classVars.VK_RETURN), IntPtr.Zero);
                    SendMessage(proc.MainWindowHandle, classVars.WM_KEYDOWN, new IntPtr(classVars.VK_RETURN), IntPtr.Zero);
                }
                if (classVars.s_playandclose == "true")
                {
                    System.Threading.Thread.Sleep(1000);
                    Application.Exit();
                }
            }
            else
            {
                MessageBox.Show("The worldserver seems to be offline , please check back later. "
                                + "\nIf you want to play on a local server please enable LAN Mode in the settings to skip this message.");
            }
        }
        private void frmSettings_Load(object sender, EventArgs e)
        {
            //if(classVars.b_debug)
            //{

            //}
            //else
            //{

            //}

            this.TopMost = true;

            if (File.Exists(classVars.s_settingspath))
            {
                try
                {
                    var    ini             = new ini(classVars.s_settingspath);
                    string path            = ini.Read("path");
                    string user            = ini.Read("user");
                    string pass            = ini.Read("pass");
                    string show_pw         = ini.Read("show_pw");
                    string autologin       = ini.Read("autologin");
                    string playandclose    = ini.Read("playandclose");
                    string update_checks   = ini.Read("update_checks");
                    string rl              = path.Replace("Wow.exe", "realmlist.wtf");
                    string realmlistPath   = rl;
                    string autoclear       = ini.Read("autoclear");
                    string clientversion   = ini.Read("clVersion");
                    string lanmode         = ini.Read("lanmode");
                    string s_fullrealmlist = ini.Read("fullrealmlist");
                    classVars.s_lanmode              = lanmode;
                    classVars.cl_version             = clientversion;
                    comboBox1.Text                   = classVars.cl_version;
                    classVars.s_realmlistFullContent = s_fullrealmlist;
                    setPath         = path;
                    s_show_pw       = show_pw;
                    s_autologin     = autologin;
                    s_update_checks = update_checks;
                    s_playandclose  = playandclose;
                    s_autoclear     = autoclear;
                    string input   = pass;
                    string decoded = Crypto.Atom128.Decode(pass);
                    pass = decoded;

                    txtPath.Text  = path;
                    textBox1.Text = user;
                    textBox2.Text = pass;
                    textBox3.Text = classVars.s_realmlistFullContent;

                    if (s_show_pw == "true")
                    {
                        checkBox1.Checked = true;
                    }
                    else if (s_show_pw == "false")
                    {
                        checkBox1.Checked = false;
                    }
                    if (s_update_checks == "true")
                    {
                        checkBox2.Checked = true;
                    }
                    else if (s_update_checks == "false")
                    {
                        checkBox2.Checked = false;
                    }
                    if (s_playandclose == "true")
                    {
                        checkBox3.Checked = true;
                    }
                    else if (s_playandclose == "false")
                    {
                        checkBox3.Checked = false;
                    }
                    if (s_autologin == "true")
                    {
                        checkBox4.Checked = true;
                    }
                    else if (s_autologin == "false")
                    {
                        checkBox4.Checked = false;
                    }
                    if (s_autoclear == "true")
                    {
                        checkBox5.Checked = true;
                    }
                    else if (s_autoclear == "false")
                    {
                        checkBox5.Checked = false;
                    }
                    if (lanmode == "true")
                    {
                        chk_OfflineMode.Checked = true;
                    }
                    else if (lanmode == "false")
                    {
                        chk_OfflineMode.Checked = false;
                    }
                    checkPatch();
                }
                catch { MessageBox.Show("Settings file found but empty"); }
            }
        }
        private void button1_Click(object sender, EventArgs e)
        {
            if (checkBox1.Checked == true)
            {
                s_show_pw = "true";
            }
            else
            {
                s_show_pw = "false";
            }
            if (checkBox4.Checked == true)
            {
                s_autologin = "******";
            }
            else
            {
                s_autologin = "******";
            }
            if (checkBox5.Checked == true)
            {
                s_autoclear = "true";
            }
            else
            {
                s_autoclear = "false";
            }
            if (chk_OfflineMode.Checked == true)
            {
                classVars.s_lanmode = "true";
            }
            else if (chk_OfflineMode.Checked == false)
            {
                classVars.s_lanmode = "false";
            }
            if (checkBox3.Checked == true)
            {
                s_playandclose = "true";
            }
            else if (checkBox3.Checked == false)
            {
                s_playandclose = "false";
            }

            string input   = textBox2.Text;
            string encoded = Crypto.Atom128.Encode(input);
            var    ini     = new ini(classVars.s_settingspath);

            classVars.s_realmlistFullContent = textBox3.Text;
            classVars.cl_version             = comboBox1.Text;
            ini.Write("path", setPath);
            ini.Write("user", textBox1.Text);
            ini.Write("pass", encoded);
            ini.Write("show_pw", s_show_pw);
            ini.Write("update_checks", s_update_checks);
            ini.Write("playandclose", s_playandclose);
            ini.Write("autologin", s_autologin);
            ini.Write("autoclear", s_autoclear);
            ini.Write("clVersion", classVars.cl_version);
            ini.Write("lanmode", classVars.s_lanmode);
            ini.Write("fullrealmlist", classVars.s_realmlistFullContent);
            MessageBox.Show("Settings saved!");
            this.Close();
        }