C#:
// Все права принадлежат дискорд сообществу https://discord.gg/VgNHPpNrz6
using System.Collections;
using Oxide.Core.Plugins;
using System.Text.RegularExpressions;
using System;
using UnityEngine;
using ConVar;
using System.Collections.Generic;
using Oxide.Core.Libraries.Covalence;
using CompanionServer;
using Oxide.Core.Libraries;
using Oxide.Game.Rust.Cui;
using System.Linq;
using Facepunch;
using UnityEngine.Networking;
using Newtonsoft.Json.Linq;
using Newtonsoft.Json;
using System.Text;
using Oxide.Core;
using System.IO;
namespace Oxide.Plugins {
[Info("TPChat", "https://blackplugin.ru", "11.0.1")]
[Description("Chat")]
class TPChat : RustPlugin {
private void DrawUI_IQChat_Context_AdminAndModeration(BasePlayer player) {
if (!permission.UserHasPermission(player.UserIDString, PermissionMute)) return;
String InterfaceModeration = InterfaceBuilder.GetInterface("UI_Chat_Moderation");
if (InterfaceModeration == null) return;
InterfaceModeration = InterfaceModeration.Replace("%TITLE%", GetLang("IQCHAT_TITLE_MODERATION_PANEL", player.UserIDString));
InterfaceModeration = InterfaceModeration.Replace("%COMMAND_MUTE_MENU%", $"newui.cmd action.mute.ignore open {SelectedAction.Mute}");
InterfaceModeration = InterfaceModeration.Replace("%TEXT_MUTE_MENU%", GetLang("IQCHAT_BUTTON_MODERATION_MUTE_MENU", player.UserIDString));
CuiHelper.AddUi(player, InterfaceModeration);
DrawUI_IQChat_Update_MuteChat_All(player);
DrawUI_IQChat_Update_MuteVoice_All(player);
}
[ConsoleCommand("adminalert")]
private void AdminAlertConsoleCommand(ConsoleSystem.Arg args) {
BasePlayer Sender = args.Player();
if (Sender != null) if (!permission.UserHasPermission(Sender.UserIDString, PermissionAlert)) return;
Alert(Sender, args.Args, true);
}
[ConsoleCommand("unmute")]
void UnMuteCustomAdmin(ConsoleSystem.Arg arg) {
if (arg.Player() != null) if (!permission.UserHasPermission(arg.Player().UserIDString, PermissionMute)) return;
if (arg?.Args == null || arg.Args.Length != 1 || arg.Args.Length > 1) {
PrintWarning(LanguageEn ? "Invalid syntax, please use : unmute Steam64ID" : "Неверный синтаксис,используйте : unmute Steam64ID");
return;
}
string NameOrID = arg.Args[0];
BasePlayer target = GetPlayerNickOrID(NameOrID);
if (target == null) {
UInt64 Steam64ID = 0;
if (UInt64.TryParse(NameOrID, out Steam64ID)) {
if (UserInformation.ContainsKey(Steam64ID)) {
User Info = UserInformation[Steam64ID];
if (Info == null) return;
if (!Info.MuteInfo.IsMute(MuteType.Chat)) {
ConsoleOrPrintMessage(arg.Player(), LanguageEn ? "The player does not have a chat lock" : "У игрока нет блокировки чата");
return;
}
Info.MuteInfo.UnMute(MuteType.Chat);
ConsoleOrPrintMessage(arg.Player(), LanguageEn ? "You have unblocked the offline chat to the player" : "Вы разблокировали чат offline игроку");
return;
}
else {
ConsoleOrPrintMessage(arg.Player(), LanguageEn ? "This player is not on the server" : "Такого игрока нет на сервере");
return;
}
}
else {
ConsoleOrPrintMessage(arg.Player(), LanguageEn ? "This player is not on the server" : "Такого игрока нет на сервере");
return;
}
}
UnmutePlayer(target, MuteType.Chat, arg.Player(), false, true);
Puts(LanguageEn ? "Successfully" : "Успешно");
}
void OnPlayerDisconnected(BasePlayer player, string reason) => AlertDisconnected(player, reason);
public Dictionary<UInt64, User> UserInformation = new Dictionary<UInt64, User>();
private class Configuration {
[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;
}
}
[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;
}
}
[JsonProperty(LanguageEn ? "Plugin mute settings" : "Настройка мута в плагине")]
public ControllerMute ControllerMutes = new ControllerMute();
internal class ControllerMute {
[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;
}
}
[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 ? "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 ? "List of banned words" : "Список запрещенных слов")]
public List<String> BadWords = new List<String>();
[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 ? "List of banned nicknames" : "Список запрещенных ников")]
public List<String> BadNicks = new List<String>();
[JsonProperty(LanguageEn ? "List of allowed links in nicknames" : "Список разрешенных ссылок в никах")]
public List<String> AllowedLinkNick = new List<String>();
}
}
}
[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>>();
}
[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;
}
[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();
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 codeLanguagePrimary;
}
internal class Clans {
[JsonProperty(LanguageEn ? "Display a clan tag in the chat (if Clans are installed)" : "Отображать в чате клановый тэг (если установлены Clans)")]
public Boolean UseClanTag;
}
internal class IQRankSystem {
[JsonProperty(LanguageEn ? "Rank display format in chat ( {0} is the user's rank, do not delete this value)" : "Формат отображения ранга в чате ( {0} - это ранг юзера, не удаляйте это значение)")]
public String FormatRank = "[{0}]";
[JsonProperty(LanguageEn ? "Time display format with IQRank System in chat ( {0} is the user's time, do not delete this value)" : "Формат отображения времени с IQRankSystem в чате ( {0} - это время юзера, не удаляйте это значение)")]
public String FormatRankTime = "[{0}]";
[JsonProperty(LanguageEn ? "Use support IQRankSystem" : "Использовать поддержку рангов")]
public Boolean UseRankSystem;
[JsonProperty(LanguageEn ? "Show players their played time next to their rank" : "Отображать игрокам их отыгранное время рядом с рангом")]
public Boolean UseTimeStandart;
}
internal class IQFakeActive {
[JsonProperty(LanguageEn ? "Use support IQFakeActive" : "Использовать поддержку IQFakeActive")]
public Boolean UseIQFakeActive;
}
internal class XLevels {
[JsonProperty(LanguageEn ? "Use support XLevels" : "Использовать поддержку XLevels")]
public Boolean UseXLevels;
[JsonProperty(LanguageEn ? "Use full prefix with level from XLevel (true) otherwise only level (false)" : "Использовать полный префикс с уровнем из XLevel (true) иначе только уровень (false)")]
public Boolean UseFullXLevels;
}
}
[JsonProperty(LanguageEn ? "Setting up an answering machine" : "Настройка автоответчика")]
public AnswerMessage AnswerMessages = new AnswerMessage();
internal class AnswerMessage {
[JsonProperty(LanguageEn ? "Enable auto-reply? (true - yes/false - no)" : "Включить автоответчик?(true - да/false - нет)")]
public bool UseAnswer;
[JsonProperty(LanguageEn ? "Customize Messages [Keyword] = Reply" : "Настройка сообщений [Ключевое слово] = Ответ")]
public Dictionary<String, LanguageController> AnswerMessageList = new Dictionary<String, LanguageController>();
}
[JsonProperty(LanguageEn ? "Additional setting" : "Дополнительная настройка")]
public OtherSettings OtherSetting;
internal class OtherSettings {
[JsonProperty(LanguageEn ? "Enable the /online command (true - yes / false - no)" : "Включить команду /online (true - да/ false - нет)")]
public Boolean UseCommandOnline;
[JsonProperty(LanguageEn ? "Use shortened format /online (will only display quantity)" : "Использовать сокращенный формат /online (будет отображать только количество)")]
public Boolean UseCommandShortOnline;
[JsonProperty(LanguageEn ? "Compact logging of messages" : "Компактное логирование сообщений")]
public CompactLoggetChat CompactLogsChat = new CompactLoggetChat();
[JsonProperty(LanguageEn ? "Setting up message logging" : "Настройка логирования сообщений")]
public LoggedChat LogsChat = new LoggedChat();
[JsonProperty(LanguageEn ? "Setting up logging of personal messages of players" : "Настройка логирования личных сообщений игроков")]
public General LogsPMChat = new General();
[JsonProperty(LanguageEn ? "Setting up chat/voice lock/unlock logging" : "Настройка логирования блокировок/разблокировок чата/голоса")]
public General LogsMuted = new General();
[JsonProperty(LanguageEn ? "Setting up logging of chat commands from players" : "Настройка логирования чат-команд от игроков")]
public General LogsChatCommands = new General();
internal class CompactLoggetChat {
[JsonProperty(LanguageEn ? "Display Steam64ID in the log (true - yes/false - no)" : "Отображать в логе Steam64ID (true - да/false - нет)")]
public Boolean ShowSteamID;
[JsonProperty(LanguageEn ? "Setting up compact message logging" : "Настройка компактного логирования сообщений")]
public LoggedChat LogsCompactChat = new LoggedChat();
}
internal class LoggedChat {
[JsonProperty(LanguageEn ? "Setting up general chat logging" : "Настройка логирования общего чата")]
public General GlobalChatSettings = new General();
[JsonProperty(LanguageEn ? "Setting up team chat logging" : "Настройка логирования тим чата")]
public General TeamChatSettings = new General();
}
internal class General {
[JsonProperty(LanguageEn ? "Enable logging (true - yes/false - no)" : "Включить логирование (true - да/false - нет)")]
public Boolean UseLogged = false;
[JsonProperty(LanguageEn ? "Webhooks channel for logging" : "Webhooks канала для логирования")]
public String Webhooks = "";
}
}
public static Configuration GetNewConfiguration() {
return new Configuration {
ControllerParameter = new ControllerParameters {
VisualParametres = new ControllerParameters.VisualSettingParametres {
PrefixType = SelectedParametres.DropList, ChatColorType = SelectedParametres.DropList, NickColorType = SelectedParametres.Slider, IQRankSystemType = SelectedParametres.Slider,
}
, Prefixes = new ControllerParameters.PrefixSetting {
TurnMultiPrefixes = false, MaximumMultiPrefixCount = 5, Prefixes = new List<ControllerParameters.AdvancedFuncion> {
new ControllerParameters.AdvancedFuncion {
Argument = LanguageEn ? "<color=#CC99FF>[PLAYER]</color>" : "<color=#CC99FF>[ИГРОК]</color>", Permissions = "iqchat.default", IsBlockSelected = false,
}
, new ControllerParameters.AdvancedFuncion {
Argument = "<color=#ffff99>[VIP]</color>", Permissions = "iqchat.admin", IsBlockSelected = false,
}
, new ControllerParameters.AdvancedFuncion {
Argument = LanguageEn ? "<color=#ff9999>[ADMIN]</color>" : "<color=#ff9999>[АДМИН]</color>", Permissions = "iqchat.admin", IsBlockSelected = false,
}
,
}
,
}
, MessageColorList = new List<ControllerParameters.AdvancedFuncion> {
new ControllerParameters.AdvancedFuncion {
Argument = "#CC99FF", Permissions = "iqchat.default", IsBlockSelected = false,
}
, new ControllerParameters.AdvancedFuncion {
Argument = "#ffff99", Permissions = "iqchat.admin", IsBlockSelected = false,
}
, new ControllerParameters.AdvancedFuncion {
Argument = "#ff9999", Permissions = "iqchat.admin", IsBlockSelected = false,
}
,
}
, NickColorList = new List<ControllerParameters.AdvancedFuncion> {
new ControllerParameters.AdvancedFuncion {
Argument = "#CC99FF", Permissions = "iqchat.default", IsBlockSelected = false,
}
, new ControllerParameters.AdvancedFuncion {
Argument = "#ffff99", Permissions = "iqchat.admin", IsBlockSelected = false,
}
, new ControllerParameters.AdvancedFuncion {
Argument = "#ff9999", Permissions = "iqchat.admin", IsBlockSelected = false,
}
,
}
,
}
, ControllerConnect = new ControllerConnection {
SetupDefaults = new ControllerConnection.SetupDefault {
PrefixDefault = LanguageEn ? "<color=#CC99FF>[PLAYER]</color>" : "<color=#CC99FF>[ИГРОК]</color>", MessageDefault = "#33CCCC", NickDefault = "#0099FF",
}
, Turneds = new ControllerConnection.Turned {
TurnAutoDropColorChat = true, TurnAutoDropColorNick = true, TurnAutoDropPrefix = true, TurnAutoSetupColorChat = true, TurnAutoSetupColorNick = true, TurnAutoSetupPrefix = true,
}
}
, ControllerMutes = new ControllerMute {
LoggedMute = new ControllerMute.LoggedFuncion {
UseHistoryMessage = false, CountHistoryMessage = 10,
}
, AutoMuteSettings = new ControllerMute.AutoMute {
UseAutoMute = true, AutoMuted = new ControllerMute.Muted {
Reason = LanguageEn ? "Automatic chat blocking" : "Автоматическая блокировка чата", SecondMute = 300,
}
}
, MuteChatReasons = new List<ControllerMute.Muted> {
new ControllerMute.Muted {
Reason = LanguageEn ? "Aggressive behavior" : "Агрессивное поведение", SecondMute = 100,
}
, new ControllerMute.Muted {
Reason = LanguageEn ? "Insults" : "Оскорбления", SecondMute = 300,
}
, new ControllerMute.Muted {
Reason = LanguageEn ? "Insult (repeated violation)" : "Оскорбление (повторное нарушение)", SecondMute = 1000,
}
, new ControllerMute.Muted {
Reason = LanguageEn ? "Advertising" : "Реклама", SecondMute = 5000,
}
, new ControllerMute.Muted {
Reason = LanguageEn ? "Humiliation" : "Унижение", SecondMute = 300,
}
, new ControllerMute.Muted {
Reason = LanguageEn ? "Spam" : "Спам", SecondMute = 60,
}
,
}
, MuteVoiceReasons = new List<ControllerMute.Muted> {
new ControllerMute.Muted {
Reason = LanguageEn ? "Aggressive behavior" : "Агрессивное поведение", SecondMute = 100,
}
, new ControllerMute.Muted {
Reason = LanguageEn ? "Insults" : "Оскорбления", SecondMute = 300,
}
, new ControllerMute.Muted {
Reason = LanguageEn ? "Disruption of the event by shouting" : "Срыв мероприятия криками", SecondMute = 300,
}
,
}
}
, ControllerMessages = new ControllerMessage {
Formatting = new ControllerMessage.FormattingMessage {
UseBadWords = true, BadWords = LanguageEn ? new List<String> {
"fuckyou", "sucking", "fucking", "fuck"
}
: new List<String> {
"бля", "сука", "говно", "тварь"
}
, FormatMessage = true, ReplaceBadWord = "***", ControllerNickname = new Con
// ... [Code preview truncated due to length. Full source in attached file] ...