Esempio n. 1
0
        private void attach_Click(object sender, EventArgs e)
        {
            try
            {
                int     pid = 0;
                WaitBox box = new WaitBox();
                string  msg = "Waiting for DDO to start...";

                mainlogger.Info(msg);
                box.InfoText = msg;

                box.Show(this);
                box.Refresh();

                while (pid == 0)
                {
                    if (box.DialogResult == DialogResult.Cancel)
                    {
                        pid = 0;
                        mainlogger.Error("User said we should no longer wait for DDO.");
                        break;
                    }

                    Process[] res = Process.GetProcessesByName("dndclient");

                    if (res.Length == 0)
                    {
                        Application.DoEvents();
                    }
                    else
                    {
                        if (res.Length > 1)
                        {
                            mainlogger.Warning("Multiboxing is currently not supporting, it is undefined which instance will be taken.");
                        }
                        pid = res[0].Id;
                    }
                }
                if (pid != 0)
                {
                    box.Close();
                    mainlogger.Info(String.Format("Appending to PID {0}", pid));
                    DDO.Instance.HookOnto(pid);
                }
            }
            catch (Exception ex)
            {
                mainlogger.Error(ex.ToString());
            }
        }
Esempio n. 2
0
        private void attach_Click(object sender, EventArgs e)
        {
            try
              {
            int pid = 0;
            WaitBox box = new WaitBox();
            string msg = "Waiting for DDO to start...";

            mainlogger.Info(msg);
            box.InfoText = msg;

            box.Show(this);
            box.Refresh();

            while (pid == 0)
            {
              if (box.DialogResult == DialogResult.Cancel)
              {
            pid = 0;
            mainlogger.Error("User said we should no longer wait for DDO.");
            break;
              }

              Process[] res = Process.GetProcessesByName("dndclient");

              if (res.Length == 0)
              {
            Application.DoEvents();
              }
              else
              {
            if (res.Length > 1)
            {
              mainlogger.Warning("Multiboxing is currently not supporting, it is undefined which instance will be taken.");
            }
            pid = res[0].Id;
              }
            }
            if ( pid != 0 ) {
              box.Close();
              mainlogger.Info(String.Format("Appending to PID {0}", pid));
              DDO.Instance.HookOnto(pid);
            }
              }
              catch (Exception ex)
              {
            mainlogger.Error(ex.ToString());
              }
        }