Skip to content

Commit

Permalink
Obey Do Not Track
Browse files Browse the repository at this point in the history
  • Loading branch information
PintTheDragon committed Oct 20, 2020
1 parent 4fad5e4 commit 76e609c
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions SCPStats/EventHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -136,9 +136,9 @@ internal static void OnKill(DiedEventArgs ev)
{"damagetype", DamageTypes.ToIndex(ev.HitInformations.GetDamageType()).ToString()}
};

SendRequest(data, "https://scpstats.com/plugin/event/death");
if(!ev.Target.DoNotTrack) SendRequest(data, "https://scpstats.com/plugin/event/death");

if (ev.Killer.RawUserId == ev.Target.RawUserId) return;
if (ev.Killer.RawUserId == ev.Target.RawUserId || ev.Killer.DoNotTrack) return;

data = new Dictionary<string, string>()
{
Expand All @@ -154,7 +154,7 @@ internal static void OnKill(DiedEventArgs ev)

internal static void OnRoleChanged(ChangingRoleEventArgs ev)
{
if (ev.IsEscaped)
if (ev.IsEscaped && !ev.Player.DoNotTrack)
{
var data = new Dictionary<string, string>()
{
Expand All @@ -166,7 +166,7 @@ internal static void OnRoleChanged(ChangingRoleEventArgs ev)
SendRequest(data, "https://scpstats.com/plugin/event/escape");
}

if (ev.Player.Role == RoleType.None || ev.Player.Role == RoleType.Spectator) return;
if (ev.Player.Role == RoleType.None || ev.Player.Role == RoleType.Spectator || ev.Player.DoNotTrack) return;

var data2 = new Dictionary<string, string>()
{
Expand All @@ -180,7 +180,7 @@ internal static void OnRoleChanged(ChangingRoleEventArgs ev)

internal static void OnPickup(PickingUpItemEventArgs ev)
{
if (!ev.IsAllowed) return;
if (!ev.IsAllowed || ev.Player.DoNotTrack) return;

var data = new Dictionary<string, string>()
{
Expand All @@ -194,7 +194,7 @@ internal static void OnPickup(PickingUpItemEventArgs ev)

internal static void OnDrop(DroppingItemEventArgs ev)
{
if (!ev.IsAllowed) return;
if (!ev.IsAllowed || ev.Player.DoNotTrack) return;

var data = new Dictionary<string, string>()
{
Expand All @@ -208,7 +208,7 @@ internal static void OnDrop(DroppingItemEventArgs ev)

internal static void OnJoin(JoinedEventArgs ev)
{
if (!Round.IsStarted && Players.Contains(ev.Player.RawUserId)) return;
if ((!Round.IsStarted && Players.Contains(ev.Player.RawUserId)) || ev.Player.DoNotTrack) return;

var data = new Dictionary<string, string>()
{
Expand All @@ -223,7 +223,7 @@ internal static void OnJoin(JoinedEventArgs ev)

internal static void OnLeave(LeftEventArgs ev)
{
if (Restarting) return;
if (Restarting || ev.Player.DoNotTrack) return;

var data = new Dictionary<string, string>()
{
Expand Down

0 comments on commit 76e609c

Please sign in to comment.