public Client(Process process, ClientLaunchSettings launchSettings) { Process = process; LaunchSettings = launchSettings; Memory = new Memory(this.Process); InjectClient(); }
private Client AttachToProcess(Process process, ClientLaunchSettings settings) { var injectedClient = injectedClients.FirstOrDefault(client => client.Process.Id == process.Id); if (injectedClient == null) { injectedClient = new Client(process, settings); injectedClients.Add(injectedClient); process.Exited += (sender, args) => injectedClients.Remove(injectedClient); } return(injectedClient); }
private Client LaunchClient(ClientLaunchSettings settings) { File.Copy(settings.GameConfig, SFConfig.Global.WowDir + @"\WTF\Config.wtf", true); Process process = Process.Start(SFConfig.Global.WowDir + @"\Wow.exe"); if (process.WaitForInputIdle()) { Client client = AttachToProcess(process, settings); Launcher.LoginClient(client, settings.Login, settings.Password, settings.Character); return(client); } return(null); }