Add connect to server button to web UI using steam launch api

Does not work if factorio is already open. Resolves #608
This commit is contained in:
Danielv123 committed 2024-12-01 10:32:25 +00:00
1 parent 98a15d3366
commit c5c73c8c96
3 files changed
+36 -22

No files matched your search

+11
View File
@@ -0,0 +1,11 @@
import * as lib from "@clusterio/lib";
export function instancePublicAddress(instance: lib.InstanceDetails, host?: lib.HostDetails | null) {
if (instance.assignedHost === undefined || !host || !host.publicAddress) {
return "";
}
if (instance.gamePort === undefined) {
return host.publicAddress;
}
return `${host.publicAddress}:${instance.gamePort}`;
}