Client Anti-Spam

Update time: 2021/09/25 14:34:49

Unity SDK v1.4.0 starts to provide client anti-spam service which requires users to enable and configure anti-spam filtering library at management background of server to support keywords and regular expression. ClassNIM.ToolsAPIprovides an interface for text matching and replacement. If spam filtering is required, call this interface in advance to process the text.

Text replacement

If there are items matched with the target text in library, the replaced character string shall be used and the function will return replaced character string. Name of the words library should be configured on management background.

  • API prototype
csharp/// <summary>
/// Replace matched character string in library
/// </summary>
/// <param name="text">Target text</param>
/// <param name="replace">Replace character string</param>
/// <param name="libName">Library name</param>
/// <returns>Replaced character string</returns>
public static string ReplaceTextMatchedKeywords(string text,string replace,string libName)

Text matching

It checks that there is a mode matched with the target text.

  • API prototype
csharp/// <summary>
/// Whether the character string is matched with the mode in library.
/// </summary>
/// <param name="text">Target text</param>
/// <param name="libName">Library name</param>
/// <returns></returns>
public static bool IsTextMatchedKeywords(string text,string libName)

Settings for sending messages

The messages are added with the property ClientAntiSpamHitting to indicate that sent content is filtered via client anti-spam. If the attribute is set to "true", the sent content will not be forwarded to message receiver after reaching server. If it is set to "false" or null, the attribute is consistent with normal message process.

Was this page helpful?
Yes
No
  • Text replacement
  • Text matching
  • Settings for sending messages