Example #1
0
 private bool AnyProblems()
 {
     if (Program.mem == null || !Program.mem.ValidateProcess() || Program.mem.GetSelfCombatant() == null || Program.mem.Process.Id != (int?)ProcessComboBox.SelectedValue)
     {
         HuntConnectionTextBlock.Text = string.Format(Properties.Resources.FormNoProcess, FFXIVProcessHelper.DX9ExeName + (Environment.Is64BitProcess ? "/" + FFXIVProcessHelper.DX11ExeName : string.Empty));
         if (ProcessComboBox.SelectedValue != null && FFXIVProcessHelper.GetFFXIVProcess((int)ProcessComboBox.SelectedValue) != null)
         {
             if (Program.mem != null)
             {
                 Program.mem.OnNewCommand -= ProcessChatCommand;
                 Program.mem.Dispose();
                 hunts?.LeaveGroup();
             }
             Program.mem = null;
             Program.mem = new FFXIVMemory(FFXIVProcessHelper.GetFFXIVProcess((int)ProcessComboBox.SelectedValue));
             Program.mem.OnNewCommand += ProcessChatCommand;
             PersistentNamedPipeServer.Restart();
         }
         hunts?.LeaveGroup();
         HuntNotifyGroupBox.IsEnabled = false;
         return(true);
     }
     else
     {
         if (hunts == null && Program.mem != null && Program.mem.ValidateProcess())
         {
             hunts = new FFXIVHunts(this);
         }
         HuntNotifyGroupBox.IsEnabled = true;
     }
     return(false);
 }
Example #2
0
        private bool AnyProblems()
        {
            if (Program.mem != null && Program.mem.ValidateProcess() && Program.mem.GetSelfCombatant() != null)
            {
                int id  = Program.mem.Process.Id;
                int?num = (int?)this.ProcessComboBox.SelectedValue;
                if (id == num.GetValueOrDefault() & num != null)
                {
                    if (this.hunts == null && Program.mem != null && Program.mem.ValidateProcess())
                    {
                        this.hunts = new FFXIVHunts(this);
                    }
                    this.MainTabControl.IsEnabled = (this.HuntNotifyGroupBox.IsEnabled = true);
                    return(false);
                }
            }
            this.HuntConnectionTextBlock.Text = string.Format(CultureInfo.CurrentCulture, FFXIV_GameSense.Properties.Resources.FormNoProcess, "ffxiv_dx11.exe");
            if (this.ProcessComboBox.SelectedValue != null && FFXIVProcessHelper.GetFFXIVProcess((int)this.ProcessComboBox.SelectedValue) != null)
            {
                if (Program.mem != null)
                {
                    Program.mem.OnNewCommand -= this.ProcessChatCommand;
                    Program.mem.Dispose();
                    FFXIVHunts ffxivhunts = this.hunts;
                    if (ffxivhunts != null)
                    {
                        ffxivhunts.LeaveGroup();
                    }
                }
                Program.mem = null;
                Program.mem = new FFXIVMemory(FFXIVProcessHelper.GetFFXIVProcess((int)this.ProcessComboBox.SelectedValue));
                Program.mem.OnNewCommand += this.ProcessChatCommand;
                PersistentNamedPipeServer.Restart();
            }
            FFXIVHunts ffxivhunts2 = this.hunts;

            if (ffxivhunts2 != null)
            {
                ffxivhunts2.LeaveGroup();
            }
            this.MainTabControl.IsEnabled = (this.HuntNotifyGroupBox.IsEnabled = false);
            return(true);
        }