fix(chat): CH3 review fixes — phantom UN-9, allegiance-broadcast echo, /a legacy fallback

Applies the Opus review of Campaign CH slice CH3 (614a1e05):

- B1: UN-9 was a phantom divergence — ACE's CharacterOptions1.cs:47
  OR-sum is 0x50C4A54A (its own comment confirms 1355064650), identical
  to acdream's literal. The wrong 0x50C48D4A existed only in the research
  doc. Row deleted, register §5 reverted to 4 rows, research doc corrected
  with dated notes.
- S1/S4: AllegianceBroadcast (0x02000000) is a server-echoing channel —
  ACE's GameActionChatChannel handler includes the sender in its real-name
  Allegiance.Members broadcast (retail's DoAllegianceBroadcast has no
  AddTextToScroll), so the client must skip its local optimistic echo, not
  keep it. ChatChannelInfo.Legacy.IsSelfEchoChannel() now returns true for
  it; RouteLegacyChannel's comment corrected; Turbine.IsSelfEchoChannel()'s
  backwards comment rewritten truthfully.
- S3: retail's /a stays on the legacy AllegianceBroadcast bitflag until
  StartupTurbineChatSystem successfully starts Turbine chat — "never
  started" (TurbineChatState.Enabled == false) now falls back to legacy in
  both LiveSessionCommandRouter.RouteChat and
  DirectGameRuntimeCommandAdapter.TrySendChannel, while "enabled but no
  allegiance room" still correctly refuses locally.
- S5: added a LiveSessionEventRouter test proving the Options.Replace ->
  OnCharacterOptionsChanged seeding order, and RuntimeSettingsTargets /
  GameWindowLiveSessionOwnershipTests tests proving the concrete
  ICommandBus.Publish wiring and the single LiveSessionCommandSurface
  construction site.
- S6: AP-181 rewritten to name both of retail's omitted pre-send checks
  (IsMessageSafe silent-drop, then IsMessageSpam) and stop misattributing
  either to RouteLegacyChannel, which has no such gates.
- N1-N7: CharacterOptionId moved below SocialActions so its doc comment
  re-attaches; TurbineChatMembershipGate reuses TurbineChatDisplayNames
  instead of a duplicate table; the gate-to-refusal-text mapping is now
  shared via TurbineChatMembershipGate.ResolveRefusalText instead of
  duplicated in both hosts; ChatSettings.Default now matches ACE's real
  CharacterOptions2.Default (Roleplay/Society start off); a doc-comment
  clarifies only the five Hear toggles are server-backed; the register's
  §3 header recounted 129 -> 128.

Suite: 11,964 passed / 4 skipped / 0 failed (baseline 11,957/4/0 + 7 new
tests). Campaign ledger CH3 review column updated to APPROVE-WITH-FIXES.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
Erik 2026-08-09 20:24:29 +02:00
parent d3f1c21835
commit e07fba5731
21 changed files with 582 additions and 153 deletions

View file

@ -952,6 +952,22 @@ public sealed class DirectGameRuntimeCommandAdapter
RuntimeChatChannel channel,
string text)
{
// S3 (CH3 Opus review): retail's @a stays bound to the legacy
// AllegianceBroadcast bitflag (0x02000000) until
// StartupTurbineChatSystem successfully starts Turbine chat (0x0295
// SetTurbineChatChannels received) and rebinds it to
// DoTurbineChat_Allegiance (research doc §4.3). "Turbine chat never
// started" is NOT the same case as "Turbine is up but this
// character has no allegiance room" (roomId == 0 with Enabled ==
// true), which keeps the "Turbine chat is not available." local
// refusal below at the membership gate's own Unavailable branch.
if (channel == RuntimeChatChannel.Allegiance
&& !_runtime.CommunicationOwner.TurbineChat.Enabled)
{
session.SendChannel(0x02000000u, text);
return true;
}
if (TryMapTurbine(channel, out ChatChannelKindLite turbineKind))
{
// CH3 (2026-08-09): the SAME membership gate the graphical host
@ -964,21 +980,16 @@ public sealed class DirectGameRuntimeCommandAdapter
_runtime.CharacterOwner.Options,
_runtime.CharacterOwner.IsOlthoiPlayer);
switch (gate.Status)
// N3 (CH3 Opus review): shared refusal-text mapping — see
// TurbineChatMembershipGate.ResolveRefusalText.
if (gate.Status != TurbineChatGateStatus.Allowed)
{
case TurbineChatGateStatus.Unavailable:
_runtime.CommunicationOwner.AddText(
ClientTextRefusals.TurbineChatUnavailable,
RetailLogTextType.Default);
return true;
case TurbineChatGateStatus.NotListening:
if (TurbineChatMembershipGate.ResolveRefusalText(gate) is
(string refusalText, RetailLogTextType refusalType))
{
(string? refusal, RetailLogTextType type) =
WeenieErrorMessages.Resolve(0x0551u, gate.DisplayName);
if (refusal is not null)
_runtime.CommunicationOwner.AddText(refusal, type);
return true;
_runtime.CommunicationOwner.AddText(refusalText, refusalType);
}
return true;
}
session.SendTurbineChatTo(

View file

@ -62,9 +62,11 @@ public sealed record LiveCharacterSessionBindings(
// (options1, options2) pair whenever a fresh PlayerDescription lands —
// AFTER Character.Options.Replace has already committed them. Lets the
// graphical host reseed its Settings "Hear * Chat" draft from server
// truth (research doc §5.2/§6.4: the local ChatSettings.Default lies
// relative to ACE's CharacterOptions2.Default). Optional/nullable so
// every existing caller compiles unchanged.
// truth (research doc §5.2/§6.4) so a per-character persisted
// settings.json that diverges from the server (an older save, or a
// changed allegiance/society) always converges back to what ACE
// actually has — the server, not any local default, is authoritative.
// Optional/nullable so every existing caller compiles unchanged.
Action<uint, uint>? OnCharacterOptionsChanged = null);
public sealed record LiveSocialSessionBindings(