Skip to content

Commit

Permalink
Mac: Prevent error logs when parsing services.json
Browse files Browse the repository at this point in the history
  • Loading branch information
a-kriya committed Apr 27, 2020
1 parent d17e8b4 commit 5cedcd9
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 12 deletions.
10 changes: 6 additions & 4 deletions src/back/GameLauncher.ts
Expand Up @@ -105,7 +105,9 @@ export namespace GameLauncher {
}
// Launch game
let proc: ChildProcess;
switch (opts.game.applicationPath) {
const appPath: string = getApplicationPath(opts.game.applicationPath, opts.execMappings, opts.native)

switch (appPath) {
case ':flash:': {
const env = getEnvironment(opts.fpPath);
if ('ELECTRON_RUN_AS_NODE' in env) {
Expand All @@ -120,20 +122,20 @@ export namespace GameLauncher {
opts.log({
source: logSource,
content: `Launch Game "${opts.game.title}" (PID: ${proc.pid}) [\n`+
` applicationPath: "${opts.game.applicationPath}",\n`+
` applicationPath: "${appPath}",\n`+
` launchCommand: "${opts.game.launchCommand}" ]`
});
} break;
default: {
const gamePath: string = fixSlashes(path.join(opts.fpPath, getApplicationPath(opts.game.applicationPath, opts.execMappings, opts.native)));
const gamePath: string = fixSlashes(path.join(opts.fpPath, appPath));
const gameArgs: string = opts.game.launchCommand;
const command: string = createCommand(gamePath, gameArgs);
proc = exec(command, { env: getEnvironment(opts.fpPath) });
logProcessOutput(proc, opts.log);
opts.log({
source: logSource,
content: `Launch Game "${opts.game.title}" (PID: ${proc.pid}) [\n`+
` applicationPath: "${opts.game.applicationPath}",\n`+
` applicationPath: "${appPath}",\n`+
` launchCommand: "${opts.game.launchCommand}",\n`+
` command: "${command}" ]`
});
Expand Down
10 changes: 5 additions & 5 deletions src/back/ServicesFile.ts
Expand Up @@ -37,11 +37,11 @@ export namespace ServicesFile {
input: data,
onError: onError && (e => { onError(`Error while parsing Services: ${e.toString()}`); })
});
parsed.redirector = parseBackProcessInfo(parser.prop('redirector'));
parsed.fiddler = parseBackProcessInfo(parser.prop('fiddler'));
parsed.server = parseBackProcessInfo(parser.prop('server'));
parser.prop('start').array(item => parsed.start.push(parseBackProcessInfo(item)));
parser.prop('stop').array(item => parsed.stop.push(parseBackProcessInfo(item)));
parsed.fiddler = parseBackProcessInfo(parser.prop('fiddler', true));
parsed.redirector = parseBackProcessInfo(parser.prop('redirector', true));
parsed.server = parseBackProcessInfo(parser.prop('server', true));
parser.prop('start', true).array(item => parsed.start.push(parseBackProcessInfo(item)));
parser.prop('stop', true).array(item => parsed.stop.push(parseBackProcessInfo(item)));
return parsed;
}

Expand Down
4 changes: 2 additions & 2 deletions src/main/Flash.ts
Expand Up @@ -50,10 +50,10 @@ export function flash(init: Init): void {
extension = '.so';
break;
case 'darwin':
// @TODO Find out the extension on mac
extension = '.plugin'
break;
default:
console.error(`No plguin file extension is assigned to the current operating system (platform: "${process.platform}").`);
console.error(`No plugin file extension is assigned to the current operating system (platform: "${process.platform}").`);
break;
}
app.commandLine.appendSwitch('ppapi-flash-path', path.resolve(state.config.flashpointPath, 'Plugins', state.plugin + extension));
Expand Down
2 changes: 1 addition & 1 deletion static/window/flash_index.html
@@ -1,4 +1,4 @@
<!doctype html>
<!DOCTYPE html>
<html lang="en">
<head>
<style>
Expand Down

0 comments on commit 5cedcd9

Please sign in to comment.