Valheim
0 of 0

File information

Last updated

Original upload

Created by

ValheimPlusMods

Uploaded by

Mixone93

Virus scan

Safe to use

Tags for this mod

About this mod

Chat Filter is a *server-side* only HarmonyX mod for Valheim.

This mod filters profanities and censors them in the in game chat.

It censors the words for every one else in the server but the person who wrote the message.

Requirements
Permissions and credits
Changelogs
Donations
Valheim Plus Server Side Chat Filter

Chat Filter is a server-side only HarmonyX mod for Valheim. 
This mod filters profanities and censors them in the in game chat.
Everything is done server side, clients connecting to your server do not need to install this mod.
It censors the words for every one else in the server but the person who wrote the message will still see the profanities used.


Default Profanity Filter

By default the chat filter has a premade list so you can use it out of the box with no configuration. The default list of profanities can be seen in the library we implemented here.

Dependencies

BepInEx - The mod is loaded into Valheim using BepInEx.
It will work on a vanilla server as long as you run BepInEx along side it. 
It should also work along side any other mods, including existing chat mods.

Installation

Download the latest release from here. Extract the files, and place them in the folder:

VALHEIM_ROOT_DIRECTORY\BepInEx\plugins


The above location will be different for you if you have Valheim installed elsewhere.

Your folder structure should then look like this:

* Valheim
* BepInEx
* plugins
* VPlusChatFilter.dll
* Filters


Usage & Configuration

The plugin is controlled via a config file, which is generated when the mod loads for the first time and is located in

VALHEIM_ROOT_DIRECTORY\BepInEx\config

The config file is called

mixone.valheimplus.chatfilter

Config Options

You can change the file name for the custom add or remove filters using this section:

[Filtering]

# Filename where custom words to add are.
# Setting type: String
# Default value: customAdd.filter
CustomWordsFilename = customAdd.filter

# Filename where words to remove from filter are.
# Setting type: String
# Default value: customRemove.filter
RemoveWordsFilename = customRemove.filter


You can enable or disable the custom add or remove filters using this section:

[Filtering.Toggles]

# Add your own custom words.
# Setting type: Boolean
# Default value: false
AddCustomWords = false

# Remove certain words from filters.
# Setting type: Boolean
# Default value: false
RemoveWords = false


You can set what symbol to replace censored words with, enable or disable the filter and also whether to wrap around words here:

[General]

# Symbol to censor words with.
# Setting type: String
# Default value: *
ReplaceKey = *

[General.Toggles]

# Whether or not to filter the chat.
# Setting type: Boolean
# Default value: true
EnableFilter = true

# Whether or not to wrap around words.
# Setting type: Boolean
# Default value: true
WrapWords = true


Adding or Remove Custom Words

If you want to add or remove custom words from the default profanity filter. You can do the following:

  • Make sure you have enabled the option in the config as seen in the above section.
  • Edit the customAdd.filter or customRemove.filterThe format needs to be as seen in the
    template.filter example file. each word needs to be separated by a comma and then a space.

# This file is a template to show how to add words
# Do NOT add anything else other than the words separated by ', '
# Remember to remove these three lines before using this file
word1, word2, word3


Contributing

Pull requests are welcome.
Please make sure to update tests as appropriate.


Credits

https://github.com/stephenhaunts/ProfanityDetector - Credit to Stephan Haunts for his Profanity Detector library which was used in this mod


To-Do

The only feature outstanding is to enable adding or removing words from the chat filter while the server is still live.
Currently to add or remove words from the Chat Filter you need to restart the server.