From 01e40bd12b96a76cbfa6dd0df5ca624b291aae1e Mon Sep 17 00:00:00 2001 From: Madpeterz <57852827+Madpeterz@users.noreply.github.com> Date: Fri, 26 Feb 2021 11:36:11 +0000 Subject: [PATCH] Update Parcel.cs --- Core/Commands/Parcel.cs | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/Core/Commands/Parcel.cs b/Core/Commands/Parcel.cs index c4309fc..0466366 100644 --- a/Core/Commands/Parcel.cs +++ b/Core/Commands/Parcel.cs @@ -448,7 +448,7 @@ namespace BetterSecondBot.HttpService [About("Fetchs the parcel ban list of the parcel the bot is currently on
If the name returned is lookup the bot is currently requesting the avatar name")] - [ReturnHints("array of UUID=Name")] + [ReturnHints("json object: GetParcelBanlistObject")] [ReturnHints("Error not in a sim")] [ReturnHints("Parcel data not ready")] [Route(HttpVerbs.Get, "/GetParcelBanlist/{token}")] @@ -459,7 +459,7 @@ namespace BetterSecondBot.HttpService { return Failure(tests.Value); } - Dictionary reply = new Dictionary(); + GetParcelBanlistObject reply = new GetParcelBanlistObject(); int delays = 0; bool haslookup = true; while ((haslookup == true) || (delays < 3)) @@ -481,8 +481,12 @@ namespace BetterSecondBot.HttpService foreach (ParcelAccessEntry e in targetparcel.AccessBlackList) { string name = bot.FindAvatarKey2Name(e.AgentID); - reply.Add(e.AgentID.ToString(), name); + reply.entrys.Add(e.AgentID, name); } + reply.reportedEntrys = targetparcel.AccessBlackList.Count; + reply.delay = delays * 1000; + reply.parcelName = targetparcel.Name; + reply.regionName = bot.GetClient.Network.CurrentSim.Name; return BasicReply(JsonConvert.SerializeObject(reply)); } @@ -635,4 +639,13 @@ namespace BetterSecondBot.HttpService return true; } } + + public class GetParcelBanlistObject + { + public Dictionary entrys; + public string parcelName = ""; + public string regionName = ""; + public int delay = 0; + public int reportedEntrys = 0; + } }