Пример #1
0
 public Proxy(Client client)
 {
     try
     {
         this.client = client;
         Initialize();
     }
     catch (Exception e)
     {
         Logger.Log("Falha ao inciar o proxy. Erro: " + e.ToString(), LogType.FATAL);
     }
 }
Пример #2
0
        private void uxChoose_Click(object sender, RoutedEventArgs e)
        {
            if (this.uxClients.SelectedItem is Client)
                this.SelectedClient = (Client)uxClients.SelectedItem;
            else
            {
                if (this.uxClients.Items.Count > 1)
                    this.SelectedClient = Client.OpenMC();
                else
                    this.SelectedClient = Client.Open();
            }

            this.Close();
        }
Пример #3
0
 internal InputHelper(Client client)
 {
     this.client = client;
 }
Пример #4
0
 internal WindowHelper(Client client)
 {
     this.client = client;
 }
Пример #5
0
 internal LoginHelper(Client client)
 {
     this.client = client;
 }
Пример #6
0
        /// <summary>
        /// Get a list of all the open clients of certain version. Class method.
        /// </summary>
        /// <returns></returns>
        public static List<Client> GetClients(string version, bool offline)
        {
            List<Client> clients = new List<Client>();
            Client client = null;

            foreach (Process process in Process.GetProcesses()) {
                StringBuilder classname = new StringBuilder();
                Util.WinApi.GetClassName(process.MainWindowHandle, classname, 12);

                if (classname.ToString().Equals("TibiaClient", StringComparison.CurrentCultureIgnoreCase)) {
                    if (version == null) {
                        client = new Client(process);
                        if (!offline || !client.LoggedIn)
                            clients.Add(client);
                    }
                    else if (process.MainModule.FileVersionInfo.FileVersion == version) {
                        clients.Add(new Client(process));
                        if (!offline || !client.LoggedIn)
                            clients.Add(client);
                    }
                }
            }
            return clients;
        }