From 06ac2cd1d2064b704b4f0cc12afaea590fa12b24 Mon Sep 17 00:00:00 2001 From: Madpeter Date: Mon, 11 May 2020 12:13:10 +0100 Subject: [PATCH] adds access list support for RequestTeleport --- BSBshared/BotTypes/BasicBot.cs | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/BSBshared/BotTypes/BasicBot.cs b/BSBshared/BotTypes/BasicBot.cs index 58eb906..92a0e70 100644 --- a/BSBshared/BotTypes/BasicBot.cs +++ b/BSBshared/BotTypes/BasicBot.cs @@ -164,9 +164,28 @@ namespace BetterSecondBotShared.bottypes } } + protected List accept_next_teleport_from = new List(); + public void add_uuid_to_teleport_list(UUID avatar) + { + if (accept_next_teleport_from.Contains(avatar) == false) + { + accept_next_teleport_from.Add(avatar); + } + } + protected virtual void RequestTeleport(UUID IMSessionID, string FromAgentName, UUID FromAgentID) { + bool allow = false; if (FromAgentName == myconfig.master) + { + allow = true; + } + else if(accept_next_teleport_from.Contains(FromAgentID) == true) + { + allow = true; + accept_next_teleport_from.Remove(FromAgentID); + } + if(allow == true) { ResetAnimations(); SetTeleported();