add path for local game
This commit is contained in:
+10
-4
@@ -27,10 +27,12 @@ const games = {
|
|||||||
// name: "NNG",
|
// name: "NNG",
|
||||||
dir: "../../../../NNG4",
|
dir: "../../../../NNG4",
|
||||||
queueLength: 5
|
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 __filename = url.fileURLToPath(import.meta.url);
|
||||||
const __dirname = url.fileURLToPath(new URL('.', import.meta.url));
|
const __dirname = url.fileURLToPath(new URL('.', import.meta.url));
|
||||||
@@ -62,8 +64,12 @@ const queue = {}
|
|||||||
function startServerProcess(tag) {
|
function startServerProcess(tag) {
|
||||||
let serverProcess
|
let serverProcess
|
||||||
if (isDevelopment && games[tag]?.dir) {
|
if (isDevelopment && games[tag]?.dir) {
|
||||||
serverProcess = cp.spawn("./gameserver",
|
let args = ["--server", games[tag].dir]
|
||||||
["--server", games[tag].dir], // games[tag].module, games[tag].name
|
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/" })
|
{ cwd: "./build/bin/" })
|
||||||
} else {
|
} else {
|
||||||
serverProcess = cp.spawn("docker",
|
serverProcess = cp.spawn("docker",
|
||||||
|
|||||||
Reference in New Issue
Block a user