mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-17 23:33:12 +09:00
Provide controller resources at construction time
Load hosts, instances, mod packs, mods and users before constructing the Controller instances. This allows these resources to be correctly typed as always available and prevents any possibility of save being initiated on these resources before they are loaded.
This commit is contained in:
1 parent
a0b02ee68b
commit
ab52cc35bf
11 files changed
+91
-77
No files matched your search
@@ -47,7 +47,7 @@ export class ControllerPlugin extends BaseControllerPlugin {
|
||||
|
||||
this.controller.app.get("/api/player_auth/servers", (req: Request, res: Response) => {
|
||||
let servers: string[] = [];
|
||||
for (let instance of this.controller.instances!.values()) {
|
||||
for (let instance of this.controller.instances.values()) {
|
||||
if (instance.status === "running" && instance.config.get("player_auth.load_plugin")) {
|
||||
servers.push(instance.config.get("factorio.settings")["name"] as string || "unnamed server");
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user