Skip to content

Commit

Permalink
Full fix (working)
Browse files Browse the repository at this point in the history
  • Loading branch information
TH3AL3X committed Jul 16, 2024
1 parent 6b5f8fe commit 6dba57d
Show file tree
Hide file tree
Showing 5 changed files with 128 additions and 45 deletions.
11 changes: 8 additions & 3 deletions DAC/commands/command_report.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using Rocket.Unturned.Player;
using SDG.Unturned;
using System.Collections.Generic;
using System.Threading;

namespace DAC
{
Expand Down Expand Up @@ -59,10 +60,10 @@ public void Execute(IRocketPlayer caller, params string[] commands)
{
ChatManager.serverSendMessage($"<color=#2391DE>[DAC]</color> Syntax: /report {Syntax}".Replace('(', '<').Replace(')', '>'), UnityEngine.Color.white, null, player.SteamPlayer(), EChatMode.WELCOME, "https://darknesscommunity.club/assets/plugins/images/server/anticheat.png", true);
}
/*else if (player.Equals(to_player_report))
else if (player.Equals(to_player_report))
{
ChatManager.serverSendMessage($"<color=#2391DE>[DAC]</color> You can't report your self".Replace('(', '<').Replace(')', '>'), UnityEngine.Color.white, null, player.SteamPlayer(), EChatMode.WELCOME, "https://darknesscommunity.club/assets/plugins/images/server/anticheat.png", true);
}*/
}
else if (to_player_report == null)
{
ChatManager.serverSendMessage($"<color=#2391DE>[DAC]</color> Player not found".Replace('(', '<').Replace(')', '>'), UnityEngine.Color.white, null, player.SteamPlayer(), EChatMode.WELCOME, "https://darknesscommunity.club/assets/plugins/images/server/anticheat.png", true);
Expand All @@ -71,7 +72,11 @@ public void Execute(IRocketPlayer caller, params string[] commands)
{
ChatManager.serverSendMessage($"<color=#2391DE>[DAC]</color> The report of {to_player_report.CSteamID} has been sent successfully, wait for an administrator to review it".Replace('(', '<').Replace(')', '>'), UnityEngine.Color.white, null, player.SteamPlayer(), EChatMode.WELCOME, "https://darknesscommunity.club/assets/plugins/images/server/anticheat.png", true);

Darkness_Anti_Cheat_Functions.send_report(player, to_player_report, Darkness_Anti_Cheat.Instance.Configuration.Instance.report_player_webhook, get_reason, false, null, "FF0000");
ThreadPool.QueueUserWorkItem((yes) =>
{
Darkness_Anti_Cheat_Functions.send_report(player, to_player_report, Darkness_Anti_Cheat.Instance.Configuration.Instance.report_player_webhook, get_reason, false, null, "FF0000");
});

Darkness_Anti_Cheat.Instance.StartCoroutine(Darkness_Anti_Cheat_Functions.screenshot(player, Darkness_Anti_Cheat.Instance.Configuration.Instance.report_player_webhook));
}
}
Expand Down
1 change: 1 addition & 0 deletions DAC/components/player_component.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,6 @@ public class PlayerComponent : UnturnedPlayerComponent
public int Headshots { get; set; }
public int Rate { get; set; } // Using if detect several times, but we only using this in anti aim section
public int RateAim { get; set; }
public int RatePunch { get; set; }
}
}
6 changes: 6 additions & 0 deletions DAC/config/config.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@ public class Configuration : IRocketPluginConfiguration, IDefaultable

public string logs;

public int aimbot_detection_rate;

public int punch_distance_rate;

[XmlArray("CommandEntries"), XmlArrayItem("CommandEntry")]
public AbuseCommands[] Entries;

Expand Down Expand Up @@ -86,6 +90,8 @@ public void LoadDefaults()
anti_free_cam = true;
abuse_detection = true;
aimbot_detection = true;
aimbot_detection_rate = 3;
punch_distance_rate = 3;
noclip_detection = true;
global_chat = true;
}
Expand Down
Loading

0 comments on commit 6dba57d

Please sign in to comment.