feat(rust): RunicNPC profiles, placements, event NPCs and per-profile kills (runicnpc stage 4) #29

Merged
whitlocktech merged 4 commits from feat/runicnpc-stage4 into edge 2026-09-30 19:52:14 +00:00
Showing only changes of commit a5b9bf434f - Show all commits

View File

@@ -221,7 +221,9 @@ async function restore(id) {
if (!existing.replaced) throw new NpcError('this profile is in use already')
const clash = active(await db.listProfiles()).find((p) => p.name === existing.name && existing.servers.some((s) => covers(p, s)))
if (clash) {
throw new NpcError(`the site's profile "${clash.name}" is on ${existing.servers.join(', ')}: change its servers or delete it first`, 409)
const names = new Map((await db.listNpcServers()).map((srv) => [srv.id, srv.name || srv.id]))
const where = existing.servers.map((id) => names.get(id) || id).join(', ')
throw new NpcError(`the site's profile "${clash.name}" is on ${where}: change its servers or delete it first`, 409)
}
await db.saveProfile({ ...existing, replaced: false })
await db.markDirty(existing.servers)