示例#1
0
        // Public methods

        public void RefreshClientProcList()
        {
            try
            {
                Process[] procs = Process.GetProcesses();

                int i = 0;

                foreach (Process p in procs)
                {
                    if (p.ProcessName.Contains(_gameProcessNamePartial))
                    {
                        i++;
                    }
                }

                WoWClient[] tempClientList = new WoWClient[i];

                int j = 0;

                foreach (Process p in procs)
                {
                    if (j >= i)
                    {
                        break;
                    }

                    if (p.ProcessName.Contains(_gameProcessNamePartial))
                    {
                        tempClientList[j] = new WoWClient(p.Id);
                        j++;
                    }
                }

                Process[] tempProcList = new Process[tempClientList.Length];

                int y = 0;

                foreach (WoWClient c in tempClientList)
                {
                    if (y >= j)
                    {
                        break;
                    }

                    tempProcList[y] = tempClientList[y].GameProcess;
                    y++;
                }

                GameProcList   = tempProcList;
                GameClientList = tempClientList;
            }
            catch (Exception b)
            {
                consoleWriter.DebugLog(b.ToString(), ConfigurationManager.LogType.ERROR);
            }
        }
示例#2
0
        public void SetMasterClient(int procId) // using this to test what memory i'm reading, ie. how to read memory
        {
            Process master = Process.GetProcessById(procId);

            MasterClient = new WoWClient(master.Id);

            consoleWriter.Clear();

            consoleWriter.DebugLog($"Set master client to {MasterClient.Player.Name} - {procId}", ConfigurationManager.LogType.MESSAGE);
            consoleWriter.DebugLog($"Game version - {MasterClient.Player.GameVersion}", ConfigurationManager.LogType.MESSAGE);
            consoleWriter.DebugLog($"Realm name - {MasterClient.Player.RealmName}", ConfigurationManager.LogType.MESSAGE);
            consoleWriter.DebugLog($"Class - {MasterClient.Player.ClassName}", ConfigurationManager.LogType.MESSAGE);
        }
示例#3
0
        private void listBoxMacroGenCharacterSelect_SelectedIndexChanged(object sender, EventArgs e)
        {
            try
            {
                if (listBoxMacroGenCharacterSelect.SelectedItem != null) // avoid unecessary exceptions
                {
                    if (InputCallback.ProcManager.MasterClient != null)
                    {
                        WoWClient selectedClient = new WoWClient();

                        foreach (WoWClient c in InputCallback.ProcManager.GameClientList)
                        {
                            if (listBoxMacroGenCharacterSelect.SelectedItem.ToString() == c.Player.Name)
                            {
                                selectedClient = c;
                                break;
                            }
                        }

                        // did we select the master?
                        if (listBoxMacroGenCharacterSelect.SelectedItem.ToString().Equals(InputCallback.ProcManager.MasterClient.Player.Name))
                        {
                            PopulateMacroList(true, selectedClient.Player.Class); // new method; pop macro list for master ('true')
                        }
                        else
                        {
                            PopulateMacroList(false, selectedClient.Player.Class); // new method; pop macro list for children ('false')
                        }
                    }
                    else
                    {
                        MessageBox.Show(StaticTextLibrary.ErrorText.MasterClientMacro, "Macro Generator", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    }
                }
            }
            catch (Exception b)
            {
                consoleWriterMain.DebugLog(b.ToString(), ConfigurationManager.LogType.ERROR);
            }
        }
示例#4
0
 // Constructor
 public PlayerInfo(WoWClient client)
 {
     _gameClient = client;
 }