From fdfd77df9a894f53cb0439f5c070d8c1550f5885 Mon Sep 17 00:00:00 2001 From: Cooldude2606 <25043174+Cooldude2606@users.noreply.github.com> Date: Sat, 11 Jul 2026 22:46:53 +0100 Subject: [PATCH] Add modal containing details of how to connect to server --- plugins/player_auth/web/index.tsx | 62 +++++++++++++++++++++++++------ 1 file changed, 51 insertions(+), 11 deletions(-) diff --git a/plugins/player_auth/web/index.tsx b/plugins/player_auth/web/index.tsx index 2148d0e1..1c5cd20a 100644 --- a/plugins/player_auth/web/index.tsx +++ b/plugins/player_auth/web/index.tsx @@ -1,7 +1,7 @@ import React, { useEffect, useState } from "react"; import { BaseWebPlugin, notifyErrorHandler } from "@clusterio/web_ui"; -import { Button, Form, Input, Spin, Typography } from "antd"; +import { Alert, Button, Form, Input, Modal, Space, Spin, Typography } from "antd"; import { PlayerAuthServer } from "../messages"; import "./style.css"; @@ -18,6 +18,7 @@ function LoginForm(props: LoginFormProps) { let [playerCodeError, setPlayerCodeError] = useState(null); let [verifyCode, setVerifyCode] = useState(); let [verifyToken, setVerifyToken] = useState(null); + const [connectServer, setConnectServer] = useState<{ name: string, address: string } | null>(null); useEffect(() => { let cancelled = false; @@ -115,6 +116,41 @@ function LoginForm(props: LoginFormProps) { } return <> + setConnectServer(null)} + onOk={() => { + if (!connectServer) { + return; + } + + window.location.href = `steam://run/427520//--mp-connect=${connectServer.address}`; + setConnectServer(null); + }} + > + + + This button launches Factorio through Steam. It only works if + you own and have installed the Steam version of Factorio, and + Factorio is not already running. + + + + If you are using the standalone version, or Factorio is already + running, use the following address with Multiplayer → Connect to address: + + + + {connectServer?.address} + + + Login using your Factorio account is a 3 step process: @@ -127,7 +163,7 @@ function LoginForm(props: LoginFormProps) {
    {servers.map(server => ( -
  • +
  • - + {server.address && ( + + )}
  • ))}