Filter Words Configuration
Apply filtering words configured in the console.
Console Filtering Configuration

- Navigate to Console > Chat > Settings.
- Add words needed for filtering.
- Filter words must be separated by commas.
- Click the Save button.
Method Information
| Method | Description |
|---|---|
| FetchFilterWords() | Fetch filter word list from server |
| Filter(const FString& Message, TCHAR Separator = TEXT('*')) | Apply filter words to message |
Parameters
Filter Method
| Parameter | Type | Description |
|---|---|---|
| Message | FString | Message to filter |
| Separator | TCHAR | Character to replace filter words with (default: '*') |
Code Example
void UMyGame::OnConnected()
{
UE_LOG(LogTemp, Log, TEXT("Chat Connected"));
// Fetch filter words on connection success
AChatManager::GetInstance()->FetchFilterWords();
AChatManager::GetInstance()->Subscribe(TEXT("CH01"));
}
void UMyGame::SendMessage(const FString& Channel, const FString& Message)
{
// Send message with filter words applied
FString FilteredMsg = AChatManager::GetInstance()->Filter(Message);
AChatManager::GetInstance()->SendPublicMessage(Channel, FilteredMsg);
}
void UMyGame::OnPublicMessage(const FChatUserInfo& Sender, const FString& Message)
{
// Apply filter words to received message
FString FilteredMsg = AChatManager::GetInstance()->Filter(Message);
UE_LOG(LogTemp, Log, TEXT("[%s] %s"), *Sender.visitorName, *FilteredMsg);
}
void UMyGame::OnPrivateMessage(const FChatUserInfo& Sender, const FString& Message)
{
// Apply filter words to whisper
FString FilteredMsg = AChatManager::GetInstance()->Filter(Message);
UE_LOG(LogTemp, Log, TEXT("[Whisper from %s] %s"), *Sender.visitorName, *FilteredMsg);
}
void UMyGame::OnNotifyMessage(const FChatUserInfo& Sender, const FString& Message)
{
FString FilteredMsg = AChatManager::GetInstance()->Filter(Message);
UE_LOG(LogTemp, Log, TEXT("[System] %s"), *FilteredMsg);
}