2 Commits

Author SHA1 Message Date
Horyoshi f38395a95c Fix profsync guild-wide lag, price MC trash, bid on 0 GP items (10.20.5)
profsync: stop expanding skill headers on every read. Expand/CollapseSkillHeader
fire SKILL_LINES_CHANGED, which this addon also listens to, so each read re-armed
its own debounced check -- a permanent 15s cycle that dragged pfQuest's
quest-giver rebuild and Cartographer's addon walk along with it on every guild
member, whether or not they ever opened a profession. Reads are now plain scans
that report whether a collapsed header may have censored them; an expand happens
only where the difference actually matters (a known profession vanishing, the
open window's own rank, /status), and is bracketed by a grace window so our own
echo is ignored. A drop is never announced off an incomplete read.

loot: only skip items with NO price entry. A price of 0 is a known item that just
hasn't been priced yet, and it was silently skipping the bid/trade window.

prices: Molten Core trash belts and bracers 0 -> 67 GP, Boots of Blistering
Flames and Core Forged Helmet 100 -> 67, add Core Forged Greaves.

minep default 300.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-20 16:52:02 +02:00
Horyoshi 879620200e profsync: share which recipes you know with the guild website
Adds one self-contained module. Opening a profession window reports its recipe
list to the guild-chat relay, which forwards it to errorguild.com, so the site
can answer "who can make this". Nothing else in the addon is touched.

It is quiet by design:

* The ONLY trigger is the player opening a profession window, which they have to
  do to use it. There is no automatic scan and there must not be one -- casting
  the profession spell unattended was tried and cannot be made to work: the cast
  answers "Unknown unit." unless self-targeted, three UI addons wrap
  CastSpellByName, and the window it opens reports "UNKNOWN" until its data
  arrives, so an early read publishes a partial list or an empty one.
* Every open after the first costs one integer comparison. A confirmed
  profession whose window still has the same row count cannot have changed, so
  the rows are not walked, nothing is built and nothing is sent.
* Bursts are batched. Buying out a trainer produces one message, not thirty; a
  bare skill-level change is throttled to one per five minutes.
* A count is only believed once two consecutive looks agree on a non-zero
  number, and an empty read is never published -- a report of nothing is a bad
  read, not an empty profession.
* Nothing is written to the SavedVariable until the website acknowledges it, so
  a dropped message means the work is redone later, never a silent hole.
* It prints nothing, ever. /profsync forgets everything so the next open
  re-sends; /profsync status prints a diagnostic dump. Those are the only output.

Traffic goes out on the GUILD addon channel rather than a whisper: four addons
in a normal install ship ChatThrottleLib and every one of them takes three
arguments, with nowhere to put a whisper target.

Recipe ids are sorted, delta-encoded and written as a base-64 varint carrying 5
data bits per character, so a 150-recipe profession fits in two messages. No bit
library is needed, which matters -- vanilla's Lua 5.0 has none.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-09 15:59:31 +02:00