C#:
using Network;
using Newtonsoft.Json;
using Oxide.Core;
using Oxide.Core.Plugins;
using Oxide.Game.Rust.Cui;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using ConVar;
using Newtonsoft.Json.Linq;
using Oxide.Core.Libraries;
using Oxide.Core.Libraries.Covalence;
using UnityEngine;
using UnityEngine.Networking;
using Time = UnityEngine.Time;
using Facepunch.Utility;
using UnityEngine.UI;
using Net = Network.Net;
using Object = System.Object;
namespace Oxide.Plugins {
[Info("IQReportSystem", "Mercury", "2.19.82")]
[Description("One love IQReportSystem")]
internal class IQReportSystem : RustPlugin {
/// <summary>
/// Обновление 2.0.x
/// - Улучшена обработка запросов в Steam
/// - Добавлены дополнительные поля в лог о жалобе, если не получится получить все данные от Steam
/// </summary>
#region Vars
private static ImageUI ImageUi;
private const Boolean LanguageEn = true;
private static IQReportSystem _;
private const String ModeratorPermissions = "iqreportsystem.moderation";
private const String HideMenuPermissions = "iqreportsystem.hidemenu";
private static Double CurrentTime => Facepunch.Math.Epoch.Current;
private readonly Dictionary<UInt64, ProcessCheckRepository> PlayerChecks = new Dictionary<UInt64, ProcessCheckRepository>();
private readonly Hash<String, NpcSound> CachedSound = new Hash<String, NpcSound>();
private Dictionary<UInt64, Timer> TimerWaitChecked = new Dictionary<UInt64, Timer>();
private Dictionary<UInt64, Timer> TimerWaitPlayer = new Dictionary<UInt64, Timer>();
private Dictionary<UInt64, PlayerRepository> PlayerRepositories = new Dictionary<UInt64, PlayerRepository>();
private Dictionary<BasePlayer, Coroutine> AfkCheckRoutine = new Dictionary<BasePlayer, Coroutine>();
private void AddCooldown(UInt64 SenderID, UInt64 TargetID) {
if (config.ReportSendControllerSettings.CooldownReport == 0 && !config.ReportSendControllerSettings.NoRepeatReport) return;
if (!PlayerRepositories.ContainsKey(SenderID)) {
PlayerRepositories.Add(SenderID, new PlayerRepository {
ReportedList = new Dictionary<UInt64, Double>(), Cooldown = 0
}
);
}
PlayerRepositories[SenderID].AddCooldown(TargetID);
}
private class PlayerRepository {
public Dictionary<UInt64, Double> ReportedList = new Dictionary<UInt64, Double>();
public Double Cooldown;
private Boolean IsReportedPlayer(UInt64 TargetID) => ReportedList.ContainsKey(TargetID);
public Boolean IsRepeatReported(UInt64 TargetID) => config.ReportSendControllerSettings.NoRepeatReport && IsReportedPlayer(TargetID);
public Boolean IsCooldown(UInt64 TargetID) {
if (config.ReportSendControllerSettings.CooldownRepeatOrAll) {
if (IsReportedPlayer(TargetID)) return ReportedList[TargetID] > CurrentTime;
}
else return Cooldown > CurrentTime;
return false;
}
public Int32 GetCooldownLeft(UInt64 TargetID) {
if (config.ReportSendControllerSettings.CooldownRepeatOrAll) {
if (IsReportedPlayer(TargetID)) return Convert.ToInt32(ReportedList[TargetID] - CurrentTime);
}
else return Convert.ToInt32(Cooldown - CurrentTime);
return 0;
}
public void AddCooldown(UInt64 TargetID) {
Int32 TimeCooldown = Convert.ToInt32(config.ReportSendControllerSettings.CooldownReport + CurrentTime);
if (config.ReportSendControllerSettings.CooldownRepeatOrAll || config.ReportSendControllerSettings.NoRepeatReport) {
if (IsReportedPlayer(TargetID)) ReportedList[TargetID] = TimeCooldown;
else ReportedList.Add(TargetID, TimeCooldown);
}
else Cooldown = TimeCooldown;
}
}
private class ProcessCheckRepository {
public String DiscordTarget;
public String DisplayName;
public UInt64 ModeratorID;
}
#endregion
#region Reference
[PluginReference]
Plugin IQChat, ImageLibrary, IQFakeActive, NoEscape, EventHelper, Battles, Duel, Duelist, ArenaTournament, Friends, Clans, MultiFighting, StopDamageMan, RustApp;
#region IQChat
private void SendChat(String Message, BasePlayer player, ConVar.Chat.ChatChannel channel = ConVar.Chat.ChatChannel.Global) {
if (IQChat) if (config.ReferenceSettings.IQChatSetting.UIAlertUse) IQChat?.Call("API_ALERT_PLAYER_UI", player, Message);
else IQChat?.Call("API_ALERT_PLAYER", player, Message, config.ReferenceSettings.IQChatSetting.CustomPrefix, config.ReferenceSettings.IQChatSetting.CustomAvatar);
else player.SendConsoleCommand("chat.add", channel, 0, Message);
}
#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.ReferenceSettings.IQFakeActiveUse) 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;
}
#region IsFake
private String GetFakeName(String idOrName) {
if (!IsReadyIQFakeActive()) return String.Empty;
return (String)IQFakeActive.Call("GetFakeName", idOrName);
}
private Boolean IsFakeUser(String idOrName) {
if (!IsReadyIQFakeActive()) return false;
return (Boolean)IQFakeActive.Call("IsFakeUser", idOrName);
}
#endregion
#endregion
#region NoEscape
private Boolean IsRaidBlock(BasePlayer Target) {
if (!config.ReferenceSettings.NoEscapeSetting.NoCheckedRaidBlock) return false;
if (!NoEscape) {
String ret = Interface.Call("CanTeleport", Target) as String;
return ret != null;
}
Boolean IsRaidBlock = (Boolean)NoEscape.CallHook("IsRaidBlocked", Target);
return IsRaidBlock;
}
private Boolean IsCombatBlock(BasePlayer Target) {
if (!NoEscape) return false;
if (!config.ReferenceSettings.NoEscapeSetting.NoCheckedCombatBlock) return false;
Boolean IsCombatBlock = (Boolean)NoEscape.CallHook("IsCombatBlocked", Target);
return IsCombatBlock;
}
#endregion
#region Duels
public Boolean IsDuel(UInt64 userID) {
if (!config.ReferenceSettings.NoCheckedDuel) return false;
if (EventHelper) {
if ((Boolean)EventHelper.CallHook("EMAtEvent", userID)) return true;
}
if (Battles) return (Boolean)Battles?.Call("IsPlayerOnBattle", userID);
if (Duel) return (Boolean)Duel?.Call("IsPlayerOnActiveDuel", BasePlayer.FindByID(userID));
if (Duelist) return (Boolean)Duelist?.Call("inEvent", BasePlayer.FindByID(userID));
if (ArenaTournament) return ArenaTournament.Call<Boolean>("IsOnTournament", userID);
return false;
}
#endregion
#region Friends
private Boolean IsFriendSendReport(UInt64 userID, UInt64 targetID) => config.ReferenceSettings.FriendsSetting.SendReportFriend && IsFriends(userID, targetID);
private Boolean IsFriendStartChecked(UInt64 userID, UInt64 targetID) => config.ReferenceSettings.FriendsSetting.StartCheckedFriend && IsFriends(userID, targetID);
private Boolean IsFriends(UInt64 userID, UInt64 targetID) {
if (!Friends) return RelationshipManager.ServerInstance.playerToTeam.ContainsKey(userID) && RelationshipManager.ServerInstance.playerToTeam[userID].members.Contains(targetID);
return (Boolean)Friends?.Call("HasFriend", userID, targetID);
}
#endregion
#region Clans
private Boolean IsClansSendReport(String userID, String targetID) => config.ReferenceSettings.ClansSetting.SendReportClan && IsClans(userID, targetID);
private Boolean IsClansStartChecked(String userID, String targetID) => config.ReferenceSettings.ClansSetting.StartCheckedClan && IsClans(userID, targetID);
private Boolean IsClans(String userID, String targetID) {
if (!Clans) return false;
if (!Clans.Author.Contains("dcode")) {
Object result = Clans.Call("IsClanMember", userID, targetID);
if (result == null) return false;
return (Boolean)result;
}
String TagUserID = (String)Clans.Call("GetClanOf", userID);
String TagTargetID = (String)Clans.Call("GetClanOf", targetID);
return TagUserID == TagTargetID;
}
private String GetClanTag(String userID) {
if (Clans) return (String)Clans.Call("GetClanOf", userID);
else return null;
}
private String CorrectedClanName(BasePlayer player) {
String ClanTag = GetClanTag(player.UserIDString);
String pattern = @"\[.*?\]";
String CorrectedResult = ClanTag == null || String.IsNullOrWhiteSpace(ClanTag) ? player.displayName : Regex.Replace(player.displayName, pattern, String.Empty);
if (String.IsNullOrWhiteSpace(CorrectedResult) || CorrectedResult == null) CorrectedResult = player.displayName;
return CorrectedResult;
}
#endregion
#region ImageLibrary
private String GetImage(String fileName, UInt64 skin = 0) {
var imageId = (String)plugins.Find("ImageLibrary").CallHook("GetImage", fileName, skin);
if (!string.IsNullOrEmpty(imageId)) return imageId;
return String.Empty;
}
public Boolean HasImage(String imageName) => (Boolean)ImageLibrary?.Call("HasImage", imageName);
#endregion
#region OzProtect
#region Local Repository
private Dictionary<UInt64, LocalRepositoryOzProtect> OzProtect_LocalRepository = new Dictionary<UInt64, LocalRepositoryOzProtect>();
internal class LocalRepositoryOzProtect {
public List<String> LastBansServers = new List<String>();
}
#endregion
#region JSON
public class OzResponse {
public int unixtime {
get;
set;
}
public string reason {
get;
set;
}
public string proofid {
get;
set;
}
public bool pirate {
get;
set;
}
public bool active {
get;
set;
}
public bool reliable {
get;
set;
}
public bool unnecessary {
get;
set;
}
public OzServer server {
get;
set;
}
public string admin {
get;
set;
}
public int game {
get;
set;
}
public string date {
get;
set;
}
public int bantime {
get;
set;
}
}
public class OzResult {
public string status {
get;
set;
}
public List<OzResponse> response {
get;
set;
}
}
public class OzServer {
public string name {
get;
set;
}
public string ico {
get;
set;
}
public string overlay {
get;
set;
}
public string desc {
get;
set;
}
public string site {
get;
set;
}
public bool pirate {
get;
set;
}
public int game {
get;
set;
}
public string ip {
get;
set;
}
}
#endregion
private void BanPlayerOzProtect(UInt64 TargetID, UInt64 ModerID, String ReasonBan) {
if (String.IsNullOrWhiteSpace(config.ReferenceSettings.OzProtectSettings.OzProtectKey)) return;
String API = $"https://api.ozliginus.ru/methods/ozprotect.useredit?admin={ModerID}&steamid={TargetID}&method=ban&reason={ReasonBan}&ozprotectid={config.ReferenceSettings.OzProtectSettings.OzProtectKey}";
try {
webrequest.Enqueue(API, null, (code, response) => {
}
, this);
}
catch (Exception e) {
PrintError(LanguageEn ? "OzProtect : We were unable to block the player using OzProtect, please check if your key is up to date or if OzProtect is available" : "OzProtect : Мы не смогли заблокировать игрока с помощью OzProtect, проверьте актуальность вашего ключа или доступность OzProtect");
}
}
private void GetPlayerCheckServerOzProtect(UInt64 TargetID) {
if (String.IsNullOrWhiteSpace(config.ReferenceSettings.OzProtectSettings.OzProtectKey)) return;
if (OzProtect_LocalRepository.ContainsKey(TargetID)) return;
String API = $"https://api.ozliginus.ru/methods/ozprotect.getbans?steamid={TargetID}&ozprotectid={config.ReferenceSettings.OzProtectSettings.OzProtectKey}";
try {
webrequest.Enqueue(API, null, (code, response) => {
OzResult resources = JsonConvert.DeserializeObject<OzResult>(response);
if (resources.response == null || !resources.status.Equals("success")) return;
OzProtect_LocalRepository.Add(TargetID, new LocalRepositoryOzProtect());
foreach (OzResponse ozResponse in resources.response) {
if (!OzProtect_LocalRepository[TargetID].LastBansServers.Contains(ozResponse.server.name)) OzProtect_LocalRepository[TargetID].LastBansServers.Add(ozResponse.server.name);
}
}
, this);
}
catch (Exception e) {
PrintError(LanguageEn ? "OzProtect : We couldn't find player information with OzProtect, please check if your key is up to date or if OzProtect is available" : "OzProtect : Мы не смогли найти информацию об игроке с помощью OzProtect, проверьте актуальность вашего ключа или доступность OzProtect");
}
}
private void StartCheckOzProtect(UInt64 TargetID, UInt64 ModerID) {
if (ModerID == 0) return;
if (String.IsNullOrWhiteSpace(config.ReferenceSettings.OzProtectSettings.OzProtectKey)) return;
String API = $"https://api.ozliginus.ru/methods/ozprotect.call?checking={ModerID}&suspect={TargetID}&ozprotectid={config.ReferenceSettings.OzProtectSettings.OzProtectKey}&minutes=30";
try {
webrequest.Enqueue(API, null, (code, response) => {
}
, this);
}
catch (Exception e) {
PrintError(LanguageEn ? "OzProtect : We were unable to get the player to check with OzProtect, please check if your key is up to date or if OzProtect is available" : "OzProtect : Мы не смогли вызвать игрока на проверку с помощью OzProtect, проверьте актуальность вашего ключа или доступность OzProtect");
}
}
private List<String> GetServersBansOzProtect(UInt64 TargetID) {
if (String.IsNullOrWhiteSpace(config.ReferenceSettings.OzProtectSettings.OzProtectKey)) return null;
return !OzProtect_LocalRepository.ContainsKey(TargetID) ? new List<String>() : OzProtect_LocalRepository[TargetID].LastBansServers;
}
#endregion
#region RustCheatCheck
#region Local Repository
private Dictionary<UInt64, LocalRepositoryRCC> RCC_LocalRepository = new Dictionary<UInt64, LocalRepositoryRCC>();
internal class LocalRepositoryRCC {
public List<String> LastChecksServers = new List<String>();
public List<String> LastBansServers = new List<String>();
}
#endregion
#region JSON
private class Response {
public List<String> last_ip;
public String last_nick;
public List<UInt64> another_accs;
public List<last_checks> last_check;
public class last_checks {
public UInt64 moderSteamID;
public String serverName;
public Int32 time;
}
public List<RustCCBans> bans;
public class RustCCBans {
public Int32 banID;
public String reason;
public String serverName;
public Int32 OVHserverID;
public Int32 banDate;
}
}
#endregion
private void BanPlayerRCC(UInt64 TargetID, String ReasonBan) {
if (String.IsNullOrWhiteSpace(config.ReferenceSettings.RCCSettings.RCCKey)) return;
String API = $"https://rustcheatcheck.ru/panel/api?action=addBan&key={config.ReferenceSettings.RCCSettings.RCCKey}&player={TargetID}&reason={ReasonBan}";
try {
webrequest.Enqueue(API, null, (code, response) => {
}
, this);
}
catch (Exception e) {
PrintError(LanguageEn ? "RCC : We were unable to block the player using RCC, please check if your key is up to date or if RCC is available" : "RCC : Мы не смогли заблокировать игрока с помощью RCC, проверьте актуальность вашего ключа или доступность RCC");
}
}
private void StartCheckRCC(UInt64 TargetID, UInt64 ModerID) {
if (String.IsNullOrWhiteSpace(config.ReferenceSettings.RCCSettings.RCCKey)) return;
String API = $"https://rustcheatcheck.ru/panel/api?action=addPlayer&key={config.ReferenceSettings.RCCSettings.RCCKey}&player={TargetID}";
if (ModerID != 0) API += $"&moder={ModerID}";
try {
webrequest.Enqueue(API, null, (code, response) => {
}
, this);
}
catch (Exception e) {
PrintError(LanguageEn ? "RCC : We were unable to get the player to check with RCC, please check if your key is up to date or if RCC is available" : "RCC : Мы не смогли вызвать игрока на проверку с помощью RCC, проверьте актуальность вашего ключа или доступность RCC");
}
}
private List<String> GetServersCheckRCC(UInt64 TargetID) {
if (String.IsNullOrWhiteSpace(config.ReferenceSettings.RCCSettings.RCCKey)) return null;
return !RCC_LocalRepository.ContainsKey(TargetID) ? new List<String>() : RCC_LocalRepository[TargetID].LastChecksServers;
}
private List<String> GetServersBansRCC(UInt64 TargetID) {
if (String.IsNullOrWhiteSpace(config.ReferenceSettings.RCCSettings.RCCKey)) return null;
return !RCC_LocalRepository.ContainsKey(TargetID) ? new List<String>() : RCC_LocalRepository[TargetID].LastBansServers;
}
private void GetPlayerCheckServerRCC(UInt64 TargetID) {
if (String.IsNullOrWhiteSpace(config.ReferenceSettings.RCCSettings.RCCKey)) return;
if (RCC_LocalRepository.ContainsKey(TargetID)) return;
String API = $"https://rustcheatcheck.ru/panel/api?action=getInfo&key={config.ReferenceSettings.RCCSettings.RCCKey}&player={TargetID}";
try {
webrequest.Enqueue(API, null, (code, response) => {
Response resources = JsonConvert.DeserializeObject<Response>(response);
if (resources.last_check == null) return;
RCC_LocalRepository.Add(TargetID, new LocalRepositoryRCC());
RCC_LocalRepository[TargetID].LastChecksServers.AddRange(resources.last_check.Select(resource => resource.serverName));
RCC_LocalRepository[TargetID].LastBansServers.AddRange(resources.bans.Select(resource => resource.serverName));
}
, this);
}
catch (Exception ex) {
PrintError(LanguageEn ? "RCC : We couldn't find player information with RCC, please check if your key is up to date or if RCC is available" : "RCC : Мы не смогли найти информацию об игроке с помощью RCC, проверьте актуальность вашего ключа или доступность RCC");
}
}
#endregion
#region IsSteam / MultiFighting
private Boolean IsSteam(String id) {
if (MultiFighting == null) return true;
BasePlayer player = BasePlayer.Find(id);
if (player == null) return false;
Object obj = MultiFighting.CallHook("IsSteam", player.Connection);
if (obj is Boolean) return (Boolean)obj;
return false;
}
#endregion
#region StopDamageMan
private void StopDamageAdd(BasePlayer player) {
if (StopDamageMan == null) return;
if (!config.ReferenceSettings.StopDamageManSetting.UseStopDamage) return;
StopDamageMan.CallHook("AddPlayerSDM", player);
SendChat(GetLang("FUNCIONAL_PLAYER_STOP_DAMAGE_MAN_ADD", player.UserIDString), player);
}
private void StopDamageRemove(UInt64 playerID) {
if (StopDamageMan == null) return;
if (!config.ReferenceSettings.StopDamageManSetting.UseStopDamage) return;
StopDamageMan.CallHook("RemovePlayerSDM", playerID);
}
#endregion
#endregion
#region Configuration
private static Configuration config = new Configuration();
private class Configuration {
[JsonProperty(LanguageEn ? "Setting up compatibility with IQReportSystemr" : "Настройка совместимостей с IQReportSystem")]
public References ReferenceSettings = new References();
[JsonProperty(LanguageEn ? "Color setting" : "Настройка цветов")]
public Colors ColorsSettings = new Colors();
[JsonProperty(LanguageEn ? "List of reports and reasons for blocking" : "Список жалоб и причин блокировки")]
public List<ReasonReport> ReasonList = new List<ReasonReport>();
[JsonProperty(LanguageEn ? "Setting up sending complaints via F7 or the RUST game menu" : "Настройка отправки жалоб через F7 или игровое меню RUST")]
public ReportF7AndGameMenu ReportF7AndGameMenuSettings = new ReportF7AndGameMenu();
[JsonProperty(LanguageEn ? "Setting up the Player check process" : "Настройка процесса проверки игрока")]
public CheckController CheckControllerSettings = new CheckController();
[JsonProperty(LanguageEn ? "Setting up moderator notifications and the maximum number of reports" : "Настройка уведомления модераторов и максимального количества репортов")]
public ReportContollerModeration ReportContollerModerationSettings = new ReportContollerModeration();
[JsonProperty(LanguageEn ? "Setting up sending complaints by players" : "Настройка отправки жалоб игроками")]
public ReportSendController ReportSendControllerSettings = new ReportSendController();
[JsonProperty(LanguageEn ? "Additional verdict setting" : "Дополнительная настройка вынесения вердикта")]
public VerdictController VerdictControllerSettings = new VerdictController();
[JsonProperty(LanguageEn ? "Setting up an automatic ban based on the number of reports" : "Настройка автома-бана по кол-во репортов")]
public AutoBan AutoBanSettings = new AutoBan();
[JsonProperty(LanguageEn ? "Configuring notifications for all players about actions in the plugin" : "Настройка уведомлений для всех игроков о действиях в плагине")]
public NotifyChat NotifyChatSettings = new NotifyChat();
[JsonProperty(LanguageEn ? "Setting up notifications in Discord" : "Настройка уведомлений в Discord")]
public NotifyDiscord NotifyDiscordSettings = new NotifyDiscord();
[JsonProperty(LanguageEn ? "Setting up notifications in VK" : "Настройка уведомлений в VK")]
public NotifyVK NotifyVKSettings = new NotifyVK();
[JsonProperty(LanguageEn ? "Command to send data when calling for verification (console and chat)" : "Команда для отправки данных при вызове на проверку (консольная и чатовая)")]
public String CommandForContact;
internal class AutoBan {
[JsonProperty(LanguageEn ? "Use auto-bans based on the number of reports" : "Использовать авто-баны по количеству репортов")]
public Boolean UseAutoBan;
[JsonProperty(LanguageEn ? "Auto-bans will ONLY apply to pirates (Luma) - true, otherwise to all players - false" : "Авто-баны будут действовать ТОЛЬКО на пиратов (Luma) - true, иначе на всех игроков - false")]
public Boolean UseOnlyLuma;
[JsonProperty(LanguageEn ? "Maximum number of reports for issuing automatic blocking" : "Максимальное количество репортов для выдачи автоматической блокировки")]
public Int32 MaxReports;
[JsonProperty(LanguageEn ? "Index from the list of complaints when a player is blocked (From your list - starts from 0)" : "Индекс из списка жалоб при блокировки игрока (Из вашего списка - начинается от 0)")]
public Int32 IndexBanned;
}
internal class VerdictController {
[JsonProperty(LanguageEn ? "Banned all the `Friends` of a player who has been given a verdict by a moderator (true - yes/false - no)" : "Блокировать всех `Друзей` игрока, которому вынес вердикт модератор (true - да/false - нет)")]
public Boolean UseBanAllTeam;
[JsonProperty(LanguageEn ? "Index from the list of complaints when blocking a player's `Friends` (From your list - starts from 0)" : "Индекс из списка жалоб при блокировки `Друзей` игрока (Из вашего списка - начинается от 0)")]
public Int32 IndexBanReason;
}
internal class CheckController {
[JsonProperty(LanguageEn ? "Use sound notification for players when calling for verification (true - yes / false - no) [You must upload sound files to the IQSystem/IQReportSystem/Sounds folder]" : "Использовать звуковое оповещение для игроков при вызове на проверку (true - да/false - нет) [Вы должны загрузить файлы со звуком в папку IQSystem/IQReportSystem/Sounds]")]
public Boolean UseSoundAlert;
[JsonProperty(LanguageEn ? "Record a demos of the player during his check" : "Записывать демо игрока во время его проверки")]
public Boolean UseDemo;
[JsonProperty(LanguageEn ? "Use AFK validation before calling for check (true - yes / false - no)" : "Использовать проверку на AFK перед вызовом на проверку (true - да/false - нет)")]
public Boolean UseCheckAFK;
[JsonProperty(LanguageEn ? "Cancel check for a player automatically with saving reports if he left the server for 15 minutes or more (true - yes/false - no)" : "Отменять проверку игроку автоматически с сохранением репортов если он покинул сервер на 15 минут и более (true - да/false - нет)")]
public Boolean StopCheckLeavePlayer;
[JsonProperty(LanguageEn ? "Use tracking of crafting of invaders by the player (will notify the moderator about it) (true - yes / false - no)" : "Использовать отслеживание крафта предметов игроком (будет уведомлять модератора об этом) (true - да/false - нет)")]
public Boolean TrackCrafting;
[JsonProperty(LanguageEn ? "Use tracking of messages sent to the chat by the player (will notify the moderator about it) (true - yes / false - no)" : "Использовать отслеживание отправки сообщений в чат игроком (будет уведомлять модератора об этом) (true - да/false - нет)")]
public Boolean TrackChat;
[JsonProperty(LanguageEn ? "Use player command usage tracking (will notify the moderator about it) (true - yes / false - no)" : "Использовать отслеживание использования команд игроком (будет уведомлять модератора об этом) (true - да/false - нет)")]
public Boolean TrackCommand;
}
internal class ReportContollerModeration {
[JsonProperty(LanguageEn ? "Maximum number of reports to display the player in the moderator menu and moderator notifications" : "Максимальное количество репортов для отображения игрока в меню модератора и уведомления модератора")]
public Int32 ReportCountTrigger;
[JsonProperty(LanguageEn ? "Setting up moderator notifications about the maximum number of player reports" : "Настройка уведомления модератора о максимальном количестве репортов игрока")]
public AlertModeration AlertModerationSettings = new AlertModeration();
internal class AlertModeration {
[JsonProperty(LanguageEn ? "Notify the moderator that the player has scored the maximum number of reports" : "Уведомлять модератора о том, что игрок набрал максимальное количество репортов")]
public Boolean AlertModerator;
[JsonProperty(LanguageEn ? "Enable an audio notification to the moderator during the notification of the number of reports" : "Включать звуковое уведомление модератору во время уведомления о количестве репортов")]
public Boolean AlertSound;
[JsonProperty(LanguageEn ? "The path to the notification sound (this is the path of the prefab of the game - you can see here : https://github.com/OrangeWulf/Rust-Docs/blob/master/Extended/Effects.md)" : "Путь до звука уведомления (это путь префаба игры - посмотреть можно тут : https://github.com/OrangeWulf/Rust-Docs/blob/master/Extended/Effects.md)")]
public String PathSound;
}
}
internal class ReportSendController {
[JsonProperty(LanguageEn ? "Prohibit a player from sending a complaint against one player several times (true - yes/false - no)" : "Запретить игроку несколько раз отправлять жалобу на одного игрока (true - да/false - нет)")]
public Boolean NoRepeatReport;
[JsonProperty(LanguageEn ? "Cooldown before sending a complaint to the players (in seconds) (if you don't need a recharge, leave 0)" : "Перезарядка перед отправкой жалобы на игроков (в секундах) (если вам не нужна перезарядка - оставьте 0)")]
public Int32 CooldownReport;
[JsonProperty(LanguageEn ? "Use cooldown before sending a complaint only for a repeated complaint against one player (true) otherwise for all players (false)" : "Использовать перезарядку перед отправкой жалобы только на повторную жалобу на одного игрока (true) иначе на всех игроков (false)")]
public Boolean CooldownRepeatOrAll;
}
internal class ReportF7AndGameMenu {
[JsonProperty(LanguageEn ? "Use sending report via F7 and the RUST game menu (true - yes/false - no)" : "Использовать отправку жалоб через F7 и игровое меню RUST (true - да/false - нет)")]
public Boolean UseFunction;
[JsonProperty(LanguageEn ? "Index from the list of complaints when sent via F7 and the RUST game menu (From your list - starts from 0)" : "Индекс из списка жалоб при отправке через F7 и игровое меню RUST (Из вашего списка - начинается от 0)")]
public Int32 DefaultIndexReason;
}
internal class NotifyChat {
[JsonProperty(LanguageEn ? "Notify players when a moderator has started checking a player (configurable in the language file)" : "Уведомлять игроков о том, что модератор начал проверку игрока (настраивается в языковом файле)")]
public Boolean UseNotifyCheck;
[JsonProperty(LanguageEn ? "Notify players when a moderator has finished checking a player (configurable in the language file)" : "Уведомлять игроков о том, что модератор завершил проверку игрока (настраивается в языковом файле)")]
public Boolean UseNotifyStopCheck;
[JsonProperty(LanguageEn ? "Notify players that the moderator has completed the verification of the player and issued a verdict (banned) (configurable in the language file)" : "Уведомлять игроков о том, что модератор завершил проверку игрока и вынес вердикт (забанил) (настраивается в языковом файле)")]
public Boolean UseNotifyVerdictCheck;
[JsonProperty(LanguageEn ? "Notify the player who sent the complaint about the verdict (if the player is offline, he will be notified upon entry)" : "Уведомлять игрока, который отправил жалобу о вынесенном вердикте (если игрок оффлайн - при входе его уведомит)")]
public Boolean UseNotifyVerdictBanned;
}
internal class NotifyVK {
[JsonProperty(LanguageEn ? "Token from the VK group (you can find it in the community settings)" : "Токен от группы ВК (вы можете найти его в настройках сообщества)")]
public String VKTokenGroup;
[JsonProperty(LanguageEn ? "ID of the conversation the bot is invited to (countdown starts from 1 - every new conversation +1)" : "ID беседы в которую приглашен бот (отсчет начинается с 1 - каждую новую беседу +1)")]
public String VKChatID;
}
internal class NotifyDiscord {
[JsonProperty(LanguageEn ? "Set up WebHooks to send to Discord (if you don't need this feature - leave the field blank)" : "Настройка WebHooks для отправки в Discord (если вам не нужна эта функция - оставьте поле пустым)")]
public Webhooks WebhooksList = new Webhooks();
[JsonProperty(LanguageEn ? "Setting up additional information from Steam (the number of hours in RUST for logs in DS)" : "Настройка дополнительной информации из Steam (количество часов в RUST для логов в DS)")]
public SteamData steamData = new SteamData();
internal class SteamData {
[JsonProperty("SteamApiKey (https://steamcommunity.com/dev/apikey)")]
public String steamApiKey;
}
internal class Webhooks {
internal class TemplatesNotify {
[JsonProperty("Webhook")]
public String WebhookNotify;
[JsonProperty(LanguageEn ? "Discord message color (Can be found on the website - https://old.message.style/dashboard in the JSON section)" : "Цвет сообщения в Discord (Можно найти на сайте - https://old.message.style/dashboard в разделе JSON)")]
public Int32 Color;
[JsonProperty(LanguageEn ? "Title message" : "Заголовок сообщения")]
public String AuthorName;
[JsonProperty(LanguageEn ? "Link to the icon for the avatar of the message" : "Ссылка на иконку для аватарки сообщения")]
public String IconURL;
}
[JsonProperty(LanguageEn ? "WebHook : Setting up sending information about the start of a check" : "WebHook : Настройка отправки информации о начале проверки")]
public TemplatesNotify NotifyStartCheck = new TemplatesNotify();
[JsonProperty(LanguageEn ? "WebHook : Setting up sending information about the stop of a check" : "WebHook : Настройка отправки информации о завершении проверки")]
public TemplatesNotify NotifyStopCheck = new TemplatesNotify();
[JsonProperty(LanguageEn ? "WebHook : Settings for sending player contact information (when a player sends their Discord)" : "WebHook : Настройка отправки информации о контактах игрока (когда игрок отправляет свой Discord)")]
public TemplatesNotify NotifyContacts = new TemplatesNotify();
[JsonProperty(LanguageEn ? "WebHook : Setting up sending information about player complaints" : "WebHook : Настройка отправки информации о жалобах игроков")]
public TemplatesNotify NotifySendReport = new TemplatesNotify();
[JsonProperty(LanguageEn ? "WebHook : Setting up sending information when a player has exceeded the maximum number of complaints" : "WebHook : Настройка отправки информации когда игрок превысил максимальное количество жалоб")]
public TemplatesNotify NotifyMaxReport = new TemplatesNotify();
[JsonProperty(LanguageEn ? "WebHook : Setting up sending information about changing the status of the player and moderator" : "WebHook : Настройка отправки информации о изменении статуса игрока и модератора")]
public TemplatesNotify NotifyStatusPlayerOrModerator = new TemplatesNotify();
}
}
internal class ReasonReport {
[JsonProperty(LanguageEn ? "Reason" : "Причина")]
public LangText Title;
[JsonProperty(LanguageEn ? "Kick a player from the server (true - yes/false - no)" : "Кикать игрока с сервера (true - да/false - нет)")]
public Boolean KickUser;
[JsonProperty(LanguageEn ? "The command from your ban system to block the user ({0} - will be replaced by the player's ID)" : "Команда вашей бан-системы на блокировку пользователя ({0} - заменится на ID игрока)")]
public String BanCommand;
[JsonProperty(LanguageEn ? "Hide this reason from the player (true) (will only be seen by the moderator when passing a verdict)" : "Скрыть данную причину от игрока (true) (будет видеть только модератор при вынесении вердикта)")]
public Boolean HideUser;
}
internal class Colors {
[JsonProperty(LanguageEn ? "RGBA of the main text color" : "RGBA основного цвета текста")]
public String MainColorText;
[JsonProperty(LanguageEn ? "RGBA of additional text color" : "RGBA дополнительного цвета текста")]
public String AdditionalColorText;
[JsonProperty(LanguageEn ? "RGBA additional color of elements (Buttons, dies)" : "RGBA дополнительный цвет элементов (Кнопки, плашки)")]
public String AdditionalColorElements;
[JsonProperty(LanguageEn ? "RGBA additional color of elements (Buttons, dies) #2" : "RGBA дополнительный цвет элементов (Кнопки, плашки) #2")]
public String AdditionalColorElementsTwo;
[JsonProperty(LanguageEn ? "RGBA additional color of elements (Buttons, dies) #3" : "RGBA дополнительный цвет элементов (Кнопки, плашки) #3")]
public String AdditionalColorElementsThree;
[JsonProperty(LanguageEn ? "RGBA the main color" : "RGBA основной цвет")]
public String MainColor;
}
internal class References {
[JsonProperty(LanguageEn ? "IQFakeActive : Use collaboration (true - yes/false - no)" : "IQFakeActive : Использовать совместную работу (true - да/false - нет)")]
public Boolean IQFakeActiveUse;
[JsonProperty(LanguageEn ? "Setting up IQChat" : "Настройка IQChat")]
public IQChatReference IQChatSetting = new IQChatReference();
[JsonProperty(LanguageEn ? "Setting up NoEscape" : "Настройка NoEscape")]
public NoEscapeReference NoEscapeSetting = new NoEscapeReference();
[JsonProperty(LanguageEn ? "Duels : Reschedule the player's check if he is in a duel (true - yes/false - no)" : "Duels : Перенести проверку игрока если он на дуэли (true - да/false - нет)")]
public Boolean NoCheckedDuel;
[JsonProperty(LanguageEn ? "Setting up Friends" : "Настройка Friends")]
public FriendsReference FriendsSetting = new FriendsReference();
[JsonProperty(LanguageEn ? "Setting up Clans" : "Настройка Clans")]
public ClansReference ClansSetting = new ClansReference();
[JsonProperty(LanguageEn ? "Setting up MultiFighting (Luma)" : "Настройка MultiFighting (Luma)")]
public MultiFighting MultiFightingSetting = new MultiFighting();
[JsonProperty(LanguageEn ? "Setting up StopDamageMan" : "Настройка StopDamageMan")]
public StopDamageMan StopDamageManSetting = new StopDamageMan();
[JsonProperty(LanguageEn ? "Setting up RCC support" : "Настройка поддержки RCC")]
public RustCheatCheck RCCSettings = new RustCheatCheck();
[JsonProperty(LanguageEn ? "Setting up OzProtect support" : "Настройка поддержки OzProtect")]
public OzProtectCheck OzProtectSettings = new OzProtectCheck();
internal class MultiFighting {
[JsonProperty(LanguageEn ? "MultiFighting (Luma) : Display an icon with the player status - `Steam` / `Pirate`" : "MultiFighting (Luma) : Отображать иконку со статусом игрока - `Steam` / `Пират`")]
public Boolean UseSteamCheck;
}
internal class StopDamageMan {
[JsonProperty(LanguageEn ? "StopDamageMan : Disable player damage during check" : "StopDamageMan : Отключать игроку урон во время проверки")]
public Boolean UseStopDamage;
}
internal class RustCheatCheck {
[JsonProperty(LanguageEn ? "RCC key (if you don't need RCC support, leave the key blank)" : "Ключ RCC (если вам не нужна поддержка RCC - оставьте ключ пустым)")]
public String RCCKey;
}
internal class OzProtectCheck {
[JsonProperty(LanguageEn ? "OzProtect key (if you don't need OzProtect support, leave the key blank)" : "Ключ OzProtect (если вам не нужна поддержка OzProtect - оставьте ключ пустым)")]
public String OzProtectKey;
}
internal class IQChatReference {
[JsonProperty(LanguageEn ? "IQChat : Custom prefix in chat" : "IQChat : Кастомный префикс в чате")]
public String CustomPrefix;
[JsonProperty(LanguageEn ? "IQChat : Custom chat avatar (If required)" : "IQChat : Кастомный аватар в чате(Если требуется)")]
public String CustomAvatar;
[JsonProperty(LanguageEn ? "IQChat : Use UI notification (true - yes/false - no)" : "IQChat : Использовать UI уведомление (true - да/false - нет)")]
public Boolean UIAlertUse;
}
internal class NoEscapeReference {
[JsonProperty(LanguageEn ? "NoEscape : Reschedule a player's check if he has a `Raid-Block` (true - yes/false - no)" : "NoEscape : Перенести проверку игрока если у него есть `Raid-Блок` (true - да/false - нет)")]
public Boolean NoCheckedRaidBlock;
[JsonProperty(LanguageEn ? "NoEscape : Reschedule a player's check if he has a `Combat-Block` (true - yes/false - no)" : "NoEscape : Перенести проверку игрока если у него есть `Комбат-Блок` (true - да/false - нет)")]
public Boolean NoCheckedCombatBlock;
}
internal class FriendsReference {
[JsonProperty(LanguageEn ? "Friends : Prohibit players in the team from sending reports to each other (true - yes/false - no)" : "Friends : Запретить игрокам в команде отправлять репорты друг на друга (true - да/false - нет)")]
public Boolean SendReportFriend;
[JsonProperty(LanguageEn ? "Friends : Prohibit the moderator from checking his teammate (true - yes/false - no)" : "Friends : Запретить модератору проверять своего тиммейта (true - да/false - нет)")]
public Boolean StartCheckedFriend;
}
internal class ClansReference {
[JsonProperty(LanguageEn ? "Clans : Prohibit players in the same clan from sending reports to each other (true - yes/false - no)" : "Clans : Запретить игрокам в одном клане отправлять репорты друг на друга (true - да/false - нет)")]
public Boolean SendReportClan;
[JsonProperty(LanguageEn ? "Clans : Prohibit the moderator from checking the members of his clan (true - yes/false - no)" : "Clans : Запретить модератору проверять участников своего клана (true - да/false - нет)")]
public Boolean StartCheckedClan;
}
}
internal class LangText {
[JsonProperty(LanguageEn ? "Reason title russian" : "Причина на русском")]
public String LanguageRU;
[JsonProperty(LanguageEn ? "Reason title english" : "Причина на английском")]
public String LanguageEN;
public String GetReasonTitle(UInt64 TargetID) => _.lang.GetLanguage(TargetID.ToString()).Equals("ru") ? LanguageRU : LanguageEN;
}
public static Configuration GetNewConfiguration() {
return new Configuration {
CommandForContact = "discord", VerdictControllerSettings = new VerdictController() {
UseBanAllTeam = false, IndexBanReason = 5,
}
, AutoBanSettings = new AutoBan {
UseAutoBan = false, UseOnlyLuma = true, MaxReports = 7, IndexBanned = 2
}
, CheckControllerSettings = new CheckController {
StopCheckLeavePlayer = false, UseDemo = true, UseSoundAlert = false, UseCheckAFK = true, TrackCrafting = false, TrackChat = false, TrackCommand = false,
}
, NotifyChatSettings = new NotifyChat() {
UseNotifyCheck = true, Use
// ... [Code preview truncated due to length. Full source in attached file] ...