From 5071431f26e89fb22a7e16428887cc7cbdf70632 Mon Sep 17 00:00:00 2001 From: Madpeter <57852827+Madpeterz@users.noreply.github.com> Date: Thu, 4 Jul 2024 13:29:52 +0100 Subject: [PATCH] add extra checks on guest event triggers --- SecondBotEvents/Services/TriggerOnEventService.cs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/SecondBotEvents/Services/TriggerOnEventService.cs b/SecondBotEvents/Services/TriggerOnEventService.cs index 6295c16..cf27a9e 100644 --- a/SecondBotEvents/Services/TriggerOnEventService.cs +++ b/SecondBotEvents/Services/TriggerOnEventService.cs @@ -700,10 +700,17 @@ namespace SecondBotEvents.Services } if ((tracked.Count > 0) || (joined.Count > 0)) { + List seen = new List(); if (tracked.Count > 0) { + foreach (UUID a in tracked) { + if(seen.Contains(a) == true) + { + continue; + } + seen.Add(a); TriggerEvent("GuestLeaves", new Dictionary() { { "avataruuid", a.ToString() } }); } } @@ -711,6 +718,11 @@ namespace SecondBotEvents.Services { foreach (UUID a in joined) { + if (seen.Contains(a) == true) + { + continue; + } + seen.Add(a); TriggerEvent("GuestJoins", new Dictionary() { { "avataruuid", a.ToString() } }); } }