Make chat filter logging configurable (#618)

* Make chat filter logging configurable

Disables chat logging by default, but allows for it to be re-enabled if need be.

* Update ProjectLighthouse.Servers.GameServer/Controllers/MessageController.cs

Co-authored-by: Josh <josh@slendy.pw>

* Update ServerConfiguration.cs

Co-authored-by: Josh <josh@slendy.pw>
This commit is contained in:
Dth455 2023-01-03 20:08:55 -06:00 committed by GitHub
parent 86dff92179
commit 993d14d90a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 2 deletions

View file

@ -120,6 +120,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.";
string username = await this.database.UsernameFromGameToken(token); string username = await this.database.UsernameFromGameToken(token);
if (ServerConfiguration.Instance.LogChatFiltering)
Logger.Info($"{username}: {message} / {scannedText}", LogArea.Filter); Logger.Info($"{username}: {message} / {scannedText}", LogArea.Filter);
return this.Ok(scannedText); return this.Ok(scannedText);

View file

@ -23,7 +23,7 @@ public class ServerConfiguration
// You can use an ObsoleteAttribute instead. Make sure you set it to error, though. // You can use an ObsoleteAttribute instead. Make sure you set it to error, though.
// //
// Thanks for listening~ // Thanks for listening~
public const int CurrentConfigVersion = 15; public const int CurrentConfigVersion = 16;
#region Meta #region Meta
@ -185,6 +185,7 @@ public class ServerConfiguration
public string AnnounceText { get; set; } = "You are now logged in as %user (id: %id)."; public string AnnounceText { get; set; } = "You are now logged in as %user (id: %id).";
#endif #endif
public bool CheckForUnsafeFiles { get; set; } = true; public bool CheckForUnsafeFiles { get; set; } = true;
public bool LogChatFiltering { get; set; } = false;
public FilterMode UserInputFilterMode { get; set; } = FilterMode.None; public FilterMode UserInputFilterMode { get; set; } = FilterMode.None;