ahhhh ** всех закопает (#758)
This commit is contained in:
@@ -6,6 +6,7 @@ using Robust.Shared.Timing;
|
|||||||
using System.Net.Http;
|
using System.Net.Http;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Text.Json;
|
using System.Text.Json;
|
||||||
|
using Content.Server.GameTicking;
|
||||||
using Content.Shared._White;
|
using Content.Shared._White;
|
||||||
using Robust.Shared.Configuration;
|
using Robust.Shared.Configuration;
|
||||||
|
|
||||||
@@ -21,7 +22,7 @@ public sealed class ExpectedReplySystem : EntitySystem
|
|||||||
|
|
||||||
private readonly Dictionary<ICommonSession, PendingReply> _pendingReplies = new();
|
private readonly Dictionary<ICommonSession, PendingReply> _pendingReplies = new();
|
||||||
|
|
||||||
private const float ReplyTimeoutSeconds = 5.0f;
|
private const float ReplyTimeoutSeconds = 6.0f;
|
||||||
private readonly HttpClient _httpClient = new();
|
private readonly HttpClient _httpClient = new();
|
||||||
|
|
||||||
private string _webhookUrl = "";
|
private string _webhookUrl = "";
|
||||||
@@ -29,11 +30,19 @@ public sealed class ExpectedReplySystem : EntitySystem
|
|||||||
public override void Initialize()
|
public override void Initialize()
|
||||||
{
|
{
|
||||||
base.Initialize();
|
base.Initialize();
|
||||||
|
|
||||||
_playMan.PlayerStatusChanged += OnPlayerStatusChanged;
|
_playMan.PlayerStatusChanged += OnPlayerStatusChanged;
|
||||||
|
|
||||||
|
SubscribeLocalEvent<PlayerJoinedLobbyEvent>(OnPlayerJoinedLobby);
|
||||||
|
|
||||||
_configuration.OnValueChanged(WhiteCVars.ACWebhook, s => _webhookUrl = s, true);
|
_configuration.OnValueChanged(WhiteCVars.ACWebhook, s => _webhookUrl = s, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void OnPlayerJoinedLobby(PlayerJoinedLobbyEvent ev)
|
||||||
|
{
|
||||||
|
_cheatCheckSystem.RequestCheck(ev.PlayerSession);
|
||||||
|
}
|
||||||
|
|
||||||
private void OnPlayerStatusChanged(object? sender, SessionStatusEventArgs e)
|
private void OnPlayerStatusChanged(object? sender, SessionStatusEventArgs e)
|
||||||
{
|
{
|
||||||
if (e is { OldStatus: SessionStatus.InGame, NewStatus: SessionStatus.Disconnected })
|
if (e is { OldStatus: SessionStatus.InGame, NewStatus: SessionStatus.Disconnected })
|
||||||
@@ -45,11 +54,6 @@ public sealed class ExpectedReplySystem : EntitySystem
|
|||||||
_pendingReplies.Remove(e.Session);
|
_pendingReplies.Remove(e.Session);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (e.NewStatus == SessionStatus.Connected)
|
|
||||||
{
|
|
||||||
_cheatCheckSystem.RequestCheck(e.Session);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void ExpectReply<TRequest, TResponse>(
|
public void ExpectReply<TRequest, TResponse>(
|
||||||
|
|||||||
@@ -57,7 +57,7 @@ public sealed class CheatCheckSystem : EntitySystem
|
|||||||
detections.Add(("Чит-клиент", "Обнаружен Moonyware", 95));
|
detections.Add(("Чит-клиент", "Обнаружен Moonyware", 95));
|
||||||
|
|
||||||
if (ev.HasHarmony)
|
if (ev.HasHarmony)
|
||||||
detections.Add(("Чит-клиент", "Имеется 0Harmony. Скорее всего читер. Следите с помощью nyagrab", 100));
|
detections.Add(("Чит-клиент", "Имеется 0Harmony. Возможны читы/патчи. Будьте бдительны!", 70));
|
||||||
|
|
||||||
if (ev.IoCOffender != null)
|
if (ev.IoCOffender != null)
|
||||||
detections.Add(("IoC манипуляция", $"Неразрешенный тип: {ev.IoCOffender}", 70));
|
detections.Add(("IoC манипуляция", $"Неразрешенный тип: {ev.IoCOffender}", 70));
|
||||||
|
|||||||
Reference in New Issue
Block a user