Иконка ресурса

FREE IQChat : 2.72.61 2.72.61

Нет прав для скачивания
C#:
using System;
using System.Collections;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using CompanionServer;
using ConVar;
using Facepunch;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using Oxide.Core;
using Oxide.Core.Libraries;
using Oxide.Core.Libraries.Covalence;
using Oxide.Core.Plugins;
using Oxide.Game.Rust.Cui;
using UnityEngine;
using UnityEngine.Networking;
using Object = System.Object;
using Pool = Facepunch.Pool;
namespace Oxide.Plugins {
    [Info("IQChat", "Mercury", "2.72.61")]
    [Description("The most pleasant chat for your server from the IQ system")]
    class IQChat : RustPlugin {
#region Reference
        [PluginReference]
        Plugin ImageLibrary, IQStaff, IQFakeActive, IQRankSystem, XLevels, Clans, XPrison, TranslationAPI, RustApp, SkillTree, PlayerRanks;
#region Clans
        private String GetClanTag(BasePlayer player) {
            if (!Clans) return String.Empty;
            if (!config.ReferenceSetting.ClansSettings.UseClanTag) return String.Empty;
            String ClanTag = (String)Clans?.CallHook("GetClanOf", player.userID.Get());
            if(String.IsNullOrWhiteSpace(ClanTag)) return String.Empty;
            String tagClan = GetLang("CLANS_SYNTAX_PREFIX", player.UserIDString, ClanTag);
            Object resultColorMessage = IsGradientColorValue(config.ReferenceSetting.ClansSettings.colorTag);
            if (resultColorMessage is List<String> gradientColors) tagClan = ApplyGradientToText(tagClan, gradientColors);
            else tagClan = $"<color={config.ReferenceSetting.ClansSettings.colorTag}>{tagClan}</color>";
            return tagClan;
        }
#endregion
#region PlayerRanks
        private String PlayerRanks_GetRanks(BasePlayer player) {
            if (!PlayerRanks || !config.ReferenceSetting.playerRanksSettings.UsePlayerRanks) return String.Empty;
            String pRank = PlayerRanks.Call<String>("GetPlayerTitle", player.IPlayer);
            Object resultColorMessage = IsGradientColorValue(config.ReferenceSetting.playerRanksSettings.colorTag);
            if (resultColorMessage is List<String> gradientColors) pRank = ApplyGradientToText(pRank, gradientColors);
            else pRank = $"<color={config.ReferenceSetting.playerRanksSettings.colorTag}>{pRank}</color>";
            return pRank;
        }
#endregion
#region Skill Tree
        private String GetPrestigeLevel(BasePlayer player) {
            if (!config.ReferenceSetting.skillTreeSettings.UsePrestigeSkillTree || !SkillTree) return String.Empty;
            Object prestige = SkillTree.Call("GetPrestigeLevel", player.userID.Get());
            if(prestige == null) return String.Empty;
            Int32 levelPrestige = (Int32)prestige;
            String prestigeResult = GetLang("SKILLTREE_SYNTAX_PRESTIGE_LEVEL", player.UserIDString, levelPrestige);
            Object resultColorMessage = IsGradientColorValue(config.ReferenceSetting.skillTreeSettings.colorTag);
            if (resultColorMessage is List<String> gradientColors) prestigeResult = ApplyGradientToText(prestigeResult, gradientColors);
            else prestigeResult = $"<color={config.ReferenceSetting.skillTreeSettings.colorTag}>{prestigeResult}</color>";
            return prestigeResult;
        }
        private String SkillTree_GetLevel(BasePlayer player) {
            String[] infoSkills = GetInfoSkillTree(player);
            if(infoSkills == null) return String.Empty;
            String levelSkillTree = GetLang("SKILLTREE_SYNTAX_LEVEL", player.UserIDString, infoSkills.First());
            Object resultColorMessage = IsGradientColorValue(config.ReferenceSetting.skillTreeSettings.colorTag);
            if (resultColorMessage is List<String> gradientColors) levelSkillTree = ApplyGradientToText(levelSkillTree, gradientColors);
            else levelSkillTree = $"<color={config.ReferenceSetting.skillTreeSettings.colorTag}>{levelSkillTree}</color>";
            return levelSkillTree;
        }
        private String SkillTree_GetXP(BasePlayer player) {
            String[] infoSkills = GetInfoSkillTree(player);
            if(infoSkills == null) return String.Empty;
            String xpSkillTree = GetLang("SKILLTREE_SYNTAX_XP", player.UserIDString, infoSkills.Last());
            Object resultColorMessage = IsGradientColorValue(config.ReferenceSetting.skillTreeSettings.colorTag);
            if (resultColorMessage is List<String> gradientColors) xpSkillTree = ApplyGradientToText(xpSkillTree, gradientColors);
            else xpSkillTree = $"<color={config.ReferenceSetting.skillTreeSettings.colorTag}>{xpSkillTree}</color>";
            return xpSkillTree;
        }
        private String[] GetInfoSkillTree(BasePlayer player) {
            if (!SkillTree || !config.ReferenceSetting.skillTreeSettings.UseSkillTree) return null;
            return (String[])SkillTree.Call("ST_GetPlayerLevel", player);
        }
#endregion
#region XLevels
        private String XLevel_GetLevel(BasePlayer player) {
            if (!XLevels || !config.ReferenceSetting.XLevelsSettings.UseXLevels) return String.Empty;
            String level = GetLang("XLEVELS_SYNTAX_PREFIX", player.UserIDString, (Int32)XLevels?.CallHook("API_GetLevel", player));
            Object resultColorMessage = IsGradientColorValue(config.ReferenceSetting.XLevelsSettings.colorTag);
            if (resultColorMessage is List<String> gradientColors) level = ApplyGradientToText(level, gradientColors);
            else level = $"<color={config.ReferenceSetting.XLevelsSettings.colorTag}>{level}</color>";
            return level;
        }
        private String XLevel_GetPrefix(BasePlayer player) {
            if (!XLevels || !config.ReferenceSetting.XLevelsSettings.UseXLevels) return String.Empty;
            String xLevelPrefix = (String)XLevels?.CallHook("API_GetPlayerPrefix", player);
            Object resultColorMessage = IsGradientColorValue(config.ReferenceSetting.XLevelsSettings.colorTag);
            if (resultColorMessage is List<String> gradientColors) xLevelPrefix = ApplyGradientToText(xLevelPrefix, gradientColors);
            else xLevelPrefix = $"<color={config.ReferenceSetting.XLevelsSettings.colorTag}>{xLevelPrefix}</color>";
            return xLevelPrefix;
        }
#endregion
#region IQFakeActive
        public class FakePlayer {
            [JsonProperty("userId")]
            public String userId;
            [JsonProperty("displayName")]
            public String displayName;
            public Boolean isMuted;
        }
        public Boolean IsReadyIQFakeActive() {
            if (IQFakeActive != null && config.ReferenceSetting.IQFakeActiveSettings.UseIQFakeActive) return IQFakeActive.Call<Boolean>("IsReady");
            return false;
        }
        private List<FakePlayer> GetCombinedPlayerList() {
            if (!IsReadyIQFakeActive()) return null;
            JObject jsonData = IQFakeActive.Call<JObject>("GetListPlayers");
            if (!jsonData.TryGetValue("players", out JToken playersToken)) return null;
            List<FakePlayer> playerList = playersToken.ToObject<List<FakePlayer>>();
            return playerList.Where(p => !permission.UserHasPermission(p.userId, PermissionIgnoreMute)).ToList();
        }
        private Boolean IsFakeUser(String idOrName) {
            if (!IsReadyIQFakeActive()) return false;
            return (Boolean)IQFakeActive.Call("IsFakeUser", idOrName);
        }
        private Boolean SetMuteFakeUser(String idOrName, Boolean isMuted) {
            if (!IsReadyIQFakeActive()) return false;
            return IQFakeActive.Call<Boolean>("MuteAction", idOrName, isMuted);
        }
        private String GetFakeName(String idOrName) {
            if (!IsReadyIQFakeActive()) return String.Empty;
            return (String)IQFakeActive.Call("GetFakeName", idOrName);
        }
#endregion
#region IQRankSystem
        String IQRankGetRank(BasePlayer player) => (string)(IQRankSystem?.Call("API_GET_RANK_NAME", player.userID.Get()));
        String IQRankGetTimeGame(BasePlayer player) => (string)(IQRankSystem?.Call("API_GET_TIME_GAME", player.userID.Get()));
        List<String> IQRankListKey(BasePlayer player) => (List<string>)(IQRankSystem?.Call("API_RANK_USER_KEYS", player.userID.Get()));
        String IQRankGetNameRankKey(string Key) => (string)(IQRankSystem?.Call("API_GET_RANK_NAME", Key));
        void IQRankSetRank(BasePlayer player, string RankKey) => IQRankSystem?.Call("API_SET_ACTIVE_RANK", player.userID.Get(), RankKey);
#endregion
#region XPrison
        private String XPrison_GetPrefix(BasePlayer player) {
            if (!XPrison || !config.ReferenceSetting.xPrisonSettings.UseXPrison) return String.Empty;
            Boolean isPrisonPlayer = (Boolean)XPrison.CallHook("API_IsOnlinePrisoner", player.userID.Get());
            if (!isPrisonPlayer) return String.Empty;
            String prefixPrison = (String)XPrison.CallHook("API_GetOnlinePrisonerPrefix", player);
            if (String.IsNullOrWhiteSpace(prefixPrison)) return String.Empty;
            String resultPrefix = GetLang("XPRISON_SYNTAX_PREFIX", player.UserIDString, prefixPrison);
            Object resultColorMessage = IsGradientColorValue(config.ReferenceSetting.xPrisonSettings.colorTag);
            if (resultColorMessage is List<String> gradientColors) resultPrefix = ApplyGradientToText(resultPrefix, gradientColors);
            else resultPrefix = $"<color={config.ReferenceSetting.xPrisonSettings.colorTag}>{resultPrefix}</color>";
            return resultPrefix;
        }
#endregion
#region RustApp
        private void RustApp_NotifyIgnore(UInt64 playerID, UInt64 targetID, Boolean statusIgnore) {
            if (!RustApp) return;
            String messageNotify = LanguageEn ? $"{playerID} {(statusIgnore ? "added to ignore" : "removed from ignoring")} player {targetID}" : $"{playerID} {(statusIgnore ? "добавил в игнорирование" : "удалил из игнорирования")} игрока {targetID}";
            RustApp.Call("RA_CreateAlert", this, messageNotify, null, null);
        }
        private void RustApp_NotifyMute(UInt64 targetID, String reason, String formatTime, MuteType muteType, BasePlayer moderator) {
            if (!RustApp) return;
            String messageNotify = LanguageEn ? $"Moderator {(moderator == null ? "Server" : $" {
                moderator.userID
            }
            ")} has blocked the player's {(muteType == MuteType.Chat ? "text" : "voice")} chat {targetID}\nReason : {reason}\nTime : {formatTime}" : $"Модератор {(moderator == null ? "Server" : $" {
                moderator.userID
            }
            ")} заблокировал {(muteType == MuteType.Chat ? "текстовый" : "голосовой")} чат игроку {targetID}\nПричина : {reason}\nВремя : {formatTime}";
            RustApp.Call("RA_CreateAlert", this, messageNotify, null, null);
        }
        private void RustApp_NotifyUnMute(UInt64 targetID, MuteType muteType, BasePlayer moderator) {
            if (!RustApp) return;
            String messageNotify = LanguageEn ? $"Moderator {(moderator == null ? "Server" : $" {
                moderator.userID
            }
            ")} has unblocked the player's {(muteType == MuteType.Chat ? "text" : "voice")} chat {targetID}" : $"Модератор {(moderator == null ? "Server" : $" {
                moderator.userID
            }
            ")} разблокировал {(muteType == MuteType.Chat ? "текстовый" : "голосовой")} чат игроку {targetID}";
            RustApp.Call("RA_CreateAlert", this, messageNotify, null, null);
        }
        private void RustApp_HandlerPM(String senderUserID, String targetUserID, String message) {
            if (!RustApp) return;
            RustApp.Call("RA_DirectMessageHandler", senderUserID, targetUserID, message);
        }
#endregion
#endregion
#region Vars
        private const Boolean LanguageEn = false;
        private Timer timerLogs = null;
        private List<String> lastLogsTeamChat = new();
        private List<String> lastLogsGlobalChat = new();
        private static IQChat _;
        private static ImageUI _imageUI;
        public class TranslationState {
            public Boolean IsProcessed {
                get;
                set;
            }
            public String Translation {
                get;
                set;
            }
            public String DoTranslation {
                get;
                set;
            }
        }
        private Dictionary<String, TranslationState> saveTranslate = new();
        static Double CurrentTime => Facepunch.Math.Epoch.Current;
        public enum MuteType {
            Chat, Voice
        }
        private enum SelectedAction {
            Mute, Ignore
        }
        private enum SelectedParametres {
            DropList, Slider
        }
        private enum TakeElementUser {
            Prefix, Nick, Chat, Rank, MultiPrefix
        }
        private enum ElementsSettingsType {
            PM, Broadcast, Alert, Sound
        }
        public Dictionary<BasePlayer, BasePlayer> PMHistory = new Dictionary<BasePlayer, BasePlayer>();
        public Dictionary<BasePlayer, List<String>> LastMessagesChat = new Dictionary<BasePlayer, List<String>>();
        private const String PermissionUseCmdCnick = "iqchat.cnick";
        private const String PermissionUseCmdMsg = "iqchat.cmsg";
        private const String PermissionTranslationIgnore = "iqchat.translationignore";
        private const String PermissionHideMuteName = "iqchat.hidemutename";
        private const String PermissionHideOnline = "iqchat.onlinehide";
        private const String PermissionMute = "iqchat.muteuse";
        private const String PermissionAlert = "iqchat.alertuse";
        private const String PermissionRename = "iqchat.renameuse";
        private const String PermissionAntiSpam = "iqchat.antispamabuse";
        private const String PermissionHideConnection = "iqchat.hideconnection";
        private const String PermissionHideDisconnection = "iqchat.hidedisconnection";
        private const String PermissionMutedAdmin = "iqchat.adminmuted";
        private const String PermissionIgnoreMute = "iqchat.ignoremuted";
        class Response {
            [JsonProperty("country")]
            public string Country {
                get;
                set;
            }
        }
        private String GetLang(in String LangKey, in String userID = null, params Object[] args) {
            if (args == null) return lang.GetMessage(LangKey, this, userID);
            StringBuilder sb = Pool.Get<StringBuilder>();
            try {
                sb.AppendFormat(lang.GetMessage(LangKey, this, userID), args);
                return sb.ToString();
            }
            finally {
                sb.Clear();
                Pool.FreeUnmanaged(ref sb);
            }
        }
#endregion
#region Configuration
        private static Configuration config = new Configuration();
        private class Configuration {
#region Controller Connection
            [JsonProperty(LanguageEn ? "Setting up player information" : "Настройка информации о игроке")]
            public ControllerConnection ControllerConnect = new ControllerConnection();
            internal class ControllerConnection {
                [JsonProperty(LanguageEn ? "Function switches" : "Перключатели функций")]
                public Turned Turneds = new Turned();
                [JsonProperty(LanguageEn ? "Setting Standard Values" : "Настройка стандартных значений")]
                public SetupDefault SetupDefaults = new SetupDefault();
                internal class SetupDefault {
                    [JsonProperty(LanguageEn ? "This prefix will be set if the player entered the server for the first time or in case of expiration of the rights to the prefix that he had earlier" : "Данный префикс установится если игрок впервые зашел на сервер или в случае окончания прав на префикс, который у него стоял ранее")]
                    public String PrefixDefault = "<color=#CC99FF>[ИГРОК]</color>";
                    [JsonProperty(LanguageEn ? "This nickname color will be set if the player entered the server for the first time or in case of expiration of the rights to the nickname color that he had earlier" : "Данный цвет ника установится если игрок впервые зашел на сервер или в случае окончания прав на цвет ника, который у него стоял ранее")]
                    public String NickDefault = "#33CCCC";
                    [JsonProperty(LanguageEn ? "This chat color will be set if the player entered the server for the first time or in case of expiration of the rights to the chat color that he had earlier" : "Данный цвет чата установится если игрок впервые зашел на сервер или в случае окончания прав на цвет чата, который у него стоял ранее")]
                    public String MessageDefault = "#0099FF";
                }
                internal class Turned {
                    [JsonProperty(LanguageEn ? "Set automatically a prefix to a player when he got the rights to it" : "Устанавливать автоматически префикс игроку, когда он получил права на него")]
                    public Boolean TurnAutoSetupPrefix;
                    [JsonProperty(LanguageEn ? "Set automatically the color of the nickname to the player when he got the rights to it" : "Устанавливать автоматически цвет ника игроку, когда он получил права на него")]
                    public Boolean TurnAutoSetupColorNick;
                    [JsonProperty(LanguageEn ? "Set the chat color automatically to the player when he got the rights to it" : "Устанавливать автоматически цвет чата игроку, когда он получил права на него")]
                    public Boolean TurnAutoSetupColorChat;
                    [JsonProperty(LanguageEn ? "Automatically reset the prefix when the player's rights to it expire" : "Сбрасывать автоматически префикс при окончании прав на него у игрока")]
                    public Boolean TurnAutoDropPrefix;
                    [JsonProperty(LanguageEn ? "Automatically reset the color of the nickname when the player's rights to it expire" : "Сбрасывать автоматически цвет ника при окончании прав на него у игрока")]
                    public Boolean TurnAutoDropColorNick;
                    [JsonProperty(LanguageEn ? "Automatically reset the color of the chat when the rights to it from the player expire" : "Сбрасывать автоматически цвет чата при окончании прав на него у игрока")]
                    public Boolean TurnAutoDropColorChat;
                }
            }
#endregion
#region Controller Parameters
            [JsonProperty(LanguageEn ? "Setting options for the player" : "Настройка параметров для игрока")]
            public ControllerParameters ControllerParameter = new ControllerParameters();
            internal class ControllerParameters {
                [JsonProperty(LanguageEn ? "Setting the display of options for player selection" : "Настройка отображения параметров для выбора игрока")]
                public VisualSettingParametres VisualParametres = new VisualSettingParametres();
                [JsonProperty(LanguageEn ? "List and customization of colors for a nickname" : "Список и настройка цветов для ника")]
                public List<AdvancedFuncion> NickColorList = new List<AdvancedFuncion>();
                [JsonProperty(LanguageEn ? "List and customize colors for chat messages" : "Список и настройка цветов для сообщений в чате")]
                public List<AdvancedFuncion> MessageColorList = new List<AdvancedFuncion>();
                [JsonProperty(LanguageEn ? "List and configuration of prefixes in chat" : "Список и настройка префиксов в чате")]
                public PrefixSetting Prefixes = new PrefixSetting();
                internal class PrefixSetting {
                    [JsonProperty(LanguageEn ? "Enable support for multiple prefixes at once (true - multiple prefixes can be set/false - only 1 can be set to choose from)" : "Включить поддержку нескольких префиксов сразу (true - можно установить несколько префиксов/false - установить можно только 1 на выбор)")]
                    public Boolean TurnMultiPrefixes;
                    [JsonProperty(LanguageEn ? "The maximum number of prefixes that can be set at a time (This option only works if setting multiple prefixes is enabled)" : "Максимальное количество префиксов, которое можно установить за раз(Данный параметр работает только если включена установка нескольких префиксов)")]
                    public Int32 MaximumMultiPrefixCount;
                    [JsonProperty(LanguageEn ? "List of prefixes and their settings" : "Список префиксов и их настройка")]
                    public List<AdvancedFuncion> Prefixes = new List<AdvancedFuncion>();
                }
                internal class AdvancedFuncion {
                    [JsonProperty(LanguageEn ? "Permission" : "Права")]
                    public String Permissions;
                    [JsonProperty(LanguageEn ? "Argument" : "Значение")]
                    public String Argument;
                    [JsonProperty(LanguageEn ? "Block the player's ability to select this parameter in the plugin menu (true - yes/false - no)" : "Заблокировать возможность выбрать данный параметр игроком в меню плагина (true - да/false - нет)")]
                    public Boolean IsBlockSelected;
                }
                internal class VisualSettingParametres {
                    [JsonProperty(LanguageEn ? "Player prefix selection display type - (0 - dropdown list, 1 - slider (Please note that if you have multi-prefix enabled, the dropdown list will be set))" : "Тип отображения выбора префикса для игрока - (0 - выпадающий список, 1 - слайдер (Учтите, что если у вас включен мульти-префикс, будет установлен выпадающий список))")]
                    public SelectedParametres PrefixType;
                    [JsonProperty(LanguageEn ? "Display type of player's nickname color selection - (0 - drop-down list, 1 - slider)" : "Тип отображения выбора цвета ника для игрока - (0 - выпадающий список, 1 - слайдер)")]
                    public SelectedParametres NickColorType;
                    [JsonProperty(LanguageEn ? "Display type of message color choice for the player - (0 - drop-down list, 1 - slider)" : "Тип отображения выбора цвета сообщения для игрока - (0 - выпадающий список, 1 - слайдер)")]
                    public SelectedParametres ChatColorType;
                    [JsonProperty(LanguageEn ? "IQRankSystem : Player rank selection display type - (0 - drop-down list, 1 - slider)" : "IQRankSystem : Тип отображения выбора ранга для игрока - (0 - выпадающий список, 1 - слайдер)")]
                    public SelectedParametres IQRankSystemType;
                }
            }
#endregion
#region Controller Mute
            [JsonProperty(LanguageEn ? "Plugin mute settings" : "Настройка мута в плагине")]
            public ControllerMute ControllerMutes = new ControllerMute();
            internal class ControllerMute {
                [JsonProperty(LanguageEn ? "Prohibit sending messages in /pm and /r if the player's chat is blocked" : "Запрещать отправлять сообщения в /pm, /r - если у игрока заблокирован чат")]
                public Boolean mutedPM;
                [JsonProperty(LanguageEn ? "Setting up automatic muting" : "Настройка автоматического мута")]
                public AutoMute AutoMuteSettings = new AutoMute();
                internal class AutoMute {
                    [JsonProperty(LanguageEn ? "Enable automatic muting for forbidden words (true - yes/false - no)" : "Включить автоматический мут по запрещенным словам(true - да/false - нет)")]
                    public Boolean UseAutoMute;
                    [JsonProperty(LanguageEn ? "Reason for automatic muting" : "Причина автоматического мута")]
                    public Muted AutoMuted;
                }
                [JsonProperty(LanguageEn ? "Additional setting for logging about mutes in discord" : "Дополнительная настройка для логирования о мутах в дискорд")]
                public LoggedFuncion LoggedMute = new LoggedFuncion();
                internal class LoggedFuncion {
                    [JsonProperty(LanguageEn ? "Support for logging the last N messages (Discord logging about mutes must be enabled)" : "Поддержка логирования последних N сообщений (Должно быть включено логирование в дискорд о мутах)")]
                    public Boolean UseHistoryMessage;
                    [JsonProperty(LanguageEn ? "How many latest player messages to send in logging" : "Сколько последних сообщений игрока отправлять в логировании")]
                    public Int32 CountHistoryMessage;
                }
                [JsonProperty(LanguageEn ? "Reasons to block chat" : "Причины для блокировки чата")]
                public List<Muted> MuteChatReasons = new List<Muted>();
                [JsonProperty(LanguageEn ? "Reasons to block your voice" : "Причины для блокировки голоса")]
                public List<Muted> MuteVoiceReasons = new List<Muted>();
                internal class Muted {
                    [JsonProperty(LanguageEn ? "Reason for blocking" : "Причина для блокировки")]
                    public String Reason;
                    [JsonProperty(LanguageEn ? "Block time (in seconds)" : "Время блокировки(в секундах)")]
                    public Int32 SecondMute;
                }
            }
#endregion
#region Controller Message
            [JsonProperty(LanguageEn ? "Configuring Message Processing" : "Настройка обработки сообщений")]
            public ControllerMessage ControllerMessages = new ControllerMessage();
            internal class ControllerMessage {
                [JsonProperty(LanguageEn ? "Basic settings for chat messages from the plugin" : "Основная настройка сообщений в чат от плагина")]
                public GeneralSettings GeneralSetting = new GeneralSettings();
                [JsonProperty(LanguageEn ? "Configuring functionality switching in chat" : "Настройка переключения функционала в чате")]
                public TurnedFuncional TurnedFunc = new TurnedFuncional();
                [JsonProperty(LanguageEn ? "Player message formatting settings" : "Настройка форматирования сообщений игроков")]
                public FormattingMessage Formatting = new FormattingMessage();
                internal class GeneralSettings {
                    [JsonProperty(LanguageEn ? "Notify the player in chat about receiving a prefix/nickname color/chat color (true - yes/false - no)" : "Уведомлять игрока в чате о получении префикса/цвета ника/цвета чата (true - да/false - нет)")]
                    public Boolean alertArgumentsInfoSetup;
                    [JsonProperty(LanguageEn ? "Notify the player in chat about the end of a prefix/nickname color/chat color (true - yes/false - no)" : "Уведомлять игрока в чате о окончании префикса/цвета ника/цвета чата (true - да/false - нет)")]
                    public Boolean alertArgumentsInfoRemove;
                    [JsonProperty(LanguageEn ? "Customizing the chat alert format" : "Настройка формата оповещения в чате")]
                    public BroadcastSettings BroadcastFormat = new BroadcastSettings();
                    [JsonProperty(LanguageEn ? "Setting the mention format in the chat, via @" : "Настройка формата упоминания в чате, через @")]
                    public AlertSettings AlertFormat = new AlertSettings();
                    [JsonProperty(LanguageEn ? "Additional setting" : "Дополнительная настройка")]
                    public OtherSettings OtherSetting = new OtherSettings();
                    internal class BroadcastSettings {
                        [JsonProperty(LanguageEn ? "The name of the notification in the chat" : "Наименование оповещения в чат")]
                        public String BroadcastTitle;
                        [JsonProperty(LanguageEn ? "Chat alert message color" : "Цвет сообщения оповещения в чат")]
                        public String BroadcastColor;
                        [JsonProperty(LanguageEn ? "Steam64ID for chat avatar" : "Steam64ID для аватарки в чате")]
                        public String Steam64IDAvatar;
                    }
                    internal class AlertSettings {
                        [JsonProperty(LanguageEn ? "The color of the player mention message in the chat" : "Цвет сообщения упоминания игрока в чате")]
                        public String AlertPlayerColor;
                        [JsonProperty(LanguageEn ? "Sound when receiving and sending a mention via @" : "Звук при при получении и отправки упоминания через @")]
                        public String SoundAlertPlayer;
                    }
                    internal class OtherSettings {
                        [JsonProperty(LanguageEn ? "Time after which the message will be deleted from the UI from the administrator" : "Время,через которое удалится сообщение с UI от администратора")]
                        public Int32 TimeDeleteAlertUI;
                        [JsonProperty(LanguageEn ? "The size of the message from the player in the chat" : "Размер сообщения от игрока в чате")]
                        public Int32 SizeMessage = 14;
                        [JsonProperty(LanguageEn ? "Player nickname size in chat" : "Размер ника игрока в чате")]
                        public Int32 SizeNick = 14;
                        [JsonProperty(LanguageEn ? "The size of the player's prefix in the chat (will be used if <size=N></size> is not set in the prefix itself)" : "Размер префикса игрока в чате (будет использовано, если в самом префиксе не установвлен <size=N></size>)")]
                        public Int32 SizePrefix = 14;
                        [JsonProperty(LanguageEn ? "Nickname size according to privilege [permission] = size" : "Размер ника по привилегии [permission] = размер")]
                        public Dictionary<String, Int32> sizeNickPrivilages = new Dictionary<String, Int32>();
                        [JsonProperty(LanguageEn ? "Chat message size according to privilege [permission] = size" : "Размер сообщения в чате по привилегии [permission] = размер")]
                        public Dictionary<String, Int32> sizeMessagePrivilages = new Dictionary<String, Int32>();
                        public Int32 GetSizeNickOrMessage(BasePlayer player, Boolean nickOrMessage) {
                            Dictionary<String, Int32> sizePrivilage = nickOrMessage ? sizeNickPrivilages : sizeMessagePrivilages;
                            if(sizePrivilage != null && sizePrivilage.Count != 0) foreach (KeyValuePair<String, Int32> privilage in sizePrivilage) {
                                if (_.permission.UserHasPermission(player.UserIDString, privilage.Key)) return privilage.Value;
                            }
                            return nickOrMessage ? SizeNick : SizeMessage;
                        }
                    }
                }
                internal class TurnedFuncional {
                    [JsonProperty(LanguageEn ? "Configuring spam protection" : "Настройка защиты от спама")]
                    public AntiSpam AntiSpamSetting = new AntiSpam();
                    [JsonProperty(LanguageEn ? "Setting up a temporary chat block for newbies (who have just logged into the server)" : "Настройка временной блокировки чата новичкам (которые только зашли на сервер)")]
                    public AntiNoob AntiNoobSetting = new AntiNoob();
                    [JsonProperty(LanguageEn ? "Setting up private messages" : "Настройка личных сообщений")]
                    public PM PMSetting = new PM();
                    internal class AntiNoob {
                        [JsonProperty(LanguageEn ? "Newbie protection in PM/R" : "Защита от новичка в PM/R")]
                        public Settings AntiNoobPM = new Settings();
                        [JsonProperty(LanguageEn ? "Newbie protection in global and team chat" : "Защита от новичка в глобальном и коммандном чате")]
                        public Settings AntiNoobChat = new Settings();
                        internal class Settings {
                            [JsonProperty(LanguageEn ? "Enable protection?" : "Включить защиту?")]
                            public Boolean AntiNoobActivate = false;
                            [JsonProperty(LanguageEn ? "Newbie Chat Lock Time" : "Время блокировки чата для новичка")]
                            public Int32 TimeBlocked = 1200;
                        }
                    }
                    internal class AntiSpam {
                        [JsonProperty(LanguageEn ? "Enable spam protection (Anti-spam)" : "Включить защиту от спама (Анти-спам)")]
                        public Boolean AntiSpamActivate;
                        [JsonProperty(LanguageEn ? "Time after which a player can send a message (AntiSpam)" : "Время через которое игрок может отправлять сообщение (АнтиСпам)")]
                        public Int32 FloodTime;
                        [JsonProperty(LanguageEn ? "Additional Anti-Spam settings" : "Дополнительная настройка Анти-Спама")]
                        public AntiSpamDuples AntiSpamDuplesSetting = new AntiSpamDuples();
                        internal class AntiSpamDuples {
                            [JsonProperty(LanguageEn ? "Enable additional spam protection (Anti-duplicates, duplicate messages)" : "Включить дополнительную защиту от спама (Анти-дубликаты, повторяющие сообщения)")]
                            public Boolean AntiSpamDuplesActivate = true;
                            [JsonProperty(LanguageEn ? "How many duplicate messages does a player need to make to be confused by the system" : "Сколько дублирующих сообщений нужно сделать игроку чтобы его замутила система")]
                            public Int32 TryDuples = 3;
                            [JsonProperty(LanguageEn ? "Setting up automatic muting for duplicates" : "Настройка автоматического мута за дубликаты")]
                            public ControllerMute.Muted MuteSetting = new ControllerMute.Muted {
                                Reason = LanguageEn ? "Blocking for duplicate messages (SPAM)" : "Блокировка за дублирующие сообщения (СПАМ)", SecondMute = 300,
                            }
                            ;
                        }
                    }
                    internal class PM {
                        [JsonProperty(LanguageEn ? "Enable Private Messages" : "Включить личные сообщения")]
                        public Boolean PMActivate;
                        [JsonProperty(LanguageEn ? "Sound when receiving a private message" : "Звук при при получении личного сообщения")]
                        public String SoundPM;
                    }
                    [JsonProperty(LanguageEn ? "Enable PM ignore for players (/ignore nick or via interface)" : "Включить игнор ЛС игрокам(/ignore nick или через интерфейс)")]
                    public Boolean IgnoreUsePM;
                    [JsonProperty(LanguageEn ? "Hide the issue of items to the Admin from the chat" : "Скрыть из чата выдачу предметов Админу")]
                    public Boolean HideAdminGave;
                    [JsonProperty(LanguageEn ? "Move mute to team chat (In case of a mute, the player will not be able to write even to the team chat)" : "Переносить мут в командный чат(В случае мута, игрок не сможет писать даже в командный чат)")]
                    public Boolean MuteTeamChat;
                }
                internal class FormattingMessage {
                    [JsonProperty(LanguageEn ? "Enable message formatting [Will control caps, message format] (true - yes/false - no)" : "Включить форматирование сообщений [Будет контроллировать капс, формат сообщения] (true - да/false - нет)")]
                    public Boolean FormatMessage;
                    [JsonProperty(LanguageEn ? "Use a list of banned words (true - yes/false - no)" : "Использовать список запрещенных слов (true - да/false - нет)")]
                    public Boolean UseBadWords;
                    [JsonProperty(LanguageEn ? "The word that will replace the forbidden word" : "Слово которое будет заменять запрещенное слово")]
                    public String ReplaceBadWord;
                    [JsonProperty(LanguageEn ? "The list of forbidden words [Forbidden Word] = Whether to replace it in part of the word (for example, Vasya Fucking => Vasya ***) (true - yes/false - no)" : "Список запрещенных слов [ЗапрещенноеСлово] = Заменять ли его в части слова (например ВасяБля => Вася***) (true - да/false - нет)")]
                    public Dictionary<String, Boolean> BadWords = new Dictionary<String, Boolean>();
                    [JsonProperty(LanguageEn ? "Nickname controller setup" : "Настройка контроллера ников")]
                    public NickController ControllerNickname = new NickController();
                    internal class NickController {
                        [JsonProperty(LanguageEn ? "Enable player nickname formatting (message formatting must be enabled)" : "Включить форматирование ников игроков (должно быть включено форматирование сообщений)")]
                        public Boolean UseNickController = true;
                        [JsonProperty(LanguageEn ? "The word that will replace the forbidden word (You can leave it blank and it will just delete)" : "Слово которое будет заменять запрещенное слово (Вы можете оставить пустым и будет просто удалять)")]
                        public String ReplaceBadNick = "****";
                        [JsonProperty(LanguageEn ? "The list of forbidden nicknames [Forbidden Word] = Whether to replace it in part of the word (for example, Vasya Fucking => Vasya ***) (true - yes/false - no)" : "Список запрещенных ников [ЗапрещенноеСлово] = Заменять ли его в части слова (например ВасяБля => Вася***) (true - да/false - нет)")]
                        public Dictionary<String, Boolean> BadNicks = new Dictionary<String, Boolean>();
                        [JsonProperty(LanguageEn ? "List of allowed links in nicknames" : "Список разрешенных ссылок в никах")]
                        public List<String> AllowedLinkNick = new List<String>();
                    }
                }
            }
#endregion
#region Controller Alert
            [JsonProperty(LanguageEn ? "Setting up chat alerts" : "Настройка оповещений в чате")]
            public ControllerAlert ControllerAlertSetting;
            internal class ControllerAlert {
                [JsonProperty(LanguageEn ? "Setting up chat alerts" : "Настройка оповещений в чате")]
                public Alert AlertSetting;
                [JsonProperty(LanguageEn ? "Setting notifications about the status of the player's session" : "Настройка оповещений о статусе сессии игрока")]
                public PlayerSession PlayerSessionSetting;
                [JsonProperty(LanguageEn ? "Configuring administrator session status alerts" : "Настройка оповещений о статусе сессии администратора")]
                public AdminSession AdminSessionSetting;
                [JsonProperty(LanguageEn ? "Setting up personal notifications to the player when connecting" : "Настройка персональных оповоещений игроку при коннекте")]
                public PersonalAlert PersonalAlertSetting;
                internal class Alert {
                    [JsonProperty(LanguageEn ? "Enable automatic messages in chat (true - yes/false - no)" : "Включить автоматические сообщения в чат (true - да/false - нет)")]
                    public Boolean AlertMessage;
                    [JsonProperty(LanguageEn ? "Type of automatic messages : true - sequential / false - random" : "Тип автоматических сообщений : true - поочередные/false - случайные")]
                    public Boolean AlertMessageType;
                    [JsonProperty(LanguageEn ? "List of automatic messages in chat" : "Список автоматических сообщений в чат")]
                    public LanguageController MessageList = new LanguageController();
                    [JsonProperty(LanguageEn ? "Interval for sending messages to chat (Broadcaster) (in seconds)" : "Интервал отправки сообщений в чат (Броадкастер) (в секундах)")]
                    public Int32 MessageListTimer;
                }
                internal class PlayerSession {
                    [JsonProperty(LanguageEn ? "When a player is notified about the entry / exit of the player, display his avatar opposite the nickname (true - yes / false - no)" : "При уведомлении о входе/выходе игрока отображать его аватар напротив ника (true - да/false - нет)")]
                    public Boolean ConnectedAvatarUse;
                    [JsonProperty(LanguageEn ? "Notify in chat when a player enters (true - yes/false - no)" : "Уведомлять в чате о входе игрока (true - да/false - нет)")]
                    public Boolean ConnectedAlert;
                    [JsonProperty(LanguageEn ? "Enable random notifications when a player from the list enters (true - yes / false - no)" : "Включить случайные уведомления о входе игрока из списка (true - да/false - нет)")]
                    public Boolean ConnectionAlertRandom;
                    [JsonProperty(LanguageEn ? "Show the country of the entered player (true - yes/false - no)" : "Отображать страну зашедшего игрока (true - да/false - нет")]
                    public Boolean ConnectedWorld;
                    [JsonProperty(LanguageEn ? "Notify when a player enters the chat (selected from the list) (true - yes/false - no)" : "Уведомлять о выходе игрока в чат(выбираются из списка) (true - да/false - нет)")]
                    public Boolean DisconnectedAlert;
                    [JsonProperty(LanguageEn ? "Enable random player exit notifications (true - yes/false - no)" : "Включить случайные уведомления о выходе игрока (true - да/false - нет)")]
                    public Boolean DisconnectedAlertRandom;
                    [JsonProperty(LanguageEn ? "Display reason for player exit (true - yes/false - no)" : "Отображать причину выхода игрока (true - да/false - нет)")]
                    public Boolean DisconnectedReason;
                    [JsonProperty(LanguageEn ? "Random player entry notifications({0} - player's nickname, {1} - country (if country display is enabled)" : "Случайные уведомления о входе игрока({0} - ник игрока, {1} - страна(если включено отображение страны)")]
                    public LanguageController RandomConnectionAlert = new LanguageController();
                    [JsonProperty(LanguageEn ? "Random notifications about the exit of the player ({0} - player's nickname, {1} - the reason for the exit (if the reason is enabled)" : "Случайные уведомления о выходе игрока({0} - ник игрока, {1} - причина выхода(если включена причина)")]
                    public LanguageController RandomDisconnectedAlert = new LanguageController();
                }
                internal class AdminSession {
                    [JsonProperty(LanguageEn ? "Notify admin on the server in the chat (true - yes/false - no)" : "Уведомлять о входе админа на сервер в чат (true - да/false - нет)")]
                    public Boolean ConnectedAlertAdmin;
                    [JsonProperty(LanguageEn ? "Notify about admin leaving the server in chat (true - yes/false - no)" : "Уведомлять о выходе админа на сервер в чат (true - да/false - нет)")]
                    public Boolean DisconnectedAlertAdmin;
                }
                internal class PersonalAlert {
                    [JsonProperty(LanguageEn ? "Enable random message to the player who has logged in (true - yes/false - no)" : "Включить случайное сообщение зашедшему игроку (true - да/false - нет)")]
                    public Boolean UseWelcomeMessage;
                    [JsonProperty(LanguageEn ? "List of messages to the player when entering" : "Список сообщений игроку при входе")]
                    public LanguageController WelcomeMessage = new LanguageController();
                }
            }
            public class LanguageController {
                [JsonProperty(LanguageEn ? "Setting up Multilingual Messages [Language Code] = Translation Variations" : "Настройка мультиязычных сообщений [КодЯзыка] = ВариацииПеревода")]
                public Dictionary<String, List<String>> LanguageMessages = new Dictionary<String, List<String>>();
            }
#endregion
#region Rust Plus
            [JsonProperty(LanguageEn ? "Settings Rust+" : "Настройка Rust+")]
            public RustPlus RustPlusSettings;
            internal class RustPlus {
                [JsonProperty(LanguageEn ? "Use Rust+" : "Использовать Rust+")]
                public Boolean UseRustPlus;
                [JsonProperty(LanguageEn ? "Title for notification Rust+" : "Название для уведомления Rust+")]
                public String DisplayNameAlert;
            }
#endregion
#region Reference Setting
            [JsonProperty(LanguageEn ? "Configuring support plugins" : "Настройка плагинов поддержки")]
            public ReferenceSettings ReferenceSetting = new ReferenceSettings();
            internal class ReferenceSettings {
                [JsonProperty(LanguageEn ? "Settings XLevels" : "Настройка XLevels")]
                public XLevels XLevelsSettings = new XLevels();
                [JsonProperty(LanguageEn ? "Settings IQFakeActive" : "Настройка IQFakeActive")]
                public IQFakeActive IQFakeActiveSettings = new IQFakeActive();
                [JsonProperty(LanguageEn ? "Settings IQRankSystem" : "Настройка IQRankSystem")]
                public IQRankSystem IQRankSystems = new IQRankSystem();
                [JsonProperty(LanguageEn ? "Settings Clans" : "Настройка Clans")]
                public Clans ClansSettings = new Clans();
                [JsonProperty(LanguageEn ? "Settings TranslationAPI" : "Настройка TranslationAPI")]
                public TranslataionApi translationApiSettings = new TranslataionApi();
                [JsonProperty(LanguageEn ? "Settings SkillTree" : "Настройка SkillTree")]
                public SkillTree skillTreeSettings = new SkillTree();
                [JsonProperty(LanguageEn ? "Settings PlayerRanks" : "Настройка PlayerRanks")]
                public PlayerRanks playerRanksSettings = new PlayerRanks();
                [JsonProperty(LanguageEn ? "Settings XPrison" : "Настройка XPrison")]
                public XPrison xPrisonSettings = new XPrison();
                internal class TranslataionApi {
                    [JsonProperty(LanguageEn ? "To use automatic message translation using the TranslationAPI" : "Использовать автоматический перевод сообщений с помощью TranslataionAPI")]
                    public Boolean useTranslationApi;
                    [JsonProperty(LanguageEn ? "Translate team chat" : "Переводить командный чат")]
                    public Boolean translateTeamChat;
                    [JsonProperty(LanguageEn ? "Translate chat in private messages." : "Переводить чат в личных сообщениях")]
                    public Boolean translatePmChat;
                    [JsonProperty(LanguageEn ? "The code for the preferred language (leave it empty, and then the translation will be done in each player's language)" : "Код приоритетного языка (оставьте пустым и тогда для каждого игрока будет переводиться на его языке клиента)")]
                    public String codeLangua
// ... [Code preview truncated due to length. Full source in attached file] ...

Автор
15FPS
Скачиваний
0
Просмотры
1
Первый выпуск
Обновление
Оценка
0.00 звёзд 0 оценок
Сверху