mirror of
https://github.com/Corfirean/coa-server-manager.git
synced 2026-11-24 11:25:56 +00:00
Bot deploy shows the module's refusal; modules update only when the owner asks
- Deploy: a refusal text of the bot module (switched off, rejected, 0 created) is an error, not a started job; the outdated-module message points to the Modules page. - Modules: a module whose build differs from the commit the core recommends shows an Update button. Nothing updates by itself, not even on a core change. Needs the world stopped, merges the module's settings. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
5db6691b8b
commit
e8bf35f95d
16 files changed
+233
-8
No files matched your search
@@ -85,6 +85,7 @@ export {};
|
||||
if(cmd==="realmlist_delete"){const rl=(window as any).__rl;rl.profiles=rl.profiles.filter((x: any)=>x.id!==args.profileId);return null;}
|
||||
if(cmd==="account_delete") return null;
|
||||
if(cmd==="modules_list") return [{id:"companions",name:"CoA Companions",description:{en:"Companion bots for groups, dungeons and your guild.",ru:"Боты-компаньоны для групп, подземелий и гильдии."},repo:"https://github.com/Corfirean/mod-coa-playerbots",installed:true,enabled:modState["companions"],switchable:true,status:"beta",icon:"bot",page:"bots"},{id:"content-scaling",name:"Content Scaling",description:{en:"Scales dungeons and raids to your group, with solo modes.",ru:"Подстраивает подземелья и рейды под вашу группу, есть соло-режимы."},repo:"https://github.com/Corfirean/mod-coa-content-scaling",installed:true,enabled:modState["content-scaling"],switchable:true,status:"early",icon:"scaling",page:null},{id:"tbc-content",name:"TBC Content",description:{en:"Outland dungeons and raids, scaled to your level range.",ru:"Подземелья и рейды Запределья, подогнанные под ваши уровни."},repo:"https://github.com/Corfirean/mod-coa-content-scaling/tree/main/content-packs/mod-coa-tbc-content",installed:true,enabled:modState["tbc-content"],switchable:true,status:"early",icon:"tbc",page:null},{id:"wotlk-content",name:"WotLK Content",description:{en:"Northrend dungeons and raids, scaled to your level range.",ru:"Подземелья и рейды Нордскола, подогнанные под ваши уровни."},repo:"https://github.com/Corfirean/mod-coa-content-scaling/tree/main/content-packs/mod-coa-wotlk-content",installed:true,enabled:modState["wotlk-content"],switchable:true,status:"early",icon:"wotlk",page:null},{id:"ah-bot",name:"Auction House Bot",description:{en:"Fills the auction house with realistic, adjustable listings.",ru:"Наполняет аукцион реалистичными настраиваемыми лотами."},repo:"https://github.com/Corfirean/azerothcore-wotlk-coa",installed:true,enabled:modState["ah-bot"] ?? false,switchable:true,status:"early",icon:"gavel",page:null,hidden:false},{id:"npc-enchanter",name:"NPC Enchanter",description:{en:"An NPC that enchants your gear for you.",ru:"НПС, который зачаровывает ваше снаряжение."},repo:"https://github.com/azerothcore/mod-npc-enchanter",installed:true,enabled:modState["npc-enchanter"],switchable:true,status:"early",icon:"sparkles",page:null,hidden:false},{id:"playerbots",name:"SQUID's Playerbots",description:{en:"An alternative bot system with random bots and full AI.",ru:"Альтернативная система ботов со случайными ботами и полным ИИ."},repo:"https://github.com/Zyth45/mod-playerbots",installed:true,enabled:modState["playerbots"] ?? false,switchable:true,status:"early",icon:"swords",page:"bots",hidden:false},{id:"client-compat",name:"Client compatibility",description:{en:"Client-server link and appearance unlocks.",ru:"Связь клиента с сервером и разблокировка внешних видов."},repo:"https://github.com/Corfirean/azerothcore-wotlk-coa",installed:true,enabled:modState["client-compat"],switchable:false,status:"release",icon:"plug",page:null,hidden:true}, ...moduleCatalog.modules.filter(m => ["time-is-time", "custom-races", "subclass", "dev-menu"].includes(m.id)).map(m => ({...m, installed:true, enabled:modState[m.id] ?? true, switchable:true, page:null, hidden:(m as any).hidden ?? false}))].map(m => ({...m, has_settings: !["tbc-content", "wotlk-content"].includes(m.id), compatibility: realm !== "coa" ? (["companions", "playerbots"].includes(m.id) ? "unsupported" : m.id === "client-compat" ? "compatible" : "experimental") : "compatible", switchable: realm !== "coa" && ["companions", "playerbots"].includes(m.id) ? false : m.switchable}));
|
||||
if(cmd==="module_update"){ return "178a7fde6abe1c3c8813d338073b2c83835da497"; }
|
||||
if(cmd==="module_set_enabled"){ if(args.enabled && ["companions","playerbots"].includes(args.module) && modState[args.module === "companions" ? "playerbots" : "companions"]) throw {human:{code:"bot_modules_conflict",title:"",message:"",actions:[]},technical:"Only one bot system may be enabled."}; modState[args.module]=args.enabled; return null; }
|
||||
if(cmd==="all_settings") return [{key:"Visibility.Distance.Continents",value:"100",default:"90",doc:"Description: Visibility distance on continents. Range: 45-250 Default: 90",changed:true},{key:"Death.SicknessLevel",value:"11",default:"11",doc:"Description: Character level up to which characters get resurrection sickness. Default: 11",changed:false},{key:"Rate.Drop.Item.Epic",value:"3",default:"1",doc:"Description: Drop rates for money and items based on quality. Default: 1",changed:true},{key:"Instance.ResetTimeHour",value:"4",default:"4",doc:"Description: Hour of the day when the global instance reset occurs. Range: 0-23 Default: 4 - (04:00 AM)",changed:false},{key:"PlayerLimit",value:"1000",default:"1000",doc:"Description: Maximum number of players in the world.",changed:false}];
|
||||
if(cmd==="all_settings_save") return Object.keys(args&&args.changes||{});
|
||||
|
||||
@@ -628,7 +628,7 @@ const de: Partial<Record<keyof typeof en, string>> = {
|
||||
"comp.deleteConfirm": "Alle {n} Begleiter endgültig löschen? Zuvor wird ein Wiederherstellungspunkt gespeichert. Deine eigenen Charaktere bleiben unberührt.",
|
||||
"comp.deleteDone": "Alle Begleiter wurden gelöscht. Zuvor wurde ein Wiederherstellungspunkt gespeichert.",
|
||||
"err.companion_command_unsupported.title": "Diese Serverversion kann das noch nicht",
|
||||
"err.companion_command_unsupported.message": "Das Bot-Modul dieses Server-Builds kennt diesen Befehl nicht. Aktualisiere den Server oder starte ihn neu, um Laufendes zu stoppen.",
|
||||
"err.companion_command_unsupported.message": "Das Bot-Modul dieses Servers ist älter als dieser Manager und kennt diesen Befehl nicht. Aktualisiere das Bot-Modul auf der Seite „Module“ (oder den Server) und starte die Welt neu.",
|
||||
|
||||
// Despawn some
|
||||
"comp.despawnSome": "{n} Bots entfernen",
|
||||
@@ -846,6 +846,11 @@ const de: Partial<Record<keyof typeof en, string>> = {
|
||||
"mod.restart": "Änderungen werden nach einem Neustart des Weltservers wirksam.",
|
||||
"mod.switch": "{name} ein- oder ausschalten",
|
||||
"mod.notHere": "Nicht Teil dieses Servers",
|
||||
"mod.update.available": "Neuere Version verfügbar: {from} → {to}.",
|
||||
"mod.update.hint": "Nichts wird von selbst aktualisiert. Der Server muss gestoppt sein; die Einstellungen des Moduls bleiben erhalten.",
|
||||
"mod.update.do": "Aktualisieren",
|
||||
"mod.update.working": "Wird aktualisiert…",
|
||||
"mod.update.done": "Modul {id} auf {commit} aktualisiert. Starte den Server, um es zu nutzen.",
|
||||
"mod.github": "GitHub",
|
||||
"mod.settings": "Einstellungen",
|
||||
"mod.default": "Zurück zum Standard ({v})",
|
||||
|
||||
@@ -750,7 +750,7 @@ const en = {
|
||||
"comp.deleteConfirm": "Delete all {n} companions for good? A recovery point is saved first. Your own characters are not touched.",
|
||||
"comp.deleteDone": "All companions were deleted. A recovery point was saved first.",
|
||||
"err.companion_command_unsupported.title": "This server version can not do that yet",
|
||||
"err.companion_command_unsupported.message": "The bot module of this server build has no such command. Update the server, or restart it to stop what is running.",
|
||||
"err.companion_command_unsupported.message": "The bot module on this server is older than this Manager and does not know this command. Update the bot module on the Modules page (or update the server), then restart the world.",
|
||||
|
||||
// Despawn some
|
||||
"comp.despawnSome": "Despawn {n} bots",
|
||||
@@ -951,6 +951,11 @@ const en = {
|
||||
"mod.restart": "Changes apply after the world server restarts.",
|
||||
"mod.switch": "Turn {name} on or off",
|
||||
"mod.notHere": "Not part of this server",
|
||||
"mod.update.available": "Newer build available: {from} → {to}.",
|
||||
"mod.update.hint": "Nothing updates on its own. The server must be stopped; the module’s settings are kept.",
|
||||
"mod.update.do": "Update",
|
||||
"mod.update.working": "Updating…",
|
||||
"mod.update.done": "Module {id} updated to {commit}. Start the server to use it.",
|
||||
"mod.github": "GitHub",
|
||||
"mod.settings": "Settings",
|
||||
"mod.default": "Back to the default ({v})",
|
||||
|
||||
@@ -628,7 +628,7 @@ const es: Partial<Record<keyof typeof en, string>> = {
|
||||
"comp.deleteConfirm": "¿Eliminar definitivamente los {n} compañeros? Antes se guarda un punto de recuperación. Tus propios personajes no se tocan.",
|
||||
"comp.deleteDone": "Se eliminaron todos los compañeros. Antes se guardó un punto de recuperación.",
|
||||
"err.companion_command_unsupported.title": "Esta versión del servidor aún no puede hacerlo",
|
||||
"err.companion_command_unsupported.message": "El módulo de bots de esta versión del servidor no tiene ese comando. Actualiza el servidor o reinícialo para detener lo que esté en marcha.",
|
||||
"err.companion_command_unsupported.message": "El módulo de bots de este servidor es más antiguo que este Manager y no conoce ese comando. Actualiza el módulo de bots en la página «Módulos» (o el servidor) y reinicia el mundo.",
|
||||
|
||||
// Despawn some
|
||||
"comp.despawnSome": "Retirar {n} bots",
|
||||
@@ -846,6 +846,11 @@ const es: Partial<Record<keyof typeof en, string>> = {
|
||||
"mod.restart": "Los cambios se aplican al reiniciar el servidor del mundo.",
|
||||
"mod.switch": "Activar o desactivar {name}",
|
||||
"mod.notHere": "No forma parte de este servidor",
|
||||
"mod.update.available": "Hay una versión más reciente: {from} → {to}.",
|
||||
"mod.update.hint": "Nada se actualiza solo. El servidor debe estar detenido; los ajustes del módulo se conservan.",
|
||||
"mod.update.do": "Actualizar",
|
||||
"mod.update.working": "Actualizando…",
|
||||
"mod.update.done": "Módulo {id} actualizado a {commit}. Inicia el servidor para usarlo.",
|
||||
"mod.github": "GitHub",
|
||||
"mod.settings": "Ajustes",
|
||||
"mod.default": "Volver al valor por defecto ({v})",
|
||||
|
||||
@@ -628,7 +628,7 @@ const fr: Partial<Record<keyof typeof en, string>> = {
|
||||
"comp.deleteConfirm": "Supprimer définitivement les {n} compagnons ? Un point de restauration est d’abord enregistré. Vos propres personnages ne sont pas touchés.",
|
||||
"comp.deleteDone": "Tous les compagnons ont été supprimés. Un point de restauration a été enregistré d’abord.",
|
||||
"err.companion_command_unsupported.title": "Cette version du serveur ne sait pas encore le faire",
|
||||
"err.companion_command_unsupported.message": "Le module de bots de cette version du serveur n’a pas cette commande. Mettez le serveur à jour ou redémarrez-le pour arrêter ce qui est en cours.",
|
||||
"err.companion_command_unsupported.message": "Le module de bots de ce serveur est plus ancien que ce Manager et ne connaît pas cette commande. Mettez à jour le module de bots dans la page « Modules » (ou le serveur), puis redémarrez le monde.",
|
||||
|
||||
// Despawn some
|
||||
"comp.despawnSome": "Retirer {n} bots",
|
||||
@@ -846,6 +846,11 @@ const fr: Partial<Record<keyof typeof en, string>> = {
|
||||
"mod.restart": "Les changements s’appliquent après le redémarrage du serveur de monde.",
|
||||
"mod.switch": "Activer ou désactiver {name}",
|
||||
"mod.notHere": "Ne fait pas partie de ce serveur",
|
||||
"mod.update.available": "Une version plus récente est disponible : {from} → {to}.",
|
||||
"mod.update.hint": "Rien ne se met à jour tout seul. Le serveur doit être arrêté ; les réglages du module sont conservés.",
|
||||
"mod.update.do": "Mettre à jour",
|
||||
"mod.update.working": "Mise à jour…",
|
||||
"mod.update.done": "Module {id} mis à jour vers {commit}. Démarrez le serveur pour l’utiliser.",
|
||||
"mod.github": "GitHub",
|
||||
"mod.settings": "Réglages",
|
||||
"mod.default": "Revenir à la valeur par défaut ({v})",
|
||||
|
||||
@@ -734,7 +734,7 @@ const ru: Partial<Record<keyof typeof en, string>> = {
|
||||
"comp.deleteConfirm": "Удалить всех компаньонов ({n}) навсегда? Сначала сохраняется точка восстановления. Ваши собственные персонажи не затрагиваются.",
|
||||
"comp.deleteDone": "Все компаньоны удалены. Сначала была сохранена точка восстановления.",
|
||||
"err.companion_command_unsupported.title": "Эта версия сервера пока этого не умеет",
|
||||
"err.companion_command_unsupported.message": "В модуле ботов этой сборки сервера нет такой команды. Обновите сервер или перезапустите его, чтобы остановить текущую работу.",
|
||||
"err.companion_command_unsupported.message": "Модуль ботов на этом сервере старше Менеджера и не знает эту команду. Обновите модуль ботов на странице «Модули» (или обновите сервер) и перезапустите мир.",
|
||||
|
||||
// Despawn some
|
||||
"comp.despawnSome": "Убрать ботов: {n}",
|
||||
@@ -935,6 +935,11 @@ const ru: Partial<Record<keyof typeof en, string>> = {
|
||||
"mod.restart": "Изменения применятся после перезапуска игрового сервера.",
|
||||
"mod.switch": "Включить или выключить {name}",
|
||||
"mod.notHere": "Нет в этом сервере",
|
||||
"mod.update.available": "Доступна новая сборка: {from} → {to}.",
|
||||
"mod.update.hint": "Сами модули не обновляются. Сервер должен быть остановлен; настройки модуля сохраняются.",
|
||||
"mod.update.do": "Обновить",
|
||||
"mod.update.working": "Обновление…",
|
||||
"mod.update.done": "Модуль {id} обновлён до {commit}. Запустите сервер, чтобы он заработал.",
|
||||
"mod.github": "GitHub",
|
||||
"mod.settings": "Настройки",
|
||||
"mod.default": "Вернуть по умолчанию ({v})",
|
||||
|
||||
@@ -690,7 +690,7 @@ const zh = {
|
||||
"comp.deleteConfirm": "是否彻底删除所有 {n} 名随从?系统会先自动保存恢复点。你自己的玩家角色绝不会受影响。",
|
||||
"comp.deleteDone": "所有随从已成功删除。操作前已保存安全恢复点。",
|
||||
"err.companion_command_unsupported.title": "当前服务器核心版本不支持该命令",
|
||||
"err.companion_command_unsupported.message": "当前构建版本的随从模块缺少该指令。请更新服务器,或通过重启服务器来中止当前任务。",
|
||||
"err.companion_command_unsupported.message": "此服务器上的随从模块比当前管理器版本旧,不认识该指令。请在“模块”页面更新随从模块(或更新服务器),然后重启世界服务器。",
|
||||
|
||||
// Despawn some
|
||||
"comp.despawnSome": "减少 {n} 名随从",
|
||||
@@ -846,6 +846,11 @@ const zh = {
|
||||
"mod.restart": "更改将在世界服务器重启后生效。",
|
||||
"mod.switch": "开启或关闭 {name}",
|
||||
"mod.notHere": "未包含在当前服务器中",
|
||||
"mod.update.available": "有更新的版本:{from} → {to}。",
|
||||
"mod.update.hint": "模块不会自动更新。需先停止服务器;模块设置会保留。",
|
||||
"mod.update.do": "更新",
|
||||
"mod.update.working": "正在更新…",
|
||||
"mod.update.done": "模块 {id} 已更新到 {commit}。启动服务器后生效。",
|
||||
"mod.github": "GitHub 页面",
|
||||
"mod.settings": "模块设置",
|
||||
"mod.default": "恢复为默认值 ({v})",
|
||||
|
||||
@@ -260,6 +260,8 @@ export interface ModuleView {
|
||||
component_type?: ComponentType;
|
||||
can_remove?: boolean;
|
||||
source_commit?: string | null;
|
||||
/** a newer build of the module is recommended by the server's core; the owner chooses when to update */
|
||||
available_commit?: string | null;
|
||||
part_of?: string | null;
|
||||
}
|
||||
|
||||
@@ -794,6 +796,7 @@ export const api = {
|
||||
analyzeGithubModule: (url: string, realmId: string) =>
|
||||
invoke<CompatibilityReport>("analyze_github_module", { url, realmId }),
|
||||
moduleSetEnabled: (id: string, module: string, enabled: boolean) => invoke<void>("module_set_enabled", { id, module, enabled }),
|
||||
moduleUpdate: (id: string, module: string) => invoke<string>("module_update", { id, module }),
|
||||
pluginsRepair: (id: string) => invoke<string[]>("plugins_repair", { id }),
|
||||
moduleSettings: (id: string, module: string) => invoke<ModuleSetting[]>("module_settings", { id, module }),
|
||||
moduleSaveSettings: (id: string, module: string, changes: Record<string, string>) => invoke<string[]>("module_save_settings", { id, module, changes }),
|
||||
|
||||
@@ -632,6 +632,8 @@ export function ModulesPage({
|
||||
const [parts, setParts] = useState<ModuleView[]>([]);
|
||||
const toggleLock = useRef(false);
|
||||
const [toggling, setToggling] = useState<string | null>(null);
|
||||
const [updatingModule, setUpdatingModule] = useState<string | null>(null);
|
||||
const [updatedNote, setUpdatedNote] = useState<string | null>(null);
|
||||
const [changed, setChanged] = useState(false);
|
||||
const [racesPatchStatus, setRacesPatchStatus] = useState<CustomRacesClientStatus | null>(null);
|
||||
const [raceChars, setRaceChars] = useState<CustomRaceCharacters | null>(null);
|
||||
@@ -804,6 +806,23 @@ export function ModulesPage({
|
||||
};
|
||||
}, []);
|
||||
|
||||
/** Updates one module to the build this server's core recommends. Only ever started by the owner's click. */
|
||||
async function updateModule(id: string) {
|
||||
setUpdatingModule(id);
|
||||
setUpdatedNote(null);
|
||||
setError(null);
|
||||
try {
|
||||
const commit = await api.moduleUpdate(serverId, id);
|
||||
setUpdatedNote(t("mod.update.done", { id, commit: commit.slice(0, 8) }));
|
||||
await load();
|
||||
onChanged?.();
|
||||
} catch (e) {
|
||||
setError(asUiError(e));
|
||||
} finally {
|
||||
setUpdatingModule(null);
|
||||
}
|
||||
}
|
||||
|
||||
async function installClientPatch() {
|
||||
setRacesInstalling(true);
|
||||
setError(null);
|
||||
@@ -1345,6 +1364,10 @@ export function ModulesPage({
|
||||
</div>
|
||||
)}
|
||||
|
||||
{updatedNote && (
|
||||
<p role="status" className="rounded border border-ok/30 bg-ok/10 p-3 text-xs text-ok">{updatedNote}</p>
|
||||
)}
|
||||
|
||||
{cacheOpen && <BuildCacheDialog serverId={serverId} locale={locale} onClose={() => setCacheOpen(false)} />}
|
||||
|
||||
{/* Build tools: said only when something is missing */}
|
||||
@@ -1690,6 +1713,24 @@ export function ModulesPage({
|
||||
</p>
|
||||
)}
|
||||
|
||||
{m.installed && m.available_commit && (
|
||||
<div className="flex flex-wrap items-center justify-between gap-2 rounded-md border border-gold/30 bg-gold/5 px-3 py-2 text-xs">
|
||||
<span>
|
||||
{t("mod.update.available", { from: (m.source_commit ?? "?").slice(0, 8), to: m.available_commit.slice(0, 8) })}
|
||||
<span className="ml-1 text-muted">{t("mod.update.hint")}</span>
|
||||
</span>
|
||||
<Button
|
||||
size="sm"
|
||||
variant="secondary"
|
||||
disabled={updatingModule !== null || toggling !== null}
|
||||
onClick={() => void updateModule(m.id)}
|
||||
>
|
||||
{updatingModule === m.id && <Loader2 className="mr-1.5 h-3.5 w-3.5 animate-spin" aria-hidden />}
|
||||
{updatingModule === m.id ? t("mod.update.working") : t("mod.update.do")}
|
||||
</Button>
|
||||
</div>
|
||||
)}
|
||||
|
||||
{/* Custom Races Client Patch status badge */}
|
||||
{m.id === "custom-races" && racesPatchStatus && (
|
||||
<div className="text-[11px] text-muted flex items-center gap-1.5">
|
||||
|
||||
Reference in new issue
Block a user