Exemplo n.º 1
0
        private void SendMessageToPlayer(LogLevel parLevel, BasePlayer parPlayer, string parText, params object[] parArguments)
        {
            string formattedAndTranslatedText     = GetFormettedAndTranslatedText(parText, parPlayer?.UserIDString, parArguments);
            LogConfigurationData logConfiguration = GetConfiguration(parPlayer?.UserIDString).LogConfiguration;

            if (parPlayer == null || logConfiguration.NeverLogToPlayer)
            {
                SendMessage(parLevel, GetFormettedAndTranslatedText("OverwriteWithPlayer", parPlayer?.UserIDString, parPlayer?.displayName, formattedAndTranslatedText), parPlayer?.UserIDString);
                return;
            }

            if (logConfiguration.LogLevelToDisplay > parLevel)
            {
                return;
            }

            if (logConfiguration.DoNotDisplayMsgToPlayer.Contains(parText))
            {
                if (logConfiguration.DisplayToConsoleIfPlayerIsNotAllowToSeeMsg)
                {
                    SendMessage(parLevel, GetFormettedAndTranslatedText("OverwriteWithPlayer", parPlayer?.UserIDString, parPlayer?.displayName, formattedAndTranslatedText), parPlayer?.UserIDString);
                }
                return;
            }

            if (logConfiguration.LogToConsoleOverChat)
            {
                PrintToConsole(parPlayer, GetFormettedAndTranslatedText(parLevel.ToString(), parPlayer.UserIDString, formattedAndTranslatedText));
            }
            else
            {
                PrintToChat(parPlayer, GetFormettedAndTranslatedText(parLevel.ToString(), parPlayer.UserIDString, formattedAndTranslatedText));
            }
        }
Exemplo n.º 2
0
 public static ConfigurationData DefaultConfig()
 {
     return(new ConfigurationData
     {
         Name = "Default",
         LogConfiguration = LogConfigurationData.DefaultConfig(),
         PermissionConfiguration = PermissionConfigurationData.DefaultConfig()
     });
 }