feat(chat): Campaign CH slice CH3 — side-channel membership, wire, and echo parity

Ports retail's SendTurbineChat (@0x0057db10) local pre-send membership gate
so Roleplay/Society/Olthoi stop silently swallowing outbound chat: a new
TurbineChatMembershipGate checks Turbine availability and the player's own
Hear*Chat option before sending, raising "Turbine chat is not available."
or the 0x0551 YouAreNotListeningTo_Channel refusal through the CH2 AddText
chokepoint instead. Wired into both the graphical (LiveSessionCommandRouter)
and headless (DirectGameRuntimeCommandAdapter) send paths so they can't
diverge. Retracts the 26-day-old false "ACE doesn't run a TurbineChat
server" claim from ISSUES.md, the roadmap, and project_chat_pipeline.md —
ACE's TurbineChat implementation is complete and on by default; the real
bug was treating Hear*Chat as a display filter instead of room membership.

Also: implements SetSingleCharacterOption (0x0005), the only wire message
that actually joins/leaves a Turbine room, and wires the five Settings Chat
toggles to it (publish on Save, changed bits only) plus seeds ChatSettings
from the server's own CharacterOptions2 on every PlayerDescription. Fixes
the legacy-channel double-print (Fellow/Vassals/Patron/Monarch/CoVassals
skip the local echo now that ChatChannelInfo.IsSelfEchoChannel is finally
consulted). Routes /a to Turbine unconditionally (retail's @a never falls
back to the legacy bitflag) and adds /ab for the legacy AllegianceBroadcast
verb retail actually has. Surfaces a nonzero TurbineChat ack HResult instead
of discarding it silently. Deletes the malformed, callerless SetCharacterOptions
(0x01A1) and AddChannel/RemoveChannel (0x0145/0x0146) builders.

Files every AC-specific algorithm change cites the named retail decomp
(SendTurbineChat 0x0057db10, StartupTurbineChatSystem 0x0057EFB0,
GameActionSetSingleCharacterOption) plus ACE/holtburger cross-checks.
Register rows AP-181 (no client-side spam throttle) and UN-9 (an
incidentally-discovered CharacterOptions1.Default literal mismatch, not
investigated further) filed per the divergence-register rule.

11,957 passed / 4 skipped / 0 failed (full Release suite, up from the
11,916/4/0 baseline).

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
Erik 2026-08-09 19:39:44 +02:00
parent fc9590e4fc
commit 614a1e055f
35 changed files with 1453 additions and 229 deletions

View file

@ -57,7 +57,15 @@ public sealed record LiveCharacterSessionBindings(
// OnSkillsUpdated's existing shape. Optional/nullable so every existing
// caller (including Headless's OnSkillsUpdated: null pattern) compiles
// unchanged.
Action? OnMovementStatsUpdated = null);
Action? OnMovementStatsUpdated = null,
// Campaign CH slice CH3 (2026-08-09): fires with the raw
// (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.
Action<uint, uint>? OnCharacterOptionsChanged = null);
public sealed record LiveSocialSessionBindings(
ChatLog Chat,
@ -197,7 +205,11 @@ public sealed class LiveSessionEventRouter : ILiveSessionEventRouting
friends: social.Friends,
squelch: social.Squelch,
onDesiredComponents: null,
onCharacterOptions: character.Character.Options.Replace,
onCharacterOptions: (options1, options2) =>
{
character.Character.Options.Replace(options1, options2);
character.OnCharacterOptionsChanged?.Invoke(options1, options2);
},
clientTime: character.ClientTime,
externalContainers: inventory.ExternalContainers,
vendor: inventory.Vendor,
@ -501,19 +513,40 @@ public sealed class LiveSessionEventRouter : ILiveSessionEventRouting
private static void RouteTurbineChat(ChatLog chat, TurbineChat.Parsed parsed)
{
if (parsed.Body is not TurbineChat.Payload.EventSendToRoom message)
return;
switch (parsed.Body)
{
case TurbineChat.Payload.EventSendToRoom message:
// message.RoomId is an opaque per-session Turbine room GUID,
// not a legacy channel bitflag — ChatLog.OnChannelBroadcast's
// default (legacy-bit) LogTextType derivation would
// misclassify it, so the room's own ChatType maps to
// LogTextType explicitly here instead.
chat.OnChannelBroadcast(
message.RoomId,
message.SenderName,
message.Message,
logTextType: TurbineChatDisplayNames.LogTextType(message.ChatType),
channelName: TurbineChatDisplayNames.Resolve(
message.RoomId,
message.ChatType));
return;
// message.RoomId is an opaque per-session Turbine room GUID, not a
// legacy channel bitflag — ChatLog.OnChannelBroadcast's default
// (legacy-bit) LogTextType derivation would misclassify it, so the
// room's own ChatType maps to LogTextType explicitly here instead.
chat.OnChannelBroadcast(
message.RoomId,
message.SenderName,
message.Message,
logTextType: TurbineChatDisplayNames.LogTextType(message.ChatType),
channelName: TurbineChatDisplayNames.Resolve(message.RoomId, message.ChatType));
case TurbineChat.Payload.Response { HResult: not 0 } response:
// CH3 (2026-08-09, research doc §2.7/§6.6): previously
// discarded unconditionally — a server-side send rejection
// was completely invisible. HResult==0 (the overwhelmingly
// common case) stays silent, matching retail's own quiet
// success ack.
chat.OnSystemMessage(
"TurbineChat send rejected "
+ $"(hresult=0x{unchecked((uint)response.HResult):X8}).",
(uint)RetailLogTextType.Default);
return;
default:
// Response with HResult==0, or Unknown — nothing to surface.
return;
}
}
private static void Validate(