Use a single proxy instead?

This commit is contained in:
Danielv123 committed 2026-01-27 17:02:32 +01:00
1 parent fc0279ad11
commit 15fc41a801
11 files changed
+831 -71

No files matched your search

+16
View File
@@ -24,6 +24,8 @@ export interface ControllerConfigFields {
"controller.metrics_timeout": number;
"controller.system_metrics_interval": number;
"controller.proxy_stream_timeout": number;
"controller.player_proxy_port": number | null;
"controller.player_proxy_default_instance_id": number | null;
"controller.factorio_username": string | null;
"controller.factorio_token": string | null;
"controller.share_factorio_credentials_with_hosts": boolean;
@@ -176,6 +178,20 @@ export class ControllerConfig extends classes.Config<ControllerConfigFields> {
type: "number",
initialValue: 15,
},
"controller.player_proxy_port": {
title: "Player Proxy Port",
description: "UDP port to accept player connections for the controller proxy, set to null to disable.",
restartRequired: true,
type: "number",
optional: true,
initialValue: 34197,
},
"controller.player_proxy_default_instance_id": {
title: "Player Proxy Default Instance",
description: "Instance ID to route players to when no routing history is available.",
type: "number",
optional: true,
},
"controller.factorio_username": {
title: "Factorio Username",
description: "Username to authenticate with Factorio API with.",
@@ -976,3 +976,30 @@ export class InstancePlayerUpdateEvent {
return new this(json.type, json.name, PlayerStats.fromJSON(json.stats), json.reason);
}
}
export class InstancePlayerRouteUpdateEvent {
declare ["constructor"]: typeof InstancePlayerRouteUpdateEvent;
static type = "event" as const;
static src = "instance" as const;
static dst = "controller" as const;
constructor(
public name: string,
public instanceId: number,
public hostId: number,
public gamePort: number,
public timestampMs: number,
) { }
static jsonSchema = Type.Object({
"name": Type.String(),
"instanceId": Type.Integer(),
"hostId": Type.Integer(),
"gamePort": Type.Integer(),
"timestampMs": Type.Number(),
});
static fromJSON(json: Static<typeof this.jsonSchema>) {
return new this(json.name, json.instanceId, json.hostId, json.gamePort, json.timestampMs);
}
}
+1
View File
@@ -92,6 +92,7 @@ export const dataClasses: (RequestClass<unknown, unknown> | EventClass<unknown>)
instance.InstanceAdminlistUpdateEvent,
instance.InstanceWhitelistUpdateEvent,
instance.InstancePlayerUpdateEvent,
instance.InstancePlayerRouteUpdateEvent,
mod.ModPackGetRequest,
mod.ModPackGetDefaultRequest,