mirror of
https://github.com/Corfirean/coa-server-manager.git
synced 2026-11-19 03:25:56 +00:00
Merge integrate/manager-0.9.14 into preview: characters kept out while custom races are off
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> # Conflicts: # src/screens/ModulesPage.tsx
This commit is contained in:
commit
59132216f7
13 files changed
+121
No files matched your search
@@ -43,6 +43,8 @@ export {};
|
||||
if(cmd==="plugin:app|version") return "0.8.2";
|
||||
if(cmd==="release_history") throw new Error("Offline demo: using bundled notes");
|
||||
if(cmd==="addons_list"||cmd==="addons_install"||cmd==="addons_remove"){const w=window as any;w.__addons=w.__addons??{dragonui:"old"};if(cmd==="addons_install"){await new Promise(r=>setTimeout(r,700));w.__addons[args.addon]="new";}if(cmd==="addons_remove")delete w.__addons[args.addon];return addonCatalog.addons.map((a:any)=>({id:a.id,name:a.name,description:a.description,author:a.author,license:a.license,needs:a.needs??null,repo:a.repo,size:a.files.reduce((s:number,f:any)=>s+f.size,0),installed:a.id in w.__addons,updateAvailable:w.__addons[a.id]==="old",foreignFolders:a.id==="coacombat"&&!(a.id in w.__addons)?["CoACombat"]:[],bundled:null as string|null})).concat([{id:"coa-dev-menu",name:"CoA Dev Menu",description:{en:"The in-game /dev editor for game masters.",ru:"Внутриигровой редактор /dev для гейм-мастеров. Ставится вместе с клиентским патчем Custom Races V2 и включается вместе с ним."},author:"ilusixn",license:"see repository",needs:null,repo:"https://github.com/ilusixn/ilusixn-dev-menu",size:0,installed:true,updateAvailable:false,foreignFolders:[],bundled:"custom-races"}]);}
|
||||
if(cmd==="custom_race_characters") return {players:2,companionBots:14,squidBots:0};
|
||||
if(cmd==="purge_custom_race_bots"){await new Promise(r=>setTimeout(r,500));return 14;}
|
||||
if(cmd==="restart_schedule"||cmd==="restart_schedule_save"){const w=window as any;w.__sched=w.__sched??{enabled:false,time:"05:00",warningMinutes:5};if(cmd==="restart_schedule_save"){const s=args.schedule;if(s.enabled&&!/^([01]\d|2[0-3]):[0-5]\d$/.test(s.time))throw new Error("The restart time must be HH:MM, for example 05:00.");w.__sched={...s};}return {schedule:w.__sched,supported:true};}
|
||||
if(cmd==="mysql_custom"||cmd==="mysql_custom_save"){const w=window as any;if(cmd==="mysql_custom_save")w.__my=args.text;const text:string=w.__my??"";const applied=text.split("\n").map((l:string)=>l.trim()).filter((l:string)=>l&&!l.startsWith("#")&&!/^(port|datadir|basedir|bind[-_]address)\b/i.test(l)).map((l:string)=>l+"\n").join("");return {text,applied};}
|
||||
if(cmd==="realm_names"||cmd==="realm_rename"){const w=window as any;w.__rn=w.__rn??{};const defs:[number,string][]=[[1,"Conquest of Azeroth"],[2,"Wildcard"]];if(cmd==="realm_rename"){await new Promise(r=>setTimeout(r,300));const n=(args.name??"").trim();if(n.length>32||n.includes('"'))throw new Error("The realm name can have at most 32 characters.");if(n)w.__rn[args.realmId]=n;else delete w.__rn[args.realmId];}return defs.map(([id,d])=>({id,name:w.__rn[id]??d,defaultName:d,custom:id in w.__rn}));}
|
||||
|
||||
@@ -803,6 +803,9 @@ const de: Partial<Record<keyof typeof en, string>> = {
|
||||
"addons.doInstall": "Installieren",
|
||||
"addons.doUpdate": "Aktualisieren",
|
||||
"addons.doRemove": "Entfernen",
|
||||
"races.offCharacters": "Eigene Völker sind aus: {players} Spielerfigur(en) und {bots} Bot(s) eigener Völker bleiben der Welt fern, bis sie wieder an sind (ein Client ohne Patch würde bei ihnen abstürzen).",
|
||||
"races.purgeBots": "{n} Begleiter-Bot(s) eigener Völker löschen",
|
||||
"races.purged": "{n} Bot(s) eigener Völker gelöscht.",
|
||||
"realm.namesTitle": "Realmnamen",
|
||||
"realm.namesHint": "So heißt der Realm in der Realmliste der Spieler. Ein laufender Server zeigt den Namen sofort, und er bleibt nach Updates erhalten.",
|
||||
"realm.nameSave": "Speichern",
|
||||
|
||||
@@ -87,6 +87,9 @@ const en = {
|
||||
"addons.doInstall": "Install",
|
||||
"addons.doUpdate": "Update",
|
||||
"addons.doRemove": "Remove",
|
||||
"races.offCharacters": "Custom races are off: {players} player character(s) and {bots} bot(s) of custom races stay out of the world until they are on again (a game client without the patch would crash on them).",
|
||||
"races.purgeBots": "Delete the {n} companion bot(s) of custom races",
|
||||
"races.purged": "Deleted {n} bot(s) of custom races.",
|
||||
"realm.namesTitle": "Realm names",
|
||||
"realm.namesHint": "The name players see in the realm list. A running server shows it at once, and it stays after updates.",
|
||||
"realm.nameSave": "Save",
|
||||
|
||||
@@ -803,6 +803,9 @@ const es: Partial<Record<keyof typeof en, string>> = {
|
||||
"addons.doInstall": "Instalar",
|
||||
"addons.doUpdate": "Actualizar",
|
||||
"addons.doRemove": "Quitar",
|
||||
"races.offCharacters": "Las razas personalizadas están desactivadas: {players} personaje(s) de jugadores y {bots} bot(s) de esas razas quedan fuera del mundo hasta reactivarlas (un cliente sin el parche se cerraría al verlos).",
|
||||
"races.purgeBots": "Borrar los {n} bot(s) acompañantes de razas personalizadas",
|
||||
"races.purged": "Borrados {n} bot(s) de razas personalizadas.",
|
||||
"realm.namesTitle": "Nombres de los reinos",
|
||||
"realm.namesHint": "El nombre que ven los jugadores en la lista de reinos. Un servidor en marcha lo muestra al instante y se mantiene tras las actualizaciones.",
|
||||
"realm.nameSave": "Guardar",
|
||||
|
||||
@@ -803,6 +803,9 @@ const fr: Partial<Record<keyof typeof en, string>> = {
|
||||
"addons.doInstall": "Installer",
|
||||
"addons.doUpdate": "Mettre à jour",
|
||||
"addons.doRemove": "Supprimer",
|
||||
"races.offCharacters": "Les races personnalisées sont désactivées : {players} personnage(s) de joueurs et {bots} bot(s) de ces races restent hors du monde jusqu'à leur réactivation (un client sans le patch planterait en les voyant).",
|
||||
"races.purgeBots": "Supprimer les {n} bot(s) compagnons de races personnalisées",
|
||||
"races.purged": "{n} bot(s) de races personnalisées supprimé(s).",
|
||||
"realm.namesTitle": "Noms des royaumes",
|
||||
"realm.namesHint": "Le nom que les joueurs voient dans la liste des royaumes. Un serveur en marche l'affiche aussitôt, et il reste après les mises à jour.",
|
||||
"realm.nameSave": "Enregistrer",
|
||||
|
||||
@@ -90,6 +90,9 @@ const ru: Partial<Record<keyof typeof en, string>> = {
|
||||
"addons.doInstall": "Установить",
|
||||
"addons.doUpdate": "Обновить",
|
||||
"addons.doRemove": "Удалить",
|
||||
"races.offCharacters": "Кастомные расы выключены: {players} персонаж(ей) игроков и {bots} бот(ов) кастомных рас не входят в мир, пока расы снова не включены (клиент без патча падал бы при виде их).",
|
||||
"races.purgeBots": "Удалить ботов-компаньонов кастомных рас: {n}",
|
||||
"races.purged": "Удалено ботов кастомных рас: {n}.",
|
||||
"realm.namesTitle": "Названия реалмов",
|
||||
"realm.namesHint": "Так реалм называется в списке реалмов у игроков. Работающий сервер показывает новое название сразу, и оно сохраняется после обновлений.",
|
||||
"realm.nameSave": "Сохранить",
|
||||
|
||||
@@ -88,6 +88,9 @@ const zh = {
|
||||
"addons.doInstall": "安装",
|
||||
"addons.doUpdate": "更新",
|
||||
"addons.doRemove": "移除",
|
||||
"races.offCharacters": "自定义种族已关闭:{players} 个玩家角色和 {bots} 个自定义种族机器人在重新开启前不会进入世界(没有补丁的游戏客户端看到它们会崩溃)。",
|
||||
"races.purgeBots": "删除 {n} 个自定义种族的伙伴机器人",
|
||||
"races.purged": "已删除 {n} 个自定义种族机器人。",
|
||||
"realm.namesTitle": "服务器名称",
|
||||
"realm.namesHint": "玩家在服务器列表中看到的名称。运行中的服务器会立即显示新名称,更新后也会保留。",
|
||||
"realm.nameSave": "保存",
|
||||
|
||||
@@ -64,6 +64,7 @@ export interface StatusView {
|
||||
}
|
||||
|
||||
export type RealmMode = "coa" | "wildcard" | "reborn";
|
||||
export interface CustomRaceCharacters { players: number; companionBots: number; squidBots: number }
|
||||
export interface AddonView { id: string; name: string; description: Record<string, string>; author: string; license: string; needs: string | null; repo: string; size: number; installed: boolean; updateAvailable: boolean; foreignFolders: string[]; bundled?: string | null }
|
||||
export interface RestartSchedule { enabled: boolean; time: string; warningMinutes: number }
|
||||
export interface RestartScheduleView { schedule: RestartSchedule; supported: boolean }
|
||||
@@ -737,6 +738,8 @@ export const api = {
|
||||
realmProfiles: (id: string) => invoke<RealmProfiles>("realm_profiles", { id }),
|
||||
realmSelect: (id: string, mode: RealmMode, restart: boolean) => invoke<RealmProfiles>("realm_select", { id, mode, restart }),
|
||||
realmSimultaneous: (id: string, enabled: boolean) => invoke<RealmProfiles>("realm_simultaneous", { id, enabled }),
|
||||
customRaceCharacters: (id: string) => invoke<CustomRaceCharacters | null>("custom_race_characters", { id }),
|
||||
purgeCustomRaceBots: (id: string) => invoke<number>("purge_custom_race_bots", { id }),
|
||||
addonsList: (id: string) => invoke<AddonView[]>("addons_list", { id }),
|
||||
addonsInstall: (id: string, addon: string) => invoke<AddonView[]>("addons_install", { id, addon }),
|
||||
addonsRemove: (id: string, addon: string) => invoke<AddonView[]>("addons_remove", { id, addon }),
|
||||
|
||||
@@ -41,6 +41,7 @@ import {
|
||||
type CoaCompatibilityStatus,
|
||||
type CompatibilityReport,
|
||||
type CustomRacesClientStatus,
|
||||
type CustomRaceCharacters,
|
||||
type CustomRacesProgress,
|
||||
type InstalledPreviewPlugin,
|
||||
type ModuleSetting,
|
||||
@@ -633,6 +634,9 @@ export function ModulesPage({
|
||||
const [toggling, setToggling] = useState<string | null>(null);
|
||||
const [changed, setChanged] = useState(false);
|
||||
const [racesPatchStatus, setRacesPatchStatus] = useState<CustomRacesClientStatus | null>(null);
|
||||
const [raceChars, setRaceChars] = useState<CustomRaceCharacters | null>(null);
|
||||
const [purging, setPurging] = useState(false);
|
||||
const [purged, setPurged] = useState<number | null>(null);
|
||||
const [racesInstalling, setRacesInstalling] = useState(false);
|
||||
const [racesProgress, setRacesProgress] = useState<CustomRacesProgress | null>(null);
|
||||
const [guard, setGuard] = useState<UnsavedChangesGuard | null>(null);
|
||||
@@ -768,6 +772,7 @@ export function ModulesPage({
|
||||
} catch {
|
||||
// ignore
|
||||
}
|
||||
setRaceChars(await api.customRaceCharacters(serverId).catch(() => null));
|
||||
}, [serverId]);
|
||||
|
||||
const load = useCallback(async () => {
|
||||
@@ -1792,6 +1797,18 @@ export function ModulesPage({
|
||||
</span>
|
||||
</div>
|
||||
|
||||
{modules?.find((x) => x.id === "custom-races")?.enabled === false && raceChars && raceChars.players + raceChars.companionBots + raceChars.squidBots > 0 && (
|
||||
<div className="mb-2 rounded-md border border-warn/40 bg-warn/5 p-2 text-xs" role="status">
|
||||
<p>{t("races.offCharacters", { players: raceChars.players, bots: raceChars.companionBots + raceChars.squidBots })}</p>
|
||||
{raceChars.companionBots > 0 && <Button size="sm" variant="ghost" className="mt-1 h-auto whitespace-normal py-1 text-left" disabled={purging} onClick={() => void (async () => {
|
||||
setPurging(true); setError(null);
|
||||
try { setPurged(await api.purgeCustomRaceBots(serverId)); await loadRacesStatus(); }
|
||||
catch (e) { setError(asUiError(e)); }
|
||||
finally { setPurging(false); }
|
||||
})()}>{purging && <Loader2 className="h-3.5 w-3.5 animate-spin" aria-hidden />}{t("races.purgeBots", { n: raceChars.companionBots })}</Button>}
|
||||
</div>
|
||||
)}
|
||||
{purged !== null && <p className="mb-2 text-xs text-ok" role="status">{t("races.purged", { n: purged })}</p>}
|
||||
{racesInstalling && racesProgress ? (
|
||||
<div className="rounded-lg border border-gold/30 bg-gold/5 p-3">
|
||||
<div className="flex items-center justify-between gap-3 text-xs">
|
||||
|
||||
Reference in new issue
Block a user