Address feedback

* Fix typo in toJSON
* Handle the case of hostId being 0
* Hide address when host address is empty string
This commit is contained in:
Cooldude2606 committed 2026-07-18 22:07:54 +01:00
1 parent eab1a42e07
commit 90c8188952
2 files changed
+3 -3

No files matched your search

+2 -2
View File
@@ -52,7 +52,7 @@ export class ControllerPlugin extends BaseControllerPlugin {
for (const instance of this.controller.instances.values()) {
const pluginLoaded = instance.config.get("player_auth.load_plugin");
const assignedHost = instance.config.get("instance.assigned_host");
if (instance.status !== "running" || !pluginLoaded || !assignedHost) {
if (instance.status !== "running" || !pluginLoaded || assignedHost === null) {
continue;
}
@@ -70,7 +70,7 @@ export class ControllerPlugin extends BaseControllerPlugin {
servers.push({
name: settings["name"] as string || "unnamed server",
factorioVersion: instance.factorioVersion,
address: includeAddress ? address : undefined,
address: (includeAddress && host.publicAddress !== "") ? address : undefined,
});
}
+1 -1
View File
@@ -21,7 +21,7 @@ export class PlayerAuthServer {
json.address = this.address;
}
if (this.factorioVersion !== undefined) {
json.factorioVersion = this.address;
json.factorioVersion = this.factorioVersion;
}
return json;
}