-
Notifications
You must be signed in to change notification settings - Fork 1
/
README.readme
146 lines (98 loc) · 4.46 KB
/
README.readme
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
# Valheim Plus Chat Filter
![image](https://user-images.githubusercontent.com/6819907/114248375-6c394e00-998f-11eb-8a46-42e213d629aa.png)
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 used here](https://github.com/stephenhaunts/ProfanityDetector/blob/main/ProfanityFilter/ProfanityFilter/ProfanityList.cs).
## 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](https://github.com/valheimPlus/VPlusChatFilter/releases/latest). Extract the files, and place them into the following folder:
> C:\Program Files (x86)\Steam\steamapps\common\Valheim\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
## 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.
## 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
> C:\Program Files (x86)\Steam\steamapps\common\Valheim\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:
```ini
[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 change the file name for the custom add or remove filters using this section:
```ini
[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:
```ini
[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:
```ini
[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.filter```, the 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.
```ini
# 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](https://github.com/stephenhaunts/ProfanityDetector) - Credit to Stephan Haunts for his Profanity Detector library which was used in this mod