Skip to content

Commit

Permalink
Revert, and disallow overwriting an instance by launching from the web.
Browse files Browse the repository at this point in the history
  • Loading branch information
OrigamingWasTaken committed Oct 13, 2024
1 parent d844438 commit 2b65bc9
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 15 deletions.
9 changes: 1 addition & 8 deletions frontend/src/windows/main/ts/roblox/instance.ts
Original file line number Diff line number Diff line change
Expand Up @@ -140,14 +140,7 @@ export class RobloxInstance {

/** Starts the Roblox Instance */
public async start(url?: string) {
if (this.gameInstance) {
if (url) {
await this.quit();
await sleep(1000); // Precaution delay
} else {
throw new Error('An instance is already running');
}
}
if (this.gameInstance) throw new Error('An instance is already running');

console.info('[Roblox.Instance] Opening Roblox instance');

Expand Down
6 changes: 0 additions & 6 deletions frontend/src/windows/main/ts/roblox/launch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import { Notification } from '../tools/notifications';
import { RPCController } from '../tools/rpc';
import { shell } from '../tools/shell';
import shellFS from '../tools/shellfs';
import { sleep } from '../utils';
import { focusWindow, setWindowVisibility } from '../window';
import onGameEvent from './events';
import { RobloxInstance } from './instance';
Expand Down Expand Up @@ -34,15 +33,10 @@ export async function launchRoblox(
};

if (rbxInstance || (await shell('pgrep', ['-f', 'RobloxPlayer'], { skipStderrCheck: true })).stdOut.trim().length > 2) {
if (robloxUrl) {
await shell('pkill', ['-f', 'RobloxPlayer']);
await sleep(300);
} else {
setLaunchText('Roblox is already open');
setLaunchingRoblox(false);
toast.error('Due to technical reasons, you must close all instances of Roblox before launching from AppleBlox.');
return;
}
}
try {
console.info('[Launch] Launching Roblox');
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "appleblox",
"version": "0.8.0-dev.5",
"version": "0.8.0-dev.6",
"description": "MacOS roblox launcher",
"main": "frontend/src/windows/main/main.ts",
"scripts": {
Expand Down

0 comments on commit 2b65bc9

Please sign in to comment.