refactor(net): converge live session state reset

This commit is contained in:
Erik 2026-07-21 12:00:48 +02:00
parent 78a9223b65
commit 4f31a5085f
35 changed files with 1460 additions and 83 deletions

View file

@ -62,14 +62,27 @@ public sealed class ChatLog
/// <summary>
/// Push the authoritative local-player GUID from <c>WorldSession</c>.
/// One-way setter — only <c>GameWindow</c> should call it, exactly
/// once per live session. Used by <see cref="OnLocalSpeech"/> to
/// The host sets it after character selection and resets it at session
/// teardown. Used by <see cref="OnLocalSpeech"/> to
/// recognize ACE's HearSpeech echo of our own /say (server's
/// HandleActionTalk broadcasts to all in range INCLUDING the
/// sender) and re-render it as <c>"You say, ..."</c>.
/// </summary>
public void SetLocalPlayerGuid(uint guid) => _localPlayerGuid = guid;
/// <summary>
/// Reset per-session speaker classification and duplicate suppression
/// while preserving the visible transcript. Retail has an explicit
/// <c>ChatInterface::RecvNotice_ClearChatBuffer @ 0x004F2F60</c> path;
/// character-session teardown does not use that clear-buffer notice.
/// </summary>
public void ResetSessionIdentity()
{
_localPlayerGuid = 0u;
_lastSystemText = string.Empty;
_lastSystemAt = DateTime.MinValue;
}
// ── Inbound adapters ─────────────────────────────────────────────────────
/// <summary>Local or ranged HearSpeech (0x02BB / 0x02BC).</summary>

View file

@ -93,6 +93,33 @@ public sealed class TurbineChatState
SocietyRadiantBloodRoom = societyRadiantBloodRoom;
}
/// <summary>
/// Return the server-assigned room table and outbound context sequence to
/// their pre-login values. Room ids and cookies belong to one negotiated
/// character session and must never cross a reconnect boundary.
/// </summary>
/// <remarks>
/// Retail <c>CCommunicationSystem</c> construction at <c>0x005566C0</c>
/// starts Turbine chat disabled; SetTurbineChatChannels (0x0295) supplies
/// rooms per character. Cookie 1 is the Holtburger protocol-reference
/// initial value, with zero reserved for no context.
/// </remarks>
public void Reset()
{
Enabled = false;
AllegianceRoom = 0u;
GeneralRoom = 0u;
TradeRoom = 0u;
LfgRoom = 0u;
RoleplayRoom = 0u;
OlthoiRoom = 0u;
SocietyRoom = 0u;
SocietyCelestialHandRoom = 0u;
SocietyEldrytchWebRoom = 0u;
SocietyRadiantBloodRoom = 0u;
_nextContextId = 1u;
}
/// <summary>
/// Look up the runtime room id for a Turbine
/// <see cref="ChatChannelKindLite"/>. Returns 0 if the channel is not