Made chat message recording optional (PerunConfig.RecordChatMessages in the configuration file)

This commit is contained in:
David Pierron
2021-06-28 13:05:02 +02:00
parent 4bea05e7a2
commit 3cbbcd023f
2 changed files with 3 additions and 1 deletions

View File

@@ -18,6 +18,7 @@ PerunConfig.ConnectionError_L1 = "[Perun] ERROR: Connection broken - contact ser
-- Misc
PerunConfig.BroadcastPerunErrors = 1 -- (int) [0 (default),1] Value greater than 0 will broadcast chat message about missing connection to Perun
PerunConfig.RecordChatMessages = 1
-- Debug
PerunConfig.DebugMode = 1 -- (int) [0 (default),1,2] Value greater than 0 will display Perun information in DCS log file, values: 1 - minimal verbose, 2 - all log information will be logged

View File

@@ -24,6 +24,7 @@ Perun.MOTD_L1 = PerunConfig.MOTD_L1
Perun.MOTD_L2 = PerunConfig.MOTD_L2
Perun.ConnectionError = PerunConfig.ConnectionError_L1
Perun.BroadcastPerunErrors = PerunConfig.BroadcastPerunErrors
Perun.RecordChatMessages = PerunConfig.RecordChatMessages
-- Variable init
Perun.Version = "v0.12.1"
@@ -706,7 +707,7 @@ end
Perun.onPlayerTrySendChat = function (playerID, msg, all)
-- Somebody tries to send chat message
if msg~=Perun.MOTD_L1 and msg~=Perun.MOTD_L2 and msg~=Perun.ConnectionError then
if Perun.RecordChatMessages and msg~=Perun.MOTD_L1 and msg~=Perun.MOTD_L2 and msg~=Perun.ConnectionError then
Perun.LogChat(playerID,msg,all)
end