Expand the typed client-command boundary across travel, character queries, local UI and layout controls, AFK and consent, emotes, friends, squelch and filters, and fill-components. Preserve retail packet layouts and queue ownership, import the confirmation dialog, and keep authoritative social state in Core. Co-Authored-By: Codex <codex@openai.com>
35 lines
1 KiB
C#
35 lines
1 KiB
C#
namespace AcDream.Core.Social;
|
|
|
|
/// <summary>Authoritative copy of retail's server-supplied <c>SquelchDB</c>.</summary>
|
|
public sealed class SquelchState
|
|
{
|
|
private readonly object _gate = new();
|
|
private SquelchDatabase _database = SquelchDatabase.Empty;
|
|
|
|
public SquelchDatabase Snapshot()
|
|
{
|
|
lock (_gate) return _database;
|
|
}
|
|
|
|
public void Replace(SquelchDatabase database)
|
|
{
|
|
ArgumentNullException.ThrowIfNull(database);
|
|
lock (_gate) _database = database;
|
|
}
|
|
}
|
|
|
|
public sealed record SquelchInfo(
|
|
string Name,
|
|
bool AccountWide,
|
|
IReadOnlySet<uint> MessageTypes);
|
|
|
|
public sealed record SquelchDatabase(
|
|
IReadOnlyDictionary<string, uint> Accounts,
|
|
IReadOnlyDictionary<uint, SquelchInfo> Characters,
|
|
SquelchInfo Global)
|
|
{
|
|
public static SquelchDatabase Empty { get; } = new(
|
|
new Dictionary<string, uint>(StringComparer.OrdinalIgnoreCase),
|
|
new Dictionary<uint, SquelchInfo>(),
|
|
new SquelchInfo(string.Empty, false, new HashSet<uint>()));
|
|
}
|