"""Turns client_diff.py's report.json into one self-contained HTML page.""" import html QCLASS = {'Poor': 'q0', 'Common': 'q1', 'Uncommon': 'q2', 'Rare': 'q3', 'Epic': 'q4', 'Legendary': 'q5'} CSS = """ /* Layout: one reading column, a summary ledger up top, then findings grouped by what they mean for players. */ :root { --bg: #f3f4f7; --panel: #ffffff; --ink: #1c2230; --muted: #5c6577; --rule: #d9dde6; --accent: #2f5fa8; --miss: #b4232c; --diff: #a86200; --new: #1d7a55; --q0: #6b6b6b; --q1: #2a2a2a; --q2: #1a7d12; --q3: #0a5bb5; --q4: #8a2fc9; --q5: #c45f00; --display: "Alegreya Sans SC", "Trebuchet MS", sans-serif; --body: "IBM Plex Sans", "Segoe UI", system-ui, sans-serif; --mono: "IBM Plex Mono", ui-monospace, Consolas, monospace; } @media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --bg: #12151c; --panel: #1a1f29; --ink: #e3e7ef; --muted: #98a1b3; --rule: #2d3442; --accent: #7ea6e8; --miss: #ef6b6b; --diff: #e3a54a; --new: #4fc28e; --q0: #9d9d9d; --q1: #e6e6e6; --q2: #3fd43a; --q3: #4a9eff; --q4: #b874f2; --q5: #ff9a3c; color-scheme: dark } } :root[data-theme="dark"] { --bg: #12151c; --panel: #1a1f29; --ink: #e3e7ef; --muted: #98a1b3; --rule: #2d3442; --accent: #7ea6e8; --miss: #ef6b6b; --diff: #e3a54a; --new: #4fc28e; --q0: #9d9d9d; --q1: #e6e6e6; --q2: #3fd43a; --q3: #4a9eff; --q4: #b874f2; --q5: #ff9a3c; color-scheme: dark } body { background: var(--bg); color: var(--ink); font: 15px/1.55 var(--body); } .wrap { max-width: 1080px; margin: 0 auto; padding-block: 28px 64px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); } h1 { font: 600 2.1rem/1.15 var(--display); letter-spacing: .02em; margin: 0; text-wrap: balance; } h2 { font: 600 1.45rem/1.2 var(--display); letter-spacing: .03em; margin: 0; text-wrap: balance; } h3 { font: 600 1.02rem/1.3 var(--body); margin: 0; } p { margin: 0; max-width: 72ch; } a { color: var(--accent); } .meta { color: var(--muted); font-size: .9rem; display: flex; flex-wrap: wrap; gap: 4px 18px; } .mono, td.n, .id { font-family: var(--mono); font-variant-numeric: tabular-nums; } .stack { display: grid; gap: 14px; } header.top { display: grid; gap: 10px; padding-bottom: 22px; border-bottom: 1px solid var(--rule); } .ledger { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin-block: 22px; } .ledger a { text-decoration: none; color: inherit; background: var(--panel); border: 1px solid var(--rule); border-top: 4px solid var(--c); padding: 14px 16px; display: grid; gap: 4px; } .ledger a:hover, .ledger a:focus-visible { border-color: var(--c); outline: none; } .ledger .big { font: 600 2rem/1 var(--mono); color: var(--c); } .ledger .lbl { font: 600 .78rem/1.3 var(--body); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); } .miss { --c: var(--miss); } .diff { --c: var(--diff); } .new { --c: var(--new); } .chg { --c: var(--accent); } .notice { background: var(--panel); border: 1px solid var(--rule); padding: 18px 20px; display: grid; gap: 10px; } .notice ol { margin: 0; padding-left: 1.3em; display: grid; gap: 8px; } .notice li::marker { color: var(--muted); font-family: var(--mono); } section.group { margin-top: 38px; display: grid; gap: 16px; } section.group > .gh { display: grid; gap: 6px; padding-left: 14px; border-left: 4px solid var(--c); } details { background: var(--panel); border: 1px solid var(--rule); } summary { cursor: pointer; padding: 12px 16px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 12px; } summary:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; } summary .cnt { font: 600 .95rem var(--mono); color: var(--c); min-width: 3.5ch; } summary .why { color: var(--muted); font-size: .9rem; flex-basis: 100%; } .body { padding: 0 16px 16px; display: grid; gap: 10px; } .tools { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; } .tools input { font: inherit; padding: 6px 10px; border: 1px solid var(--rule); background: var(--bg); color: var(--ink); min-width: 0; width: 260px; max-width: 100%; } .tools input:focus-visible { outline: 2px solid var(--accent); } .tools .shown { color: var(--muted); font-size: .85rem; } .tbl { overflow-x: auto; max-height: 560px; overflow-y: auto; border: 1px solid var(--rule); } table { border-collapse: collapse; width: 100%; font-size: .86rem; } th { position: sticky; top: 0; background: var(--panel); text-align: left; font-weight: 600; color: var(--muted); border-bottom: 1px solid var(--rule); padding: 6px 10px; white-space: nowrap; } td { border-bottom: 1px solid var(--rule); padding: 5px 10px; vertical-align: top; } td.wide { min-width: 22ch; } .q0 { color: var(--q0); } .q1 { color: var(--q1); } .q2 { color: var(--q2); } .q3 { color: var(--q3); } .q4 { color: var(--q4); } .q5 { color: var(--q5); } .pill { font: 600 .72rem/1 var(--body); letter-spacing: .05em; text-transform: uppercase; padding: 3px 6px; border: 1px solid currentColor; white-space: nowrap; } .foot { margin-top: 40px; color: var(--muted); font-size: .85rem; display: grid; gap: 6px; } code { font-family: var(--mono); font-size: .85em; } @media (max-width: 560px) { h1 { font-size: 1.6rem; } .ledger .big { font-size: 1.6rem; } } """ JS = """ document.querySelectorAll('[data-filter]').forEach(function (inp) { var tb = document.getElementById(inp.dataset.filter), out = inp.parentNode.querySelector('.shown'); inp.addEventListener('input', function () { var q = inp.value.toLowerCase(), n = 0; tb.querySelectorAll('tr').forEach(function (tr) { var hit = !q || tr.textContent.toLowerCase().indexOf(q) >= 0; tr.hidden = !hit; if (hit) n++; }); out.textContent = n + ' shown'; }); }); """ def e(x): return html.escape('' if x is None else str(x)) def link_item(i, name, quality=None): q = QCLASS.get(quality, '') nm = e(name) if name and name != '?' else 'item %d' % i return '%s' % (q, i, nm) def link_spell(i, name): nm = e(name) if name and name != '?' else 'spell %d' % i return '%s' % (i, nm) class Page: def __init__(self): self.n = 0 def table(self, cols, rows, cls): """cols: [(header, fn(row)->html, td class)]""" self.n += 1 tid = 't%d' % self.n head = ''.join('
What the %s client changed since %s, and where our server data (hotfixes, vanilla overrides, loot, ' 'trainers, quests) is missing something, holds a different value, or leaves new client content unused.
' 'The client has it or expects it; players on our server cannot get it.
Our server data replaces what %s says. Some of these are deliberate vanilla choices; under the rule ' '"follow Forever\'s live %s design" they are candidates to drop.
classic_spell_info. Durations the queued 246 changes already '
'clear (%d rows) are not counted. Cooldown means the longer of the spell and category cooldown. '
'%d more rows differ on non-class spells (companions, items, creatures); they are in '
'classic_info_differ.tsv.' % (d.get('pending_duration_rows', 0),
len(d.get('classic_info_differ', [])) - len(info_p)),
P.table([('Spell', lambda r: link_spell(r['id'], r['name']), ''), ('Id', lambda r: r['id'], 'n'),
('Class', lambda r: e(r['cls']), ''), ('Server vs client', lambda r: e(r['changes']), 'wide')],
info_p, 'diff'), True))
g.append(P.finding('diff', 'Mana cost overrides on class spells', len(cost_p),
'From classic_spell_cost, compared with the client power cost.',
P.table([('Spell', lambda r: link_spell(r['id'], r['name']), ''), ('Id', lambda r: r['id'], 'n'),
('Class', lambda r: e(r['cls']), ''), ('Server vs client', lambda r: e(r['changes']), 'wide')],
cost_p, 'diff')))
g.append(P.finding('diff', 'Value overrides that hide a %s change' % new, len(masking),
'A classic_spell_value row sits on a spell effect whose base points, coefficient '
'or aura changed from %s to %s. The server keeps the vanilla number. The full value audit '
'(%d rows) is in audit-70532/overrides-vs-70532.md.' % (e(old), e(new),
d.get('classic_counts', {}).get('classic_spell_value', 0)),
P.table([('Spell', lambda r: link_spell(r['id'], r['name']), ''), ('Id', lambda r: r['id'], 'n'),
('Effect', lambda r: r['effect'], 'n'), ('Class', lambda r: e(r['cls']), ''),
('What %s changed' % new, lambda r: e(r['changes']), 'wide')], masking, 'diff')))
g.append(P.finding('diff', 'Trainer level differs from the client', len(tr_lvl),
'The trainer offers the spell at another level than the client spell level.',
P.table([('Spell', lambda r: link_spell(r['spell'], r['name']), ''), ('Id', lambda r: r['spell'], 'n'),
('Class', lambda r: e(r['cls']), ''), ('Trainer level', lambda r: r['trainer_level'], 'n'),
('Client level', lambda r: r['client_level'], 'n')], tr_lvl, 'diff')))
g.append(P.finding('diff', 'Hotfix rows that differ from the %s record' % new, len(hot_diff),
'Our hotfix database replaces the client record on the server and is sent to the client. These '
'rows come from older sniffs (build %s) and hold different values than %s.' % (
'/'.join(sorted({str(x.get('hotfix_build')) for x in hot_diff})), e(new)),
P.table([('Record', lambda r: e(r.get('what') or '%s %s' % (r.get('name'), r['id'])), 'wide'),
('Hotfix build', lambda r: e(r.get('hotfix_build')), 'n'),
('Client vs server', lambda r: e(r['changes']), 'wide')], hot_diff, 'diff')))
g.append(P.finding('diff', 'Hotfix tables at a glance', len(hot_tbl),
'"Same" rows are harmless copies of the client. "Hotfix only" rows add records the client lacks '
'(most of the Forever items). "Not sent" rows change the server but are not listed in '
'hotfix_data, so the client never hears of them.',
P.table([('Client table', lambda r: e(r['table']), ''), ('Rows', lambda r: r['rows'], 'n'),
('Same', lambda r: r['same'], 'n'), ('Differ', lambda r: r['differ'], 'n'),
('Hotfix only', lambda r: r['hotfix_only'], 'n'), ('Not sent', lambda r: r['not_sent'], 'n'),
('Builds', lambda r: e(', '.join('%s: %s' % kv for kv in r['builds'].items())), 'mono')],
hot_tbl, 'diff')))
g.append('Client content added since %s that no trainer, talent, loot table, vendor or quest on our server hands ' 'out.
What moved between the two client builds. These reach players unless a row above overrides them ' '(the "Our override" column).
Made by tools/client_diff/client_diff.py. Every list is also a TSV '
'next to this page\'s report.json. Item and spell names link to Wowhead Classic for items the game '
'here cannot name.