Compare commits
1 Commits
cf515f5584
...
966e92b304
| Author | SHA1 | Date | |
|---|---|---|---|
| 966e92b304 |
+17
-15
@@ -80,12 +80,18 @@ impl Service {
|
|||||||
/// keeps `spawn` responsible for reporting a missing binary, with one error message
|
/// keeps `spawn` responsible for reporting a missing binary, with one error message
|
||||||
/// instead of two.
|
/// instead of two.
|
||||||
fn resolve_binary(service: Service) -> PathBuf {
|
fn resolve_binary(service: Service) -> PathBuf {
|
||||||
let name = service.binary();
|
let base = service.binary();
|
||||||
|
// On Windows the built companion is `openfut-lsx.exe`; a bare name without the
|
||||||
|
// extension matches neither the sibling file nor CreateProcess resolution.
|
||||||
|
#[cfg(windows)]
|
||||||
|
let name = format!("{base}.exe");
|
||||||
|
#[cfg(unix)]
|
||||||
|
let name = base.to_string();
|
||||||
if let Some(dir) = std::env::current_exe()
|
if let Some(dir) = std::env::current_exe()
|
||||||
.ok()
|
.ok()
|
||||||
.and_then(|p| p.parent().map(Path::to_path_buf))
|
.and_then(|p| p.parent().map(Path::to_path_buf))
|
||||||
{
|
{
|
||||||
let sibling = dir.join(name);
|
let sibling = dir.join(&name);
|
||||||
if sibling.is_file() {
|
if sibling.is_file() {
|
||||||
return sibling;
|
return sibling;
|
||||||
}
|
}
|
||||||
@@ -434,21 +440,18 @@ impl ServiceSupervisor {
|
|||||||
/// Start `service` only if it is not already usable. Never restarts a healthy
|
/// Start `service` only if it is not already usable. Never restarts a healthy
|
||||||
/// service, and never adopts a foreign one as ours.
|
/// service, and never adopts a foreign one as ours.
|
||||||
pub fn ensure_running(&mut self, service: Service, spec: SpawnSpec) -> Result<Ensured, String> {
|
pub fn ensure_running(&mut self, service: Service, spec: SpawnSpec) -> Result<Ensured, String> {
|
||||||
// On native Windows the "companion services" are NOT separate processes:
|
// On Windows the ProtoSSL cert-verify patch (autopatch's job on unix, via
|
||||||
// LSX/Origin login and the ProtoSSL cert path are provided in-process by
|
// /proc/PID/mem) is performed in-process by the version.dll hook, so there
|
||||||
// stp-origin_emu.dll and the version.dll hook once the game runs. There is
|
// is no autopatch process to run. LSX is different: the game dials it on
|
||||||
// nothing for the launcher to spawn or supervise, so report ready.
|
// 127.0.0.1:4216, so it MUST run locally here exactly as on unix.
|
||||||
#[cfg(windows)]
|
#[cfg(windows)]
|
||||||
{
|
if service == Service::Autopatch {
|
||||||
let _ = spec;
|
self.log.lock().push(
|
||||||
self.log.lock().push(format!(
|
"[launcher] autopatch runs in-process on Windows (version.dll hook) — nothing to start."
|
||||||
"[launcher] {} is in-process on Windows (stp/hook) — nothing to start.",
|
.to_string(),
|
||||||
service.label()
|
);
|
||||||
));
|
|
||||||
return Ok(Ensured::Reused);
|
return Ok(Ensured::Reused);
|
||||||
}
|
}
|
||||||
#[cfg(unix)]
|
|
||||||
{
|
|
||||||
let runtime = self.observe(service);
|
let runtime = self.observe(service);
|
||||||
if runtime.ready() {
|
if runtime.ready() {
|
||||||
self.log.lock().push(format!(
|
self.log.lock().push(format!(
|
||||||
@@ -476,7 +479,6 @@ impl ServiceSupervisor {
|
|||||||
.map_err(|e| e.to_string())?;
|
.map_err(|e| e.to_string())?;
|
||||||
*self.slot(service) = ManagedService::from_child(child);
|
*self.slot(service) = ManagedService::from_child(child);
|
||||||
Ok(Ensured::Started)
|
Ok(Ensured::Started)
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Stop a service the launcher owns. A foreign process is reported, never
|
/// Stop a service the launcher owns. A foreign process is reported, never
|
||||||
|
|||||||
Reference in New Issue
Block a user