Skip to content

Commit

Permalink
Fix error message always showing up after playing a replay
Browse files Browse the repository at this point in the history
  • Loading branch information
Valandur committed Oct 2, 2015
1 parent 39d44cf commit d59ee0f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
3 changes: 2 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -250,12 +250,13 @@ ipc.on("play", function(event, args) {
lolClient.launch(replayServer.host(), replayServer.port(), replay.region, replay.gameId, replay.key, function(success) {
mainWindow.restore();

if (!success)
if (!success) {
logger.error("Could not start league of legends client.");
event.sender.send("error", {
title: "LoL Client error",
content: 'Could not start the League of Legends client<br />Please send us your current log file by clicking the button below and filling out the form.'
});
}
});
});

Expand Down
10 changes: 5 additions & 5 deletions src/modules/lol-client.js
Original file line number Diff line number Diff line change
Expand Up @@ -186,18 +186,18 @@ module.exports = function(extLogger) {
callback(false);
return;
}

// Set LoL client executable/app name
let exe = "";
if (process.platform == "win32") {
exe = "League of Legends.exe";
} else if (process.platform == "darwin") {
exe = "LeagueOfLegends.app";
}

// Set arguments
let args = ["8394", "LoLLauncher.exe", "", "spectator " + host + ":" + port + " " + replayKey + " " + replayGameId + " " + replayRegionName];

// Set options
let opts = { stdio: "ignore" };
if (process.platform == "win32") {
Expand All @@ -206,15 +206,15 @@ module.exports = function(extLogger) {
opts.cwd = fullPath + exe + "/Contents/MacOS";
process.env["riot_launched"] = true;
}

// Set command
let cmd = "";
if (process.platform == "win32") {
cmd = fullPath + exe;
} else if (process.platform == "darwin") {
cmd = opts.cwd + "/LeagueofLegends";
}

// Check if client is executable
fs.access(cmd, fs.X_OK, function (err) {
if (err) {
Expand Down

0 comments on commit d59ee0f

Please sign in to comment.