From 3c3128c1ad4a52ba89a07a0f22b1429ea2ee28e3 Mon Sep 17 00:00:00 2001 From: Madpeter <57852827+Madpeterz@users.noreply.github.com> Date: Sat, 13 Nov 2021 22:27:31 +0000 Subject: [PATCH] New command ListSculptys --- Core/Commands/Info.cs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/Core/Commands/Info.cs b/Core/Commands/Info.cs index 83d938f..d345b89 100644 --- a/Core/Commands/Info.cs +++ b/Core/Commands/Info.cs @@ -16,6 +16,23 @@ namespace BetterSecondBot.HttpService { public HTTP_Info(SecondBot mainbot, TokenStorage setuptokens) : base(mainbot, setuptokens) { } + [About("Lists objects that are sculpty type in the current sim that the bot can see")] + [ReturnHints("A json object of [UUID=Pos]")] + [Route(HttpVerbs.Get, "/ListSculptys/{token}")] + public object ListSculptys(string token) + { + Dictionary Sculpts = new Dictionary(); + Dictionary objects_copy = bot.GetClient.Network.CurrentSim.ObjectsPrimitives.Copy(); + foreach (KeyValuePair Obj in objects_copy) + { + if (Obj.Value.Type == PrimType.Sculpt) + { + Sculpts.Add(Obj.Value.ID.ToString(), Obj.Value.Position.ToString()); + } + } + return BasicReply(JsonConvert.SerializeObject(Sculpts), "ListSculptys"); + } + [About("Fetchs the current bot")] [ReturnHints("The build ID of the bot")] [Route(HttpVerbs.Get, "/Version/{token}")]