feat(protocol2): Town Cryer news-gump integration (§16, Protocol 2.1)
Website news articles now land in the modern Town Cryer News gump
(TownCryerSystem.NewsEntries), separate from the scrolling-crier lines.
Overlay BridgeNews (new): news.add / news.remove insert/remove a
TownCryerNewsEntry directly in the public NewsEntries list (no stock edit),
tracking our own id->entry map so stock uo.com news is left intact. Title,
HTML body, image, and URL are all supported (the stock gumps already branch on
TextDefinition.Number, so string content renders). On add the article title is
also proclaimed via GlobalTownCrierEntryList (announce defaults on; set
announce:false to suppress). Config caps: NewsMaxTitleLength/BodyLength/
External, NewsAnnounceDurationSec.
Sidecar: POST /news (add/replace, id-correlated), DELETE /news/{id}; news table
stores each article as its news.add command; on shard server.hello the sidecar
replays the stored set with announce:false (the shard rebuilds NewsEntries each
boot and does not persist ours, so the website is the source of truth).
Docs: PROTOCOL_2 §16 (design + verified), INTEGRATION.md /news endpoints.
Verified live: sidecar cargo check clean; overlay compiles in the full ServUO
Scripts tree (0 errors); booted shard + sidecar and exercised add/replace/
remove/error paths and the reconnect replay end-to-end.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -482,7 +482,7 @@ Deployed the overlay to the ServUO checkout, booted the shard and the real sidec
|
||||
|
||||
## 16. Town Cryer news — website articles into the news gump (Protocol 2.1)
|
||||
|
||||
**Status:** Design, grounded in the shard's `Scripts/Services/Town Cryer/` files. Not yet built.
|
||||
**Status:** **Built and smoke-tested live** (2026-07-17). `BridgeNews.cs` (pure overlay, no stock edit) + `POST /news` / `DELETE /news/{id}` + reconnect replay. Verified against a booted shard: `news.add` (full + title-only) → `news.ok`, missing title → 400, idempotent replace, `news.remove` → `news.ok`, unknown id → `news.error`, no shard exceptions, and the **reconnect replay** confirmed (after a shard restart the stored article was re-pushed with `announce:false` and re-accepted). The gump rendering itself is verified by source inspection (needs a UO client to view).
|
||||
|
||||
There are **two** distinct town-crier surfaces in ServUO, and 2.0 has so far touched only the first:
|
||||
|
||||
@@ -514,7 +514,7 @@ Everything else in the pasted note stands, and the "this is one of the easier in
|
||||
On an inbound article the bridge does two things on the Core thread:
|
||||
|
||||
1. **News gump** — build `new TownCryerNewsEntry(new TextDefinition(title), new TextDefinition(body), image, null, url)` and `Insert(0, …)` at the top of `TownCryerSystem.NewsEntries`, tracking it in `_ours`; trim `_ours` past the cap by removing the oldest (from both `_ours` and `NewsEntries`).
|
||||
2. **Say the title** — reuse the scrolling-crier path (`GlobalTownCrierEntryList`, as `BridgeTownCrier` does) to announce a single line, the **title only**, for a short duration, so the crier proclaims it in-world. Optional per article (`announce: true`), so silent corrections don't re-proclaim.
|
||||
2. **Say the title** — reuse the scrolling-crier path (`GlobalTownCrierEntryList`, as `BridgeTownCrier` does) to announce a single line, the **title only**, for a short duration, so the crier proclaims it in-world. **On by default**; set `announce: false` on an article to suppress it (e.g. a silent correction that should not re-proclaim).
|
||||
|
||||
### 16.4 Protocol
|
||||
|
||||
@@ -522,7 +522,8 @@ On an inbound article the bridge does two things on the Core thread:
|
||||
// website → sidecar → shard
|
||||
{"kind":"news.add","id":"42","title":"Double XP Weekend",
|
||||
"body":"<CENTER>Double XP Weekend</CENTER><BR><BR>Starts Friday 7PM.",
|
||||
"image":1614,"url":"https://uomysticmoon.com/news/42","announce":true}
|
||||
"image":1614,"url":"https://uomysticmoon.com/news/42"}
|
||||
// announce defaults to true; add "announce":false to suppress the crier proclamation
|
||||
{"kind":"news.remove","id":"42"}
|
||||
```
|
||||
|
||||
|
||||
Reference in New Issue
Block a user