RynthSuite as of 2026-12-04 (internal 88a02e2): release 2026.12.4.2
This commit is contained in:
parent
ba4ea691fe
commit
03b9069168
34 changed files with 1206 additions and 28 deletions
|
|
@ -82,17 +82,33 @@ internal static class ChatClassifier
|
|||
/// <summary>
|
||||
/// True for a line a player typed: say, tells both ways, emotes, allegiance, fellowship, every
|
||||
/// channel line, an admin's tell, and a room line of any other type ("[Room] Name says, \"").
|
||||
/// Never plugin output, item info, combat or spell words.
|
||||
/// Never plugin output, item info, combat or spell words, nor a tell from an NPC (0.4.1).
|
||||
/// </summary>
|
||||
internal static bool IsPlayerChat(string channel, int chatType, string? text)
|
||||
{
|
||||
if (channel is Rynth or Items) return false;
|
||||
if (IsNpcTell(chatType, text)) return false;
|
||||
if (channel is Chat or Channels) return true;
|
||||
if (chatType == 0x1F) return true; // AdminTell
|
||||
if (channel == Combat) return false;
|
||||
return LooksLikeSpeech(text);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// True for a tell an NPC sent you (0.4.1, 2026-12-02). The server sends NPC and player tells
|
||||
/// alike (type 0x03); the client links the sender's name only for a player (sender id
|
||||
/// 0x50000001-0x6FFFFFFF, HearDirectSpeech at 0x00572370), so a tell with no link is an NPC's.
|
||||
/// The engine's ChatPlayerText.IsNpcTell has the same rule; keep the two the same.
|
||||
/// </summary>
|
||||
internal static bool IsNpcTell(int chatType, string? text)
|
||||
{
|
||||
if (chatType != 0x03 || string.IsNullOrEmpty(text)) return false;
|
||||
string t = text.TrimStart();
|
||||
if (t.StartsWith("<Tell:", StringComparison.Ordinal)) return false;
|
||||
int at = t.IndexOf(" tells you, \"", StringComparison.Ordinal);
|
||||
return at > 0 && t.IndexOf('"', 0, at) < 0;
|
||||
}
|
||||
|
||||
/// <summary>"[Tag] Name says, \"" / "[Tag] Name tells you, \"" (AC's name links allowed), or "You say ..., \"".</summary>
|
||||
internal static bool LooksLikeSpeech(string? text)
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in a new issue