From 0a050a40a27269a4cc1d1bf5ccd4472452b35e85 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=94=D0=BC=D0=B8=D1=82=D1=80=D0=B8=D0=B9?= Date: Thu, 8 Oct 2026 07:11:08 +0500 Subject: [PATCH] Add start-after-update options and clarify the always-max-skills setting Co-Authored-By: Claude Sonnet 5.5 --- .../20261008-start-after-update-options.md | 7 +++++ schemas/server.json | 2 +- src/i18n/locales/de.ts | 2 ++ src/i18n/locales/en.ts | 2 ++ src/i18n/locales/es.ts | 2 ++ src/i18n/locales/fr.ts | 2 ++ src/i18n/locales/ru.ts | 2 ++ src/i18n/locales/zh.ts | 2 ++ src/i18n/schema/de.json | 2 +- src/i18n/schema/es.json | 2 +- src/i18n/schema/fr.json | 2 +- src/i18n/schema/ru.json | 2 +- src/i18n/schema/zh.json | 2 +- src/lib/clientJob.ts | 2 ++ src/lib/serverUpdate.ts | 3 ++ src/lib/updatePrefs.ts | 28 +++++++++++++++++++ src/screens/ClientCard.tsx | 8 ++++++ src/screens/SettingsHome.tsx | 6 ++++ 18 files changed, 72 insertions(+), 6 deletions(-) create mode 100644 changelog.d/20261008-start-after-update-options.md create mode 100644 src/lib/updatePrefs.ts diff --git a/changelog.d/20261008-start-after-update-options.md b/changelog.d/20261008-start-after-update-options.md new file mode 100644 index 0000000..10144fa --- /dev/null +++ b/changelog.d/20261008-start-after-update-options.md @@ -0,0 +1,7 @@ +--- +area: manager +type: added +audience: admins +title: Choose whether the server keeps running after an update and whether the game starts after a client update +--- +Settings has a switch for stopping the server again once its update has finished, and the client card has one for starting the game after the client has been updated. diff --git a/schemas/server.json b/schemas/server.json index e0762de..b8bc720 100644 --- a/schemas/server.json +++ b/schemas/server.json @@ -770,7 +770,7 @@ "type": "bool", "category": "gameplay", "title": "Skills always at maximum for level", - "description": "Weapon and other skills are always at their maximum for the character's level, no training needed.", + "description": "Weapon and other skills are always at their maximum for the character's level, no training needed. The Wildcard realm always turns this on for itself.", "default": false, "advanced": false, "restartRequired": "world", diff --git a/src/i18n/locales/de.ts b/src/i18n/locales/de.ts index fa81270..831611a 100644 --- a/src/i18n/locales/de.ts +++ b/src/i18n/locales/de.ts @@ -827,6 +827,8 @@ const de: Partial> = { "set.searchAll": "Alle Einstellungen nach Name oder Beschreibung durchsuchen…", "set.search": "Einstellungen durchsuchen…", "upd.current": "Du bist auf dem neuesten Stand (Version {v}).", + "upd.startAfter": "Server nach dem Update starten (ausschalten, damit er nach dem Update wieder angehalten wird)", + "client.startAfter": "Spiel nach dem Client-Update starten", "bk.folder": "Sicherungsordner", "bk.folderDefault": "Standard", "bk.folderNote": "Neue Sicherungen werden hier gespeichert, zum Beispiel auf einem anderen Laufwerk. Frühere Sicherungen bleiben, wo sie sind, und werden weiter aufgelistet. Der Ordner muss außerhalb des Serverordners liegen.", diff --git a/src/i18n/locales/en.ts b/src/i18n/locales/en.ts index 12f3538..a7aa2d8 100644 --- a/src/i18n/locales/en.ts +++ b/src/i18n/locales/en.ts @@ -850,6 +850,8 @@ const en = { "set.searchAll": "Search all settings by name or description…", "set.search": "Search settings…", "upd.current": "You are up to date (version {v}).", + "upd.startAfter": "Start the server after updating it (turn off to stop it again once the update is done)", + "client.startAfter": "Start the game after the client has been updated", "bk.folder": "Backup folder", "bk.folderDefault": "default", "bk.folderNote": "New backups are saved here, for example on another drive. Backups made earlier stay where they are and are still listed. The folder must be outside the server folder.", diff --git a/src/i18n/locales/es.ts b/src/i18n/locales/es.ts index 656a55f..af95035 100644 --- a/src/i18n/locales/es.ts +++ b/src/i18n/locales/es.ts @@ -827,6 +827,8 @@ const es: Partial> = { "set.searchAll": "Buscar en todos los ajustes por nombre o descripción…", "set.search": "Buscar ajustes…", "upd.current": "Estás al día (versión {v}).", + "upd.startAfter": "Iniciar el servidor tras actualizarlo (desactívalo para detenerlo de nuevo al terminar)", + "client.startAfter": "Iniciar el juego tras actualizar el cliente", "bk.folder": "Carpeta de copias de seguridad", "bk.folderDefault": "predeterminada", "bk.folderNote": "Las copias nuevas se guardan aquí, por ejemplo en otra unidad. Las anteriores se quedan donde están y siguen en la lista. La carpeta debe estar fuera de la carpeta del servidor.", diff --git a/src/i18n/locales/fr.ts b/src/i18n/locales/fr.ts index 13e5d12..c3a7ab3 100644 --- a/src/i18n/locales/fr.ts +++ b/src/i18n/locales/fr.ts @@ -827,6 +827,8 @@ const fr: Partial> = { "set.searchAll": "Rechercher dans tous les réglages par nom ou description…", "set.search": "Rechercher un réglage…", "upd.current": "Vous êtes à jour (version {v}).", + "upd.startAfter": "Démarrer le serveur après la mise à jour (désactivez pour qu’il soit arrêté à nouveau ensuite)", + "client.startAfter": "Lancer le jeu après la mise à jour du client", "bk.folder": "Dossier des sauvegardes", "bk.folderDefault": "par défaut", "bk.folderNote": "Les nouvelles sauvegardes sont enregistrées ici, par exemple sur un autre disque. Les précédentes restent où elles sont et figurent toujours dans la liste. Le dossier doit se trouver hors du dossier du serveur.", diff --git a/src/i18n/locales/ru.ts b/src/i18n/locales/ru.ts index 0880437..a38477c 100644 --- a/src/i18n/locales/ru.ts +++ b/src/i18n/locales/ru.ts @@ -848,6 +848,8 @@ const ru: Partial> = { "set.searchAll": "Поиск по всем настройкам: название или описание…", "set.search": "Поиск по настройкам…", "upd.current": "У вас последняя версия ({v}).", + "upd.startAfter": "Запускать сервер после обновления (выключите, чтобы он снова остановился после обновления)", + "client.startAfter": "Запускать игру после обновления клиента", "bk.folder": "Папка резервных копий", "bk.folderDefault": "по умолчанию", "bk.folderNote": "Новые копии сохраняются сюда, например на другой диск. Прежние копии остаются на месте и по-прежнему в списке. Папка должна быть вне папки сервера.", diff --git a/src/i18n/locales/zh.ts b/src/i18n/locales/zh.ts index 9dc3888..1b88128 100644 --- a/src/i18n/locales/zh.ts +++ b/src/i18n/locales/zh.ts @@ -827,6 +827,8 @@ const zh = { "set.searchAll": "按名称或描述搜索全部设置…", "set.search": "搜索设置…", "upd.current": "当前已是最新版本 ({v})。", + "upd.startAfter": "更新后启动服务器(关闭则更新完成后再次停止)", + "client.startAfter": "更新客户端后启动游戏", "bk.folder": "备份文件夹", "bk.folderDefault": "默认", "bk.folderNote": "新备份将保存在这里,例如另一个驱动器上。之前的备份保留在原处,仍会列出。该文件夹必须位于服务器文件夹之外。", diff --git a/src/i18n/schema/de.json b/src/i18n/schema/de.json index b32e60e..075054e 100644 --- a/src/i18n/schema/de.json +++ b/src/i18n/schema/de.json @@ -525,7 +525,7 @@ }, "AlwaysMaxSkillForLevel": { "t": "Fertigkeiten immer auf Maximum der Stufe", - "d": "Waffen- und andere Fertigkeiten sind immer auf dem Maximum der Charakterstufe, Training ist nicht nötig." + "d": "Waffen- und andere Fertigkeiten sind immer auf dem Maximum der Charakterstufe, Training ist nicht nötig. Der Wildcard-Realm schaltet dies für sich immer ein." }, "ActivateWeather": { "t": "Wetter", diff --git a/src/i18n/schema/es.json b/src/i18n/schema/es.json index dd2c1a4..11dab15 100644 --- a/src/i18n/schema/es.json +++ b/src/i18n/schema/es.json @@ -525,7 +525,7 @@ }, "AlwaysMaxSkillForLevel": { "t": "Habilidades siempre al máximo del nivel", - "d": "Las habilidades de armas y otras están siempre al máximo para el nivel del personaje, sin entrenar." + "d": "Las habilidades de armas y otras están siempre al máximo para el nivel del personaje, sin entrenar. El reino Wildcard lo activa siempre para sí mismo." }, "ActivateWeather": { "t": "Clima", diff --git a/src/i18n/schema/fr.json b/src/i18n/schema/fr.json index 85365d2..b399d7b 100644 --- a/src/i18n/schema/fr.json +++ b/src/i18n/schema/fr.json @@ -525,7 +525,7 @@ }, "AlwaysMaxSkillForLevel": { "t": "Compétences toujours au maximum du niveau", - "d": "Les compétences d'armes et autres sont toujours au maximum du niveau du personnage, sans entraînement." + "d": "Les compétences d'armes et autres sont toujours au maximum du niveau du personnage, sans entraînement. Le royaume Wildcard l’active toujours pour lui-même." }, "ActivateWeather": { "t": "Météo", diff --git a/src/i18n/schema/ru.json b/src/i18n/schema/ru.json index 15fe228..fbd248c 100644 --- a/src/i18n/schema/ru.json +++ b/src/i18n/schema/ru.json @@ -525,7 +525,7 @@ }, "AlwaysMaxSkillForLevel": { "t": "Навыки всегда на максимуме для уровня", - "d": "Навыки оружия и другие навыки всегда на максимуме для уровня персонажа, учиться не нужно." + "d": "Навыки оружия и другие навыки всегда на максимуме для уровня персонажа, учиться не нужно. Реалм Wildcard всегда включает это для себя." }, "ActivateWeather": { "t": "Погода", diff --git a/src/i18n/schema/zh.json b/src/i18n/schema/zh.json index 130548b..c38a478 100644 --- a/src/i18n/schema/zh.json +++ b/src/i18n/schema/zh.json @@ -525,7 +525,7 @@ }, "AlwaysMaxSkillForLevel": { "t": "武器技能自动升满", - "d": "武器及其他熟练度技能自动保持在当前角色等级上限,无需反复练习。" + "d": "武器及其他熟练度技能自动保持在当前角色等级上限,无需反复练习。 Wildcard 领域会始终为自己开启此项。" }, "ActivateWeather": { "t": "天气系统", diff --git a/src/lib/clientJob.ts b/src/lib/clientJob.ts index 9f961f2..3c8393e 100644 --- a/src/lib/clientJob.ts +++ b/src/lib/clientJob.ts @@ -1,3 +1,4 @@ +import { startAfterUpdate } from "./updatePrefs"; import { useSyncExternalStore } from "react"; import { listen } from "@tauri-apps/api/event"; import { api, asUiError, type ClientPlan, type ClientStep, type UiError } from "@/lib/api"; @@ -85,6 +86,7 @@ export async function syncClient(id: string, keepModified: boolean): Promise undefined); void refresh(id); setTimeout(() => { if (get(id).phase === "done") set(id, { phase: "idle" }); diff --git a/src/lib/serverUpdate.ts b/src/lib/serverUpdate.ts index eeab33e..295faf8 100644 --- a/src/lib/serverUpdate.ts +++ b/src/lib/serverUpdate.ts @@ -2,6 +2,7 @@ import { useSyncExternalStore } from "react"; import { listen } from "@tauri-apps/api/event"; import { api, asUiError, type UiError, type UpdatePreview, type UpdateTxn } from "@/lib/api"; import { isUpdateCurrent } from "./serverUpdateStatus"; +import { startAfterUpdate } from "./updatePrefs"; /** * Server update status for the main screen and the navigation: checked when the app starts and every five minutes, @@ -95,6 +96,8 @@ export async function applyServerUpdate(id: string, opts?: { choices: Record undefined); return true; } catch (e) { const ui = asUiError(e); diff --git a/src/lib/updatePrefs.ts b/src/lib/updatePrefs.ts new file mode 100644 index 0000000..0b5950c --- /dev/null +++ b/src/lib/updatePrefs.ts @@ -0,0 +1,28 @@ +import { useState } from "react"; + +/** + * What to do when an update has finished: leave the server running (the default, as the update proves the new build + * starts) or stop it again, and whether to open the game after a client update (off by default). + */ +export type AfterUpdate = "server" | "client"; + +const key = (kind: AfterUpdate, id: string) => `coa-start-after-${kind}-update:${id}`; +const fallback = (kind: AfterUpdate) => kind === "server"; + +export function startAfterUpdate(kind: AfterUpdate, id: string): boolean { + try { + const value = localStorage.getItem(key(kind, id)); + return value === null ? fallback(kind) : value === "1"; + } catch { + return fallback(kind); + } +} + +export function setStartAfterUpdate(kind: AfterUpdate, id: string, on: boolean) { + try { localStorage.setItem(key(kind, id), on ? "1" : "0"); } catch { /* storage unavailable: the default applies */ } +} + +export function useStartAfterUpdate(kind: AfterUpdate, id: string): [boolean, (on: boolean) => void] { + const [on, setOn] = useState(() => startAfterUpdate(kind, id)); + return [on, (next) => { setStartAfterUpdate(kind, id, next); setOn(next); }]; +} diff --git a/src/screens/ClientCard.tsx b/src/screens/ClientCard.tsx index a2c2b7f..4103e6b 100644 --- a/src/screens/ClientCard.tsx +++ b/src/screens/ClientCard.tsx @@ -6,6 +6,7 @@ import { ClientDialog, type ClientDialogMode } from "@/screens/ClientDialog"; import { Button } from "@/components/ui/button"; import { Card } from "@/components/ui/card"; import { useHuman, useT } from "@/i18n"; +import { useStartAfterUpdate } from "@/lib/updatePrefs"; export function ClientCard({ serverId, remote = false }: { serverId: string; remote?: boolean }) { const t = useT(); @@ -16,6 +17,7 @@ export function ClientCard({ serverId, remote = false }: { serverId: string; rem const [busy, setBusy] = useState(false); const [status, setStatus] = useState(null); const [dialog, setDialog] = useState(null); + const [playAfter, setPlayAfter] = useStartAfterUpdate("client", serverId); const refresh = () => { void api.clientStatus(serverId).then(setStatus).catch(() => setStatus(null)); @@ -86,6 +88,12 @@ export function ClientCard({ serverId, remote = false }: { serverId: string; rem
{t("client.otherAddons")}
{t("client.leftAsIs", { n: info.other_addons })}
+ {!remote && ( + + )}
{!remote && !pointsLocal && (