feat(ui): pin failed-tell log-message ids and drop discovery logging
This commit is contained in:
@@ -39,14 +39,6 @@ internal sealed class FailedTellNotifier : IDisposable
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
// DISCOVERY (Task 2 Step 9): while the id set is empty, log every
|
|
||||||
// call so a failed tell can be triggered in-game and its id read.
|
|
||||||
// Remove this block once FailedTellLogMessageIds is pinned.
|
|
||||||
_logger.LogInformation(
|
|
||||||
"ShowLogMessageString id={Id} value={Value}",
|
|
||||||
logMessageId,
|
|
||||||
value is null ? "<null>" : value->ToString());
|
|
||||||
|
|
||||||
if (FailedTellMatcher.ShouldNotify(
|
if (FailedTellMatcher.ShouldNotify(
|
||||||
logMessageId, Plugin.Config.NotifyFailedTell,
|
logMessageId, Plugin.Config.NotifyFailedTell,
|
||||||
FailedTellMatcher.FailedTellLogMessageIds))
|
FailedTellMatcher.FailedTellLogMessageIds))
|
||||||
|
|||||||
@@ -9,12 +9,14 @@ namespace HellionChat._Helpers;
|
|||||||
// TEST-MIRROR: ../../../Hellion Build test/Ui/FailedTellMatcherTests.cs
|
// TEST-MIRROR: ../../../Hellion Build test/Ui/FailedTellMatcherTests.cs
|
||||||
public static class FailedTellMatcher
|
public static class FailedTellMatcher
|
||||||
{
|
{
|
||||||
// Log-message ids the game raises for a tell that could not be delivered.
|
// Log-message ids the game raises for a tell that could not be delivered,
|
||||||
// Pinned from discovery (see plan Task 2, Step 9). An empty set means the
|
// pinned from in-game discovery (plan Task 2). 50 covers an unreachable
|
||||||
// hook never toasts: "no toast over a false toast" until ids are pinned.
|
// recipient (offline, non-existent, or on another world); 3832 is a
|
||||||
|
// recipient inside an instance.
|
||||||
public static readonly IReadOnlySet<uint> FailedTellLogMessageIds = new HashSet<uint>
|
public static readonly IReadOnlySet<uint> FailedTellLogMessageIds = new HashSet<uint>
|
||||||
{
|
{
|
||||||
// pinned in Task 2 Step 9
|
50u,
|
||||||
|
3832u,
|
||||||
};
|
};
|
||||||
|
|
||||||
public static bool ShouldNotify(uint logMessageId, bool notifyEnabled, IReadOnlySet<uint> failedTellIds)
|
public static bool ShouldNotify(uint logMessageId, bool notifyEnabled, IReadOnlySet<uint> failedTellIds)
|
||||||
|
|||||||
Reference in New Issue
Block a user