Port message types to TypeScript

This commit is contained in:
Hornwitser committed 2023-08-11 00:24:00 +02:00
1 parent 15ea9a91dc
commit 2a52a82fb7
31 files changed
+2846 -4124

No files matched your search

+1 -1
View File
@@ -457,7 +457,7 @@ class Host extends lib.Link {
let instanceConnection = this.instanceConnections.get(instanceId);
this.send(
new lib.InstanceStatusChangedEvent(
instanceId, instanceConnection ? instanceConnection.status : "stopped", null
instanceId, instanceConnection ? instanceConnection.status : "stopped", undefined
)
);
+1 -1
View File
@@ -438,7 +438,7 @@ rcon.print(game.table_to_json(players))`.replace(/\r?\n/g, " ");
new lib.InstanceStatusChangedEvent(
this.id,
status,
this.server && this.server.gamePort || this.config.get("factorio.game_port") || null,
this.server && this.server.gamePort || this.config.get("factorio.game_port") || undefined,
),
);
}
+10 -6
View File
@@ -796,9 +796,11 @@ class FactorioServer extends events.EventEmitter {
[
"--config", this.writePath("config.ini"),
"--create", this.writePath("saves", name),
...(seed !== null ? ["--map-gen-seed", seed] : []),
...(mapGenSettings !== null ? ["--map-gen-settings", this.writePath("map-gen-settings.json")] : []),
...(mapSettings !== null ? ["--map-settings", this.writePath("map-settings.json")] : []),
/* eslint-disable eqeqeq, no-eq-null */
...(seed != null ? ["--map-gen-seed", seed] : []),
...(mapGenSettings != null ? ["--map-gen-settings", this.writePath("map-gen-settings.json")] : []),
...(mapSettings != null ? ["--map-settings", this.writePath("map-settings.json")] : []),
/* eslint-enable eqeqeq, no-eq-null */
...(this.verboseLogging ? ["--verbose"] : []),
],
{
@@ -886,9 +888,11 @@ class FactorioServer extends events.EventEmitter {
[
"--config", this.writePath("config.ini"),
"--start-server-load-scenario", scenario,
...(seed !== null ? ["--map-gen-seed", seed] : []),
...(mapGenSettings !== null ? ["--map-gen-settings", this.writePath("map-gen-settings.json")] : []),
...(mapSettings !== null ? ["--map-settings", this.writePath("map-settings.json")] : []),
/* eslint-disable eqeqeq, no-eq-null */
...(seed != null ? ["--map-gen-seed", seed] : []),
...(mapGenSettings != null ? ["--map-gen-settings", this.writePath("map-gen-settings.json")] : []),
...(mapSettings != null ? ["--map-settings", this.writePath("map-settings.json")] : []),
/* eslint-enable eqeqeq, no-eq-null */
"--port", this.gamePort,
"--rcon-port", this.rconPort,
"--rcon-password", this.rconPassword,