mirror of
https://github.com/DaKerboul/perun.git
synced 2026-08-09 15:55:39 +02:00
Feature: can skipp chat broadcast about broken Perun connection
This commit is contained in:
@@ -17,7 +17,7 @@ PerunConfig.MOTD_L2 = "[Perun] Stats and event data integrated with Perun for DC
|
|||||||
PerunConfig.ConnectionError_L1 = "[Perun] ERROR: Connection broken - contact server admin!" -- (string) Information to send to players when Perun connection is broken
|
PerunConfig.ConnectionError_L1 = "[Perun] ERROR: Connection broken - contact server admin!" -- (string) Information to send to players when Perun connection is broken
|
||||||
|
|
||||||
-- Misc
|
-- Misc
|
||||||
PerunConfig.DontSpamPlayersInCaseOfError = false -- don't spam the game chat with error messages if the connection to Perun does not work
|
PerunConfig.BroadcastPerunErrors = 1 -- (int) [0 (default),1] Value greater than 0 will broadcast chat message about missing connection to Perun
|
||||||
|
|
||||||
-- Debug
|
-- 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
|
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
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ Perun.DebugMode = PerunConfig.DebugMode
|
|||||||
Perun.MOTD_L1 = PerunConfig.MOTD_L1
|
Perun.MOTD_L1 = PerunConfig.MOTD_L1
|
||||||
Perun.MOTD_L2 = PerunConfig.MOTD_L2
|
Perun.MOTD_L2 = PerunConfig.MOTD_L2
|
||||||
Perun.ConnectionError = PerunConfig.ConnectionError_L1
|
Perun.ConnectionError = PerunConfig.ConnectionError_L1
|
||||||
Perun.DontSpamPlayersInCaseOfError = PerunConfig.DontSpamPlayersInCaseOfError
|
Perun.BroadcastPerunErrors = PerunConfig.BroadcastPerunErrors
|
||||||
|
|
||||||
-- Variable init
|
-- Variable init
|
||||||
Perun.Version = "v0.12.0"
|
Perun.Version = "v0.12.0"
|
||||||
@@ -265,7 +265,7 @@ Perun.SendToPerun = function(data_id, data_package)
|
|||||||
Perun.AddLog("ERROR - TCP connection is not available",0)
|
Perun.AddLog("ERROR - TCP connection is not available",0)
|
||||||
|
|
||||||
-- Informs all players that there is Peron error; below hack for DCS net.send_chat not working
|
-- Informs all players that there is Peron error; below hack for DCS net.send_chat not working
|
||||||
if not Perun.DontSpamPlayersInCaseOfError then
|
if Perun.BroadcastPerunErrors > 0 then
|
||||||
local _all_players = net.get_player_list()
|
local _all_players = net.get_player_list()
|
||||||
for PlayerIDIndex, _playerID in ipairs(_all_players) do
|
for PlayerIDIndex, _playerID in ipairs(_all_players) do
|
||||||
net.send_chat_to(Perun.ConnectionError , _playerID)
|
net.send_chat_to(Perun.ConnectionError , _playerID)
|
||||||
|
|||||||
Reference in New Issue
Block a user