imprvd
This commit is contained in:
+4
-1
@@ -4,8 +4,11 @@ export function GetRandomPort(min: number, max: number): number {
|
||||
return randomIntFromInterval(min, max);
|
||||
}
|
||||
|
||||
export function OpenGameInstance(path: string, port: number): void {
|
||||
export function OpenGameInstance(path: string, port: number, matchId?: number): void {
|
||||
const args = ["-port", port.toString()];
|
||||
if (matchId != null && Number.isFinite(matchId)) {
|
||||
args.push("-matchId", String(Math.trunc(matchId)));
|
||||
}
|
||||
const child = spawn(path, args);
|
||||
|
||||
child.stdout.on('data', (data: Buffer) => {
|
||||
|
||||
Reference in New Issue
Block a user