Ejemplo n.º 1
0
        private void MainForm_Load(object sender, EventArgs e)
        {
            //MessageBox.Show("In case you didn't realize it, this patcher doesn't work yet. At this time it's purely under development for testing.");
            // tii.ProgressState = TaskbarItemProgressState.Normal;
            //  tii.ProgressValue = (double)50 /100;

            //Read:

            /*
             * var pv = JsonConvert.DeserializeObject<PatchVersion>(test);
             * MessageBox.Show(pv.ServerName);
             */
            //Write:

            /*
             * PatchVersion pv = new PatchVersion();
             * pv.ServerName = "Test";
             * pv.RootFiles.Add("eqgame.exe", "12345test");
             * txtList.Text = JsonConvert.SerializeObject(pv);
             */
            try {
                var hash = UtilityLibrary.GetEverquestExecutableHash(AppDomain.CurrentDomain.BaseDirectory);
                if (hash == "")
                {
                    MessageBox.Show("Please run this patcher in your Everquest directory.");
                    this.Close();
                    return;
                }
                switch (hash)
                {
                case "85218FC053D8B367F2B704BAC5E30ACC":
                    txtList.Text  = "You seem to have put me in a Secrets of Feydwer client directory";
                    clientVersion = "Secrets of Feydwer";
                    break;

                case "859E89987AA636D36B1007F11C2CD6E0":
                    txtList.Text  = "You seem to have put me in a Underfoot client directory";
                    clientVersion = "Underfoot";
                    break;

                case "BB42BC3870F59B6424A56FED3289C6D4":
                    txtList.Text  = "You seem to have put me in a Titanium client directory";
                    clientVersion = "Titanium";
                    break;

                default:
                    txtList.Text = "I don't recognize the Everquest client in my directory, send this to Shin: " + hash;
                    break;
                }
                txtList.Text += "\r\n\r\nIf you wish to help out, press the scan button on the bottom left and wait for it to complete, then copy paste this data as an Issue on github!";
            }
            catch (UnauthorizedAccessException err)
            {
                MessageBox.Show("You need to run this program with Administrative Privileges" + err.Message);
                return;
            }
        }
Ejemplo n.º 2
0
        private void detectClientVersion()
        {
            try
            {
                var hash = UtilityLibrary.GetEverquestExecutableHash(AppDomain.CurrentDomain.BaseDirectory);
                if (hash == "")
                {
                    MessageBox.Show("Please run this patcher in your Everquest directory.");
                    this.Close();
                    return;
                }
                switch (hash)
                {
                case "85218FC053D8B367F2B704BAC5E30ACC":
                    currentVersion   = VersionTypes.Secrets_Of_Feydwer;
                    splashLogo.Image = Properties.Resources.sof;
                    break;

                case "859E89987AA636D36B1007F11C2CD6E0":
                case "EF07EE6649C9A2BA2EFFC3F346388E1E78B44B48":     //one of the torrented uf clients, used by B&R too
                    currentVersion   = VersionTypes.Underfoot;
                    splashLogo.Image = Properties.Resources.underfoot;
                    break;

                case "A9DE1B8CC5C451B32084656FCACF1103":     //p99 client
                case "BB42BC3870F59B6424A56FED3289C6D4":     //vanilla titanium
                    currentVersion   = VersionTypes.Titanium;
                    splashLogo.Image = Properties.Resources.titanium;
                    break;

                case "368BB9F425C8A55030A63E606D184445":
                    currentVersion   = VersionTypes.Rain_Of_Fear;
                    splashLogo.Image = Properties.Resources.rof;
                    break;

                case "240C80800112ADA825C146D7349CE85B":
                case "A057A23F030BAA1C4910323B131407105ACAD14D":     //This is a custom ROF2 from a torrent download
                    currentVersion   = VersionTypes.Rain_Of_Fear_2;
                    splashLogo.Image = Properties.Resources.rof;
                    break;

                case "6BFAE252C1A64FE8A3E176CAEE7AAE60":     //This is one of the live EQ binaries.
                case "AD970AD6DB97E5BB21141C205CAD6E68":     //2016/08/27
                    currentVersion   = VersionTypes.Broken_Mirror;
                    splashLogo.Image = Properties.Resources.brokenmirror;
                    break;

                default:
                    currentVersion = VersionTypes.Unknown;
                    break;
                }
                if (currentVersion == VersionTypes.Unknown)
                {
                    if (MessageBox.Show("Unable to recognize the Everquest client in this directory, open a web page to report to devs?", "Visit", MessageBoxButtons.YesNo, MessageBoxIcon.Asterisk) == DialogResult.Yes)
                    {
                        System.Diagnostics.Process.Start("https://github.com/Xackery/eqemupatcher/issues/new?title=A+New+EQClient+Found&body=Hi+I+Found+A+New+Client!+Hash:+" + hash);
                    }
                    txtList.Text = "Unable to recognize the Everquest client in this directory, send to developers: " + hash;
                }
                else
                {
                    //txtList.Text = "You seem to have put me in a " + clientVersions[currentVersion].FullName + " client directory";
                }

                //MessageBox.Show(""+currentVersion);

                //txtList.Text += "\r\n\r\nIf you wish to help out, press the scan button on the bottom left and wait for it to complete, then copy paste this data as an Issue on github!";
            }
            catch (UnauthorizedAccessException err)
            {
                MessageBox.Show("You need to run this program with Administrative Privileges" + err.Message);
                return;
            }
        }