mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-21 16:13:12 +09:00
allow FactorioServer.version to return undefined
This commit is contained in:
1 parent
8a57d9b5f6
commit
dc2f86dcf3
4 files changed
+9
-10
No files matched your search
@@ -667,7 +667,7 @@ export default class Host extends lib.Link {
|
|||||||
instanceId,
|
instanceId,
|
||||||
instanceConnection ? instanceConnection.instance.status : "stopped",
|
instanceConnection ? instanceConnection.instance.status : "stopped",
|
||||||
instanceConnection ? instanceConnection.instance.server.gamePort : this.gamePort(instanceId),
|
instanceConnection ? instanceConnection.instance.server.gamePort : this.gamePort(instanceId),
|
||||||
instanceConnection ? instanceConnection.instance.server.version ?? undefined : undefined,
|
instanceConnection ? instanceConnection.instance.server.version : undefined,
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -1061,7 +1061,7 @@ export default class Host extends lib.Link {
|
|||||||
instanceInfo.config.toRemote("controller"),
|
instanceInfo.config.toRemote("controller"),
|
||||||
instanceConnection ? instanceConnection.instance.status : "stopped",
|
instanceConnection ? instanceConnection.instance.status : "stopped",
|
||||||
instanceConnection ? instanceConnection.instance.server.gamePort : this.gamePort(instanceId),
|
instanceConnection ? instanceConnection.instance.server.gamePort : this.gamePort(instanceId),
|
||||||
instanceConnection ? instanceConnection.instance.server.version ?? undefined : undefined,
|
instanceConnection ? instanceConnection.instance.server.version : undefined,
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
await this.send(new lib.InstancesUpdateRequest(list));
|
await this.send(new lib.InstancesUpdateRequest(list));
|
||||||
|
|||||||
@@ -453,8 +453,7 @@ rcon.print(game.table_to_json(players))`.replace(/\r?\n/g, " ");
|
|||||||
this.id,
|
this.id,
|
||||||
status,
|
status,
|
||||||
this.server.gamePort,
|
this.server.gamePort,
|
||||||
// server.version can be null before server is initialized
|
this.server.version,
|
||||||
this.server.version ?? undefined,
|
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -64,7 +64,7 @@ async function generateExportMod(server: FactorioServer) {
|
|||||||
sourceDir: path.join(__dirname, "..", "..", "..", "lua", "export"),
|
sourceDir: path.join(__dirname, "..", "..", "..", "lua", "export"),
|
||||||
outputDir: server.writePath("mods"),
|
outputDir: server.writePath("mods"),
|
||||||
bumpPatch: false,
|
bumpPatch: false,
|
||||||
factorioVersion: server.version.replace(/\.\d+$/, ""),
|
factorioVersion: server.version?.replace(/\.\d+$/, ""),
|
||||||
dependencies,
|
dependencies,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -725,12 +725,12 @@ export class FactorioServer extends events.EventEmitter {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The version of Factorio in use. This will be the actual version if
|
* The version of Factorio in use. This will be the actual version if
|
||||||
* "latest" (the default) was specified as `factorioVersion` to the
|
* "latest" (the default) was specified as `factorioVersion` to the constructor.
|
||||||
* constructor.
|
* This will be undefined before the server is initialized, or if init failed.
|
||||||
*/
|
*/
|
||||||
get version() {
|
get version(): string | undefined {
|
||||||
return this._version!;
|
return this._version ?? undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in new issue
Block a user