refactor: GM + targeting feedback to the string catalog (#73) #127

Merged
marco merged 1 commit from refactor/gm-strings-catalog into main 2026-07-22 07:17:55 +02:00
Owner

Summary

Closes #73 — the last freeform user-facing SystemMessage(string) is gone. GM command feedback and targeting errors are now catalogued cues (SystemMessageId + args); the wording lives only in the client's SystemMessageCatalog (cliloc-style), so game logic holds no presentation copy and it's localization-ready.

  • CommandResult: Feedback / InventoryChanged carry (SystemMessageId Id, string[] Args) instead of a raw string. Every command returns catalogued ids — the dynamic bits (target name, coords, counts, the usage syntax) are passed as args.
  • TargetValidator returns a SystemMessageId?, reusing the existing InvalidTarget / OutOfRange / NoLineOfSight the spell path already reports.
  • GameSessionHandler sends SystemNotice(id, args) for command feedback, the /save outcome, and the "target cancelled" / validator errors — no SystemMessage literals left.
  • 23 new SystemMessageId values + catalog templates; the existing catalog-completeness test enforces every id has a template.

SystemMessage(string) stays as a wire type for any genuinely-dynamic future text, but nothing in game logic emits one now.

Screenshots / recording

No visible change — the on-screen text is identical; only its source moved server→catalog.

How it was tested

  • SystemMessageCatalogTests iterates every SystemMessageId and asserts a template exists — so the 23 new ids are covered.
  • CommandTests / TargetValidatorTests updated to assert the returned SystemMessageId instead of the old strings.
  • Whole solution builds 0 warnings; dotnet test green (340).

Checklist

  • just lint passes (CSharpier + analyzers, zero warnings)
  • just test is green
  • The whole solution builds (client and tools included)
  • Multi-platform preserved
  • Tests added/updated for this change
  • Linked the related issue (#73) and its Definition of Done is met — no SystemMessage(...) user-facing literal remains; TargetValidator reports SystemMessageId; catalog covers every id (test-enforced)
## Summary Closes #73 — the last freeform user-facing `SystemMessage(string)` is gone. GM command feedback and targeting errors are now catalogued cues (`SystemMessageId` + args); the wording lives only in the client's `SystemMessageCatalog` (cliloc-style), so game logic holds no presentation copy and it's localization-ready. - **`CommandResult`:** `Feedback` / `InventoryChanged` carry `(SystemMessageId Id, string[] Args)` instead of a raw string. Every command returns catalogued ids — the dynamic bits (target name, coords, counts, the usage syntax) are passed as args. - **`TargetValidator`** returns a `SystemMessageId?`, reusing the existing `InvalidTarget` / `OutOfRange` / `NoLineOfSight` the spell path already reports. - **`GameSessionHandler`** sends `SystemNotice(id, args)` for command feedback, the `/save` outcome, and the "target cancelled" / validator errors — no `SystemMessage` literals left. - 23 new `SystemMessageId` values + catalog templates; the existing catalog-completeness test enforces every id has a template. `SystemMessage(string)` stays as a wire type for any genuinely-dynamic future text, but nothing in game logic emits one now. ## Screenshots / recording _No visible change — the on-screen text is identical; only its source moved server→catalog._ ## How it was tested - `SystemMessageCatalogTests` iterates every `SystemMessageId` and asserts a template exists — so the 23 new ids are covered. - `CommandTests` / `TargetValidatorTests` updated to assert the returned `SystemMessageId` instead of the old strings. - Whole solution builds 0 warnings; `dotnet test` green (340). ## Checklist - [x] `just lint` passes (CSharpier + analyzers, zero warnings) - [x] `just test` is green - [x] The whole solution builds (client and tools included) - [x] Multi-platform preserved - [x] Tests added/updated for this change - [x] Linked the related issue (#73) and its Definition of Done is met — no `SystemMessage(...)` user-facing literal remains; `TargetValidator` reports `SystemMessageId`; catalog covers every id (test-enforced)
refactor: migrate GM + targeting feedback to the string catalog (#73)
All checks were successful
ci / Lint & Test (pull_request) Successful in 1m49s
c2cf77375c
The last freeform user-facing SystemMessage(string) is gone: GM command feedback
and targeting errors are now catalogued cues (SystemMessageId + args), the wording
living only in the client's SystemMessageCatalog — no presentation copy in game logic.

- CommandResult: Feedback/InventoryChanged now carry (SystemMessageId Id, string[] Args)
  instead of a raw string; every command returns catalogued ids (dynamic bits — target
  name, coords, counts, the usage syntax — passed as args).
- TargetValidator returns a SystemMessageId? (reusing the existing InvalidTarget /
  OutOfRange / NoLineOfSight the spell path already reports).
- GameSessionHandler sends SystemNotice(id, args) for command feedback, the /save
  outcome, and the 'target cancelled'/validator errors — no more SystemMessage literals.
- 23 new SystemMessageId values + catalog templates; the existing catalog-completeness
  test enforces coverage. ProtocolVersion -> 5 (new wire enum values).
marco merged commit cce585e6ae into main 2026-07-22 07:17:55 +02:00
marco deleted branch refactor/gm-strings-catalog 2026-07-22 07:17:55 +02:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
marco/IsoMmo!127
No description provided.