DWC_CheckProfanityAsync

Syntax

#include <dwc.h>
BOOL DWC_CheckProfanityAsync(const u16 **words,
                             int wordsnum,
                             const char *reserved,
                             int timeout,
                             char *result,
                             int *badwordsnum);

Arguments

words Pointer to the string array to check.
  • Use Unicode (little-endian UTF16) for the character code.
    Be sure to convert to Unicode when using another type of character code.
  • Substitute a space in the screen name for any unique characters that are not in Unicode or the IPL font.
  • The terminator must be "\0\0" (0x0000 in u16).
  • The total length of all the strings in the array must not exceed 501 characters (including the string termination character).
  • You cannot specify NULL for a string in the array.
  • After the function call, it is acceptable to destroy the string array and the strings inside the array.
wordsnum Number of elements in the string array specified by words (1 to 50).
reserved Specifies NULL.
timeout The time (in milliseconds) to server response timeout.
(If 0 is specified here, the default value of 10000 is used.)
result Pointer to the storage location for the check result (must be a region of wordsnum bytes).
badwordsnum Pointer to the location of storage for the number of illegal characters included in the check result.

Return Values

TRUE The process of checking for illegal strings has started.
FALSE The process of checking for illegal strings failed to start.

Description

Starts the process of checking for illegal strings. This function always returns FALSE if called during an ongoing illegal string check.

The illegal string check is performed by communicating with the authentication server. The checking process is the same as done by the DWC_LoginAsync function.

In addition to being able to check for individual illegal strings, this function can check multiple strings at once within the following limits:

After calling this function, progress the illegal string check process by calling the DWC_CheckProfanityProcess function approximately every game frame. When the illegal string check completes successfully, the results of the check are stored as an array in result.


The illegal strings that are targets of the check differ from region to region. With the DWC_CheckProfanityAsync function, the target market region is determined by the end of the game code in the ROM registry data. With the DWC_CheckProfanityExAsync function, it is also possible to forcibly set the target to all market regions by specifying A.
Keep in mind that only individual words get checked. The syntax and the sentence structure are not analyzed.

The check results stored in result differ if A is specified for an all-market check.

When "A" is specified for an all-region check:
For each string, a value of "1" for illegal or "0" for all other check results is inserted in the bit field for each region in the same order the strings were assigned to words for checking. result is the logical sum of the following values.

DWC_PROF_REGION_JP 0x01 Illegal in the Japanese market
DWC_PROF_REGION_US 0x02 Illegal in North American market
DWC_PROF_REGION_EU 0x04 Illegal in European market
DWC_PROF_REGION_KR 0x08 Illegal in Korean market
DWC_PROF_REGION_CN 0x10 Illegal in the Chinese market
DWC_PROF_REGION_ALL 0x80 Illegal in some markets.
Note that this value may not always be equivalent to the logical sum of results for each region given above. Results are set even for cases where a string is deemed illegal in some region not yet defined in the library. This specification is designed to take into account the possibility of new regions being added in future on the authentication server side. This bit is also used for values assigned to the badwordsnum argument.

Example:

words[4]={L"goodoword1",L"goodoword2",L"badword",L"goodoword3"}

If in the above group of strings only the third index ("badword") is an illegal string in all regions, the following will result:

result[4]={0,0,0x9f,0}
badwordsnum=1

When "A" is not specified:
A value of "1" for illegal and "0" for all other check results is inserted in the result in the same order the strings were assigned to words for checking.

Example:

words[4]={L"goodoword1",L"goodoword2",L"badword",L"goodoword3"}

If in the above group of strings only the third index ("badword") is an illegal string, the following will result:

result[4]={0,0,1,0}
badwordsnum=1


The following words are registered as illegal strings with the authentication server, in order to test that a string can be checked and determined to be illegal.

See Also

DWC_CheckProfanityProcess DWC_LoginAsync DWC_CheckProfanityExAsync

Revision History

5.3 patch 3
Added information for registered illegal strings
5.3 Patch 1
Fixed the result that indicated illegal characters in the example where A is specified for all regions.
5.1 patch 1
Added support for illegal strings for testing purposes that do not have regional distinctions.
5.1
Added illegal strings for testing for the North American and European regions.

For the change log before 5.1 PR2, click here.  


CONFIDENTIAL