diff --git a/crates/coa-core/src/modules.rs b/crates/coa-core/src/modules.rs index 1d5b8fa..9e9f76b 100644 --- a/crates/coa-core/src/modules.rs +++ b/crates/coa-core/src/modules.rs @@ -36,7 +36,7 @@ pub struct Entry { #[serde(default = "yes")] pub default_on: bool, /// How far along it is: `early` (experimental, may change or break), `beta` (works, still being tested) or - /// `release` (stable). + /// `release` (stable); `soon` is a place held for a module that is planned but not part of any build yet. #[serde(default = "release")] pub status: String, /// Which icon the page draws (a name the page knows). @@ -286,9 +286,10 @@ mod tests { // it may be empty (modules are added to it one by one); whatever is in it must be complete for e in &c { assert!(e.description.contains_key("en") && e.description.len() == 5, "{} has all five descriptions", e.id); - assert!(e.repo.starts_with("https://github.com/Corfirean/") && e.conf.ends_with(".conf"), "{}", e.id); + assert!(e.repo.starts_with("https://github.com/") && e.conf.ends_with(".conf"), "{}", e.id); assert!(!e.switchable || e.enable_key.ends_with(".Enable"), "{} needs the setting that switches it", e.id); - assert!(["early", "beta", "release"].contains(&e.status.as_str()), "{} has an unknown status", e.id); + assert!(["soon", "early", "beta", "release"].contains(&e.status.as_str()), "{} has an unknown status", e.id); + assert!(e.status != "soon" || !e.switchable, "{} is only announced, so it cannot be switched", e.id); } let mut ids: Vec<_> = c.iter().map(|e| e.id.as_str()).collect(); ids.sort(); diff --git a/modules/catalog.json b/modules/catalog.json index 4c20d74..5581eb4 100644 --- a/modules/catalog.json +++ b/modules/catalog.json @@ -66,6 +66,54 @@ "status": "early", "icon": "wotlk" }, + { + "id": "ah-bot", + "name": "Auction House Bot", + "description": { + "en": "Fills the auction house with realistic, adjustable listings.", + "ru": "Наполняет аукцион реалистичными настраиваемыми лотами.", + "de": "Füllt das Auktionshaus mit realistischen, einstellbaren Angeboten.", + "fr": "Remplit l'hôtel des ventes d'annonces réalistes et réglables.", + "es": "Llena la casa de subastas con ofertas realistas y ajustables." + }, + "repo": "https://github.com/NathanHandley/mod-ah-bot-plus", + "conf": "mod_ahbot.conf", + "switchable": false, + "status": "soon", + "icon": "gavel" + }, + { + "id": "npc-enchanter", + "name": "NPC Enchanter", + "description": { + "en": "An NPC that enchants your gear for you.", + "ru": "НПС, который зачаровывает ваше снаряжение.", + "de": "Ein NPC, der deine Ausrüstung für dich verzaubert.", + "fr": "Un PNJ qui enchante votre équipement pour vous.", + "es": "Un PNJ que encanta tu equipo por ti." + }, + "repo": "https://github.com/azerothcore/mod-npc-enchanter", + "conf": "npc_enchanter.conf", + "switchable": false, + "status": "soon", + "icon": "sparkles" + }, + { + "id": "playerbots", + "name": "Playerbots", + "description": { + "en": "An alternative bot system with random bots and full AI.", + "ru": "Альтернативная система ботов со случайными ботами и полным ИИ.", + "de": "Ein alternatives Bot-System mit Zufalls-Bots und voller KI.", + "fr": "Un système de bots alternatif avec bots aléatoires et IA complète.", + "es": "Un sistema de bots alternativo con bots aleatorios e IA completa." + }, + "repo": "https://github.com/Zyth45/mod-playerbots", + "conf": "playerbots.conf", + "switchable": false, + "status": "soon", + "icon": "swords" + }, { "id": "client-compat", "name": "Client compatibility", diff --git a/src-tauri/src/lib.rs b/src-tauri/src/lib.rs index 1d225dd..ba059f4 100644 --- a/src-tauri/src/lib.rs +++ b/src-tauri/src/lib.rs @@ -1115,7 +1115,9 @@ fn open_link(url: String) -> std::result::Result<(), UiError> { const NEW_ISSUE: &str = "https://github.com/Corfirean/coa-server-manager/issues/new"; let issue = url == NEW_ISSUE || url.starts_with(&format!("{NEW_ISSUE}?")); let chars_ok = url.chars().all(|c| c.is_ascii_alphanumeric() || "/:._-?=#%".contains(c) || (issue && c == '&')); - if !(issue || ALLOWED.iter().any(|p| url.starts_with(p))) || !chars_ok || url.len() > 12_000 { + // the GitHub page of a module that is in the bundled catalog (some are not ours) + let catalog = coa_core::modules::catalog().iter().any(|e| e.repo == url); + if !(issue || catalog || ALLOWED.iter().any(|p| url.starts_with(p))) || !chars_ok || url.len() > 12_000 { return Err(Error::Invalid("That link is not allowed.".into()).into()); } // explorer.exe opens the address in the default browser without going through a shell. diff --git a/src/dev/mock.ts b/src/dev/mock.ts index 6aa058e..dc1ff38 100644 --- a/src/dev/mock.ts +++ b/src/dev/mock.ts @@ -55,7 +55,7 @@ export {}; if(cmd==="realmlist_save"){const w=window as any;const rl=w.__rl;if(args.profileId){const p=rl.profiles.find((x: any)=>x.id===args.profileId);p.name=args.name;p.data=args.data;return p;}if(rl.profiles.some((x: any)=>x.name.toLowerCase()===String(args.name).toLowerCase()))throw {human:{code:"unknown",title:"",message:"",actions:[]},technical:"A realmlist with that name already exists."};const p={id:String(args.name).toLowerCase().replace(/[^a-z0-9]+/g,"-"),name:args.name,data:(/\s/.test(args.data.trim())?args.data.trim():"set realmlist "+args.data.trim())+"\r\n"};rl.profiles.push(p);return p;} 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:"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}]; + 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/NathanHandley/mod-ah-bot-plus",installed:false,enabled:false,switchable:false,status:"soon",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:false,enabled:false,switchable:false,status:"soon",icon:"sparkles",page:null,hidden:false},{id:"playerbots",name:"Playerbots",description:{en:"An alternative bot system with random bots and full AI.",ru:"Альтернативная система ботов со случайными ботами и полным ИИ."},repo:"https://github.com/Zyth45/mod-playerbots",installed:false,enabled:false,switchable:false,status:"soon",icon:"swords",page:null,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}]; if(cmd==="module_set_enabled"){ modState[args.module]=args.enabled; return null; } if(cmd==="all_settings") return [{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||{}); diff --git a/src/i18n/locales/de.ts b/src/i18n/locales/de.ts index f98f010..4d0206f 100644 --- a/src/i18n/locales/de.ts +++ b/src/i18n/locales/de.ts @@ -766,6 +766,8 @@ const de: Partial> = { "col.companions.text": "Deine Reittiere und Begleiter werden dauerhaft gelernt.", "col.riding": "Maximales Reiten ab dem ersten Login", "col.riding.text": "Alle Reitstufen und Kaltwetterflug, schon auf Stufe 1.", + "mod.status.soon": "Bald", + "mod.hint.soon": "Geplant: noch nicht verfügbar.", }; export default de; diff --git a/src/i18n/locales/en.ts b/src/i18n/locales/en.ts index 92063ff..4868c4b 100644 --- a/src/i18n/locales/en.ts +++ b/src/i18n/locales/en.ts @@ -766,6 +766,8 @@ const en = { "col.companions.text": "Mounts and companions you own are learned for good.", "col.riding": "Maximum riding from the first login", "col.riding.text": "All riding ranks and Cold Weather Flying, even at level 1.", + "mod.status.soon": "Soon", + "mod.hint.soon": "Planned: not available yet.", } as const; export default en; diff --git a/src/i18n/locales/es.ts b/src/i18n/locales/es.ts index 66b8f28..4f8c0ed 100644 --- a/src/i18n/locales/es.ts +++ b/src/i18n/locales/es.ts @@ -766,6 +766,8 @@ const es: Partial> = { "col.companions.text": "Tus monturas y mascotas se aprenden para siempre.", "col.riding": "Equitación máxima desde el primer inicio", "col.riding.text": "Todos los rangos de equitación y vuelo en clima frío, desde el nivel 1.", + "mod.status.soon": "Pronto", + "mod.hint.soon": "Previsto: aún no disponible.", }; export default es; diff --git a/src/i18n/locales/fr.ts b/src/i18n/locales/fr.ts index 1a55fc1..dd420f5 100644 --- a/src/i18n/locales/fr.ts +++ b/src/i18n/locales/fr.ts @@ -766,6 +766,8 @@ const fr: Partial> = { "col.companions.text": "Vos montures et compagnons sont appris définitivement.", "col.riding": "Monte maximale dès la première connexion", "col.riding.text": "Tous les rangs de monte et le vol par temps froid, dès le niveau 1.", + "mod.status.soon": "Bientôt", + "mod.hint.soon": "Prévu : pas encore disponible.", }; export default fr; diff --git a/src/i18n/locales/ru.ts b/src/i18n/locales/ru.ts index e7c05d5..8a723f3 100644 --- a/src/i18n/locales/ru.ts +++ b/src/i18n/locales/ru.ts @@ -766,6 +766,8 @@ const ru: Partial> = { "col.companions.text": "Ваши скакуны и спутники изучаются навсегда.", "col.riding": "Максимальная верховая езда с первого входа", "col.riding.text": "Все ранги верховой езды и полёт в холодных краях даже на 1 уровне.", + "mod.status.soon": "Скоро", + "mod.hint.soon": "В планах: пока недоступен.", }; export default ru; diff --git a/src/lib/api.ts b/src/lib/api.ts index 0a36b69..d66a96f 100644 --- a/src/lib/api.ts +++ b/src/lib/api.ts @@ -186,8 +186,8 @@ export interface ModuleView { enabled: boolean; /** can be turned on and off (a part the game client needs is only configured) */ switchable: boolean; - /** early (experimental), beta (still being tested) or release (stable) */ - status: "early" | "beta" | "release"; + /** soon (planned, not available yet), early (experimental), beta (still being tested) or release (stable) */ + status: "soon" | "early" | "beta" | "release"; icon: string; /** a page of the Manager that is hidden while the module is off */ page: string | null; diff --git a/src/screens/ModulesPage.tsx b/src/screens/ModulesPage.tsx index f4363dc..ae6934a 100644 --- a/src/screens/ModulesPage.tsx +++ b/src/screens/ModulesPage.tsx @@ -1,5 +1,5 @@ import { useCallback, useEffect, useState, type ComponentType } from "react"; -import { Bot, Flame, Loader2, Plug, Puzzle, Scaling, Settings2, Snowflake, type LucideProps } from "lucide-react"; +import { Bot, Flame, Gavel, Loader2, Plug, Puzzle, Scaling, Settings2, Snowflake, Sparkles, Swords, type LucideProps } from "lucide-react"; import { api, asUiError, type ModuleSetting, type ModuleView, type UiError } from "@/lib/api"; import { cn } from "@/lib/utils"; import { Button } from "@/components/ui/button"; @@ -22,10 +22,14 @@ const TILES: Record; from: string; to plug: { icon: Plug, from: "from-amber-500", to: "to-orange-700" }, tbc: { icon: Flame, from: "from-lime-500", to: "to-emerald-800" }, wotlk: { icon: Snowflake, from: "from-sky-400", to: "to-blue-700" }, + gavel: { icon: Gavel, from: "from-yellow-500", to: "to-amber-700" }, + sparkles: { icon: Sparkles, from: "from-fuchsia-500", to: "to-purple-700" }, + swords: { icon: Swords, from: "from-rose-500", to: "to-red-800" }, }; const DEFAULT_TILE = { icon: Puzzle, from: "from-slate-500", to: "to-slate-700" }; const STATUS: Record = { + soon: { label: "mod.status.soon", hint: "mod.hint.soon", tone: "border-violet-400/50 bg-violet-400/10 text-violet-300" }, early: { label: "mod.status.early", hint: "mod.hint.early", tone: "border-warn/50 bg-warn/10 text-warn" }, beta: { label: "mod.status.beta", hint: "mod.hint.beta", tone: "border-sky-400/50 bg-sky-400/10 text-sky-300" }, release: { label: "mod.status.release", hint: "mod.hint.release", tone: "border-ok/50 bg-ok/10 text-ok" }, @@ -101,7 +105,7 @@ export function ModulesPage({ serverId, onChanged }: { serverId: string; onChang

{t("mod.intro")}

- {(["early", "beta", "release"] as const).map((s) => ( + {(["soon", "early", "beta", "release"] as const).map((s) => ( {t(STATUS[s].hint)} @@ -116,7 +120,7 @@ export function ModulesPage({ serverId, onChanged }: { serverId: string; onChang {modules === null && !error &&

{t("overview.checking")}

} {modules?.length === 0 && {t("mod.empty")}} {modules?.map((m) => ( - +
@@ -138,7 +142,7 @@ export function ModulesPage({ serverId, onChanged }: { serverId: string; onChang )} {m.installed && !m.switchable && {t("mod.alwaysOn")}} - {!m.installed && {t("mod.notHere")}} + {!m.installed && m.status !== "soon" && {t("mod.notHere")}}