Process::attach_pid attaches to a process by referencing its PID.
Process::list lists all PIDs associated with processes with the name passed in.
Together, these allow an autosplitter to define its own logic for discovering and attaching to processes.
Sometimes start time or largest PID don't quite get the right process. For example, Tony Hawk's Pro Skater 1+2 has a bootstrap and game process, both with the same name. They start in the same second, so the regular Process::attach logic often selects the incorrect process. This pull request allows an author to check each process closer to determine which one is desired. (rather messy) example of usage here: https://github.com/PARTYMANX/thps-autosplitter/blob/thps12-disambiguate/src/lib.rs#L19
Adds two functions:
Process::attach_pid
attaches to a process by referencing its PID.Process::list
lists all PIDs associated with processes with the name passed in.Together, these allow an autosplitter to define its own logic for discovering and attaching to processes.
Sometimes start time or largest PID don't quite get the right process. For example, Tony Hawk's Pro Skater 1+2 has a bootstrap and game process, both with the same name. They start in the same second, so the regular
Process::attach
logic often selects the incorrect process. This pull request allows an author to check each process closer to determine which one is desired. (rather messy) example of usage here: https://github.com/PARTYMANX/thps-autosplitter/blob/thps12-disambiguate/src/lib.rs#L19Companion pull request to https://github.com/LiveSplit/livesplit-core/pull/721. Solves #50.