web-next: top de logros por PUNTOS reales + fix logro Nivel 80

- «Top de logros» ahora suma los PUNTOS de logros (no el nº): JOIN a
  acore_world.achievement_points (id→points), poblada desde el DB2 Achievement
  del build 3.4.3.54261 (wago.tools). Columna «Puntos de logros». Seed en
  sql/achievement_points.sql (1912 logros).
- Fix: el logro «Nivel 80» es el id 13 (logros de nivel WotLK van de +10:
  6=Nv10,7=Nv20…12=Nv70,13=Nv80), no el 20. «Primeros del reino» ahora se
  puebla correctamente.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-07-13 13:10:55 +00:00
parent 5d724afb8d
commit 0affbb2ced
3 changed files with 19 additions and 8 deletions
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -97,7 +97,7 @@ export async function PlayersBoard() {
<th>Nombre</th>
<th>Raza</th>
<th>Clase</th>
<th>Logros</th>
<th>Puntos de logros</th>
</tr>
{data.topAch.map((r, i) => (
<tr key={i}>
+10 -7
View File
@@ -45,8 +45,8 @@ export const ALLIANCE_ICON = `${IMG}/nw-icons/alliance-no-border.webp`
export const HORDE_ICON = `${IMG}/nw-icons/horde-no-border.webp`
export const ACH80_ICON = `${IMG}/nw-icons/achievement-level-80.jpg`
// Logro de «Nivel 80» (secuencia estándar de logros de nivel de WotLK: 6=10 … 20=80).
const ACH_LEVEL80 = 20
// Logro «Nivel 80» (logros de nivel WotLK: 6=Nv10, 7=Nv20 … 12=Nv70, 13=Nv80).
const ACH_LEVEL80 = 13
export interface ClassStat { id: number; key: string; total: number; alliance: number; horde: number }
export interface FirstEntry { icon: string; label: string; name: string; classKey: string; date: string }
@@ -115,15 +115,18 @@ export async function getPlayersData(): Promise<PlayersData> {
}
} catch { /* ignore */ }
// 3) Top de logros (nº de logros; los «puntos» no están en la BD del servidor).
// 3) Top de PUNTOS de logros (SUMA de points vía acore_world.achievement_points,
// poblada desde el DB2 Achievement del build 3.4.3).
let topAch: AchRow[] = []
try {
const [rows] = await c.query<RowDataPacket[]>(
`SELECT ch.name AS name, ch.race AS race, ch.class AS class, COUNT(*) AS n
FROM character_achievement ca JOIN characters ch ON ch.guid = ca.guid
GROUP BY ca.guid, ch.name, ch.race, ch.class ORDER BY n DESC LIMIT 10`,
`SELECT ch.name AS name, ch.race AS race, ch.class AS class, SUM(ap.points) AS pts
FROM character_achievement ca
JOIN characters ch ON ch.guid = ca.guid
JOIN acore_world.achievement_points ap ON ap.id = ca.achievement
GROUP BY ca.guid, ch.name, ch.race, ch.class ORDER BY pts DESC LIMIT 10`,
)
topAch = rows.map((r) => ({ name: r.name, race: r.race, class: r.class, classKey: CLASS_INFO[r.class]?.key ?? '', value: Number(r.n) }))
topAch = rows.map((r) => ({ name: r.name, race: r.race, class: r.class, classKey: CLASS_INFO[r.class]?.key ?? '', value: Number(r.pts) }))
} catch { /* ignore */ }
// 4) Top de muertes con honor.