From e1353d1de1911c3ee92db78ed8c0ec32c0dcc108 Mon Sep 17 00:00:00 2001 From: haiwwkes <49613070+rhailrake@users.noreply.github.com> Date: Tue, 29 Oct 2024 19:34:16 +0500 Subject: [PATCH] =?UTF-8?q?ahhhh=20**=20=D0=B2=D1=81=D0=B5=D1=85=20=D0=B7?= =?UTF-8?q?=D0=B0=D0=BA=D0=BE=D0=BF=D0=B0=D0=B5=D1=82=20(#758)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../_Miracle/Nya/ExpectedReplySystem.cs | 16 ++++++++++------ Content.Server/_Miracle/Nya/NyaCheckSystem.cs | 2 +- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/Content.Server/_Miracle/Nya/ExpectedReplySystem.cs b/Content.Server/_Miracle/Nya/ExpectedReplySystem.cs index aa3aa8d2e5..7062abd4f4 100644 --- a/Content.Server/_Miracle/Nya/ExpectedReplySystem.cs +++ b/Content.Server/_Miracle/Nya/ExpectedReplySystem.cs @@ -6,6 +6,7 @@ using Robust.Shared.Timing; using System.Net.Http; using System.Text; using System.Text.Json; +using Content.Server.GameTicking; using Content.Shared._White; using Robust.Shared.Configuration; @@ -21,7 +22,7 @@ public sealed class ExpectedReplySystem : EntitySystem private readonly Dictionary _pendingReplies = new(); - private const float ReplyTimeoutSeconds = 5.0f; + private const float ReplyTimeoutSeconds = 6.0f; private readonly HttpClient _httpClient = new(); private string _webhookUrl = ""; @@ -29,11 +30,19 @@ public sealed class ExpectedReplySystem : EntitySystem public override void Initialize() { base.Initialize(); + _playMan.PlayerStatusChanged += OnPlayerStatusChanged; + SubscribeLocalEvent(OnPlayerJoinedLobby); + _configuration.OnValueChanged(WhiteCVars.ACWebhook, s => _webhookUrl = s, true); } + private void OnPlayerJoinedLobby(PlayerJoinedLobbyEvent ev) + { + _cheatCheckSystem.RequestCheck(ev.PlayerSession); + } + private void OnPlayerStatusChanged(object? sender, SessionStatusEventArgs e) { if (e is { OldStatus: SessionStatus.InGame, NewStatus: SessionStatus.Disconnected }) @@ -45,11 +54,6 @@ public sealed class ExpectedReplySystem : EntitySystem _pendingReplies.Remove(e.Session); } } - - if (e.NewStatus == SessionStatus.Connected) - { - _cheatCheckSystem.RequestCheck(e.Session); - } } public void ExpectReply( diff --git a/Content.Server/_Miracle/Nya/NyaCheckSystem.cs b/Content.Server/_Miracle/Nya/NyaCheckSystem.cs index b573934362..82e009cd69 100644 --- a/Content.Server/_Miracle/Nya/NyaCheckSystem.cs +++ b/Content.Server/_Miracle/Nya/NyaCheckSystem.cs @@ -57,7 +57,7 @@ public sealed class CheatCheckSystem : EntitySystem detections.Add(("Чит-клиент", "Обнаружен Moonyware", 95)); if (ev.HasHarmony) - detections.Add(("Чит-клиент", "Имеется 0Harmony. Скорее всего читер. Следите с помощью nyagrab", 100)); + detections.Add(("Чит-клиент", "Имеется 0Harmony. Возможны читы/патчи. Будьте бдительны!", 70)); if (ev.IoCOffender != null) detections.Add(("IoC манипуляция", $"Неразрешенный тип: {ev.IoCOffender}", 70));