Skip to main content

Activate profanity filter for validation

Last updated on November 15, 2024

Introduction

This article walks you through how to activate the profanity filter in your namespace to validate the display names and usernames of your players.

info
  • The profanity filter feature currently only validates the usernames and display names of your players.

Prerequisites

Activate profanity filter for display name validation

  1. In the AGS Admin Portal, go to your game namespace.
  2. On the sidebar menu, click on Game Setup and go to Profanity Filter > Configurations.
  3. On the Configurations page, go to list of services sections
  4. It will shows services have supported profanity filter. Currently we only validates the usernames and display names of your players.
  5. Turn on status toggle.
  6. After activating the Profanity filter toggle, select the database filter that will be used from the Profanity database dropdown. You can choose the database for the profanity filter
    1. Default. See Register and manage default profane words.
    2. Custom filters See Create custom filters. list of services

Activate profanity filter for display name validation

To activate the profanity filter to validate the display names of your players, follow these steps:

  1. In the AGS Admin Portal, select Admin Task > IAM Input Validation on the sidebar menu.
  2. In the Display Name section, turn on the Profanity filter toggle.
  3. After activating the Profanity filter toggle, select the database filter that will be used from the Profanity database dropdown. You can choose the database for the profanity filter
    1. Default AGS database filter. See Register and manage default profane words.
    2. Custom filters See Create custom filters. profanity filter on display name
  1. Click Save.

Activate profanity filter for username validation

To activate the profanity filter to validate the usernames of your players, follow these steps:

  1. In the AGS Admin Portal, select Admin Task > IAM Input Validation on the sidebar menu.

  2. In the Username section, turn on the Profanity filter toggle.

  3. After activating the Profanity filter toggle, select the database filter that will be used from the Profanity database dropdown. You can choose the database for the profanity filter

    1. Default AGS database filter. See Register and manage default profane words.
    2. Custom filters See Create custom filters.

    profanity filter on username

  4. Click Save.

Implement profanity filter with client SDKs

The validate user endpoint is contained inside the user class of the object for both Unreal OSS and SDK.

Validate user input

To enable this endpoint, specify the FUserInputValidationRequest model to put it into the parameter function. AGS has several validations including Username, DisplayName, or UniqueDisplayName. If the response is valid, then it will return true. Otherwise, it will return false with an error message.

FUserInputValidationRequest UserInputValidationRequest{};
UserInputValidationRequest.Username = "badwordsexample";
FUserInputValidationResponse UserInputValidationResponse{};
FRegistry::User.ValidateUserInput(UserInputValidationRequest, THandler<FUserInputValidationResponse>::CreateLambda([&](const FUserInputValidationResponse& Response)
{
UE_LOG(LogAccelByteUserServiceTest, Log, TEXT("Success"));
}), FErrorHandler::CreateLambda([&](int32 ErrorCode, const FString& ErrorMessage)
{
UE_LOG(LogAccelByteUserServiceTest, Warning, TEXT("Error Code: %d, Reason: %s"), ErrorCode, *ErrorMessage);
}));