New command ListSculptys
This commit is contained in:
parent
1d160caea2
commit
3c3128c1ad
1 changed files with 17 additions and 0 deletions
|
|
@ -16,6 +16,23 @@ namespace BetterSecondBot.HttpService
|
||||||
{
|
{
|
||||||
public HTTP_Info(SecondBot mainbot, TokenStorage setuptokens) : base(mainbot, setuptokens) { }
|
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<string, string> Sculpts = new Dictionary<string, string>();
|
||||||
|
Dictionary<uint, Primitive> objects_copy = bot.GetClient.Network.CurrentSim.ObjectsPrimitives.Copy();
|
||||||
|
foreach (KeyValuePair<uint, Primitive> 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")]
|
[About("Fetchs the current bot")]
|
||||||
[ReturnHints("The build ID of the bot")]
|
[ReturnHints("The build ID of the bot")]
|
||||||
[Route(HttpVerbs.Get, "/Version/{token}")]
|
[Route(HttpVerbs.Get, "/Version/{token}")]
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue