add path for local game

pull/83/head
Alexander Bentkamp 3 years ago
parent 9354724327
commit 620cf0597e

@ -27,10 +27,12 @@ const games = {
// name: "NNG",
dir: "../../../../NNG4",
queueLength: 5
},
"g/local/game": {
dir: "../../../../game",
queueLength: 5
}
}
// Note: If `module` and `name` are uncommented, one also needs to add them as arguments to
// the `--server` call below.
const __filename = url.fileURLToPath(import.meta.url);
const __dirname = url.fileURLToPath(new URL('.', import.meta.url));
@ -62,8 +64,12 @@ const queue = {}
function startServerProcess(tag) {
let serverProcess
if (isDevelopment && games[tag]?.dir) {
serverProcess = cp.spawn("./gameserver",
["--server", games[tag].dir], // games[tag].module, games[tag].name
let args = ["--server", games[tag].dir]
if (games[tag].module) {
args.push(games[tag].module)
if (games[tag].name) { args.push(games[tag].name) }
}
serverProcess = cp.spawn("./gameserver", args,
{ cwd: "./build/bin/" })
} else {
serverProcess = cp.spawn("docker",

Loading…
Cancel
Save