Skip to content

Commit

Permalink
chore: improve lazer detection on linux
Browse files Browse the repository at this point in the history
  • Loading branch information
xxCherry committed Oct 28, 2024
1 parent 69d1499 commit 57ce531
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions packages/tosu/src/instances/manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,12 @@ export class InstanceManager {
try {
let osuProcesses = Process.findProcesses('osu!.exe');

let lazerOnLinux = false;

if (osuProcesses.length === 0 && process.platform === 'linux') {
osuProcesses = Process.findProcesses('osu!');

lazerOnLinux = true;
}

for (const processId of osuProcesses || []) {
Expand All @@ -54,9 +58,10 @@ export class InstanceManager {
continue;
}

const isProcess64bit = Process.isProcess64bit(processId);
const isLazer =
Process.isProcess64bit(processId) || lazerOnLinux;

const osuInstance = isProcess64bit
const osuInstance = isLazer
? new LazerInstance(processId)
: new OsuInstance(processId);
const cmdLine = osuInstance.process.getProcessCommandLine();
Expand All @@ -83,10 +88,6 @@ export class InstanceManager {

this.osuInstances[processId] = osuInstance;
osuInstance.start();

if (process.platform === 'linux' && isProcess64bit) {
break;
}
}
} catch (exc) {
wLogger.error('InstanceManager', (exc as any).message);
Expand Down

0 comments on commit 57ce531

Please sign in to comment.