From 82b451c15e9ecd9fbc0348b70d71b74042521261 Mon Sep 17 00:00:00 2001
From: Madpeterz <57852827+Madpeterz@users.noreply.github.com>
Date: Tue, 16 Feb 2021 12:44:16 +0000
Subject: [PATCH] wip
---
BetterSecondbot/HttpService/Animation.cs | 79 +++++
BetterSecondbot/HttpService/Avatars.cs | 112 +++++++
BetterSecondbot/HttpService/Chat.cs | 54 +++-
BetterSecondbot/HttpService/Core.cs | 105 +-----
BetterSecondbot/HttpService/Dialogs.cs | 99 ++++++
BetterSecondbot/HttpService/Discord.cs | 105 ++++++
BetterSecondbot/HttpService/Estate.cs | 8 +-
BetterSecondbot/HttpService/HttpAsService.cs | 64 +++-
BetterSecondbot/HttpService/Im.cs | 82 ++---
BetterSecondbot/WikiMake/wikimake.cs | 5 -
Core/Commands/Animation/PlayGesture.cs | 25 --
Core/Commands/Animation/addToAnimations.cs | 33 --
Core/Commands/Animation/resetAnimations.cs | 12 -
Core/Commands/Avatars/NearMe.cs | 35 --
Core/Commands/Avatars/PayAvatar.cs | 40 ---
Core/Commands/Chat/LocalChatHistory.cs | 19 --
Core/Commands/Chat/im.cs | 35 --
Core/Commands/Chat/say.cs | 44 ---
Core/Commands/Dialogs/DialogRelay.cs | 46 ---
Core/Commands/Dialogs/DialogResponce.cs | 25 --
Core/Commands/Dialogs/DialogTrack.cs | 22 --
Core/Commands/DiscordAPI/AddRole.cs | 53 ----
Core/Commands/DiscordAPI/Ban_Member.cs | 54 ----
Core/RLV/Blacklist/getblacklist.cs | 75 -----
Core/RLV/Blacklist/versionnumbl.cs | 31 --
Core/RLV/Camera/camavdist.cs | 11 -
Core/RLV/Camera/camdistmax.cs | 10 -
Core/RLV/Camera/camdistmin.cs | 10 -
Core/RLV/Camera/camdrawalphamax.cs | 10 -
Core/RLV/Camera/camdrawalphamin.cs | 10 -
Core/RLV/Camera/camdrawcolor.cs | 10 -
Core/RLV/Camera/camdrawmax.cs | 10 -
Core/RLV/Camera/camdrawmin.cs | 10 -
Core/RLV/Camera/camtextures.cs | 10 -
Core/RLV/Camera/camunlock.cs | 10 -
Core/RLV/Camera/camzoommax.cs | 10 -
Core/RLV/Camera/camzoommin.cs | 10 -
Core/RLV/Camera/getcam_avdistmax.cs | 11 -
Core/RLV/Camera/getcam_avdistmin.cs | 12 -
Core/RLV/Camera/getcam_fov.cs | 12 -
Core/RLV/Camera/getcam_fovmax.cs | 12 -
Core/RLV/Camera/getcam_fovmin.cs | 11 -
Core/RLV/Camera/getcam_zoommin.cs | 12 -
Core/RLV/Camera/setcam_avdistmax.cs | 11 -
Core/RLV/Camera/setcam_avdistmin.cs | 12 -
Core/RLV/Camera/setcam_fov.cs | 11 -
Core/RLV/Camera/setcam_fovmax.cs | 11 -
Core/RLV/Camera/setcam_fovmin.cs | 11 -
Core/RLV/Camera/setcam_textures.cs | 11 -
Core/RLV/Camera/setcam_unlock.cs | 12 -
Core/RLV/Chat/chatnormal.cs | 10 -
Core/RLV/Chat/chatshout.cs | 10 -
Core/RLV/Chat/chatwhisper.cs | 10 -
Core/RLV/Chat/recvchat.cs | 37 ---
Core/RLV/Chat/recvchat_sec.cs | 10 -
Core/RLV/Chat/recvchatfrom.cs | 10 -
Core/RLV/Chat/redirchat.cs | 10 -
Core/RLV/Chat/sendchat.cs | 10 -
Core/RLV/Chat/sendgesture.cs | 10 -
Core/RLV/Emotes/emote.cs | 10 -
Core/RLV/Emotes/recvemote.cs | 38 ---
Core/RLV/Emotes/recvemote_sec.cs | 11 -
Core/RLV/Emotes/rediremote.cs | 11 -
Core/RLV/InstantMessages/sendim.cs | 37 ---
Core/RLV/InstantMessages/sendim_sec.cs | 18 --
Core/RLV/Miscellaneous/clear.cs | 17 -
Core/RLV/Miscellaneous/getstatus.cs | 51 ---
Core/RLV/Miscellaneous/getstatusall.cs | 58 ----
Core/RLV/Miscellaneous/notify.cs | 43 ---
Core/RLV/Miscellaneous/permissive.cs | 28 --
Core/RLV/Movement/adjustheight.cs | 44 ---
Core/RLV/Movement/alwaysrun.cs | 10 -
Core/RLV/Movement/fly.cs | 10 -
Core/RLV/Movement/setrot.cs | 23 --
Core/RLV/Movement/temprun.cs | 11 -
Core/RLV/PrivateChannels/sendchannel.cs | 10 -
.../RLV/PrivateChannels/sendchannel_except.cs | 11 -
Core/RLV/PrivateChannels/sendchannel_sec.cs | 11 -
Core/RLV/RLV_commandlib.cs | 230 --------------
Core/RLV/Sitting/getsitid.cs | 31 --
Core/RLV/Sitting/sit.cs | 30 --
Core/RLV/Sitting/unsit.cs | 23 --
Core/RLV/Version/version.cs | 27 --
Core/RLV/Version/versionnew.cs | 27 --
Core/RLV/Version/versionnum.cs | 27 --
Core/bottypes/AVstorageBot.cs | 84 -----
Core/bottypes/RLVbot.cs | 298 ------------------
Core/bottypes/chatrelay.cs | 2 +-
Core/bottypes/loadorder.txt | 3 +-
89 files changed, 556 insertions(+), 2327 deletions(-)
create mode 100644 BetterSecondbot/HttpService/Animation.cs
create mode 100644 BetterSecondbot/HttpService/Avatars.cs
create mode 100644 BetterSecondbot/HttpService/Dialogs.cs
create mode 100644 BetterSecondbot/HttpService/Discord.cs
delete mode 100644 Core/Commands/Animation/PlayGesture.cs
delete mode 100644 Core/Commands/Animation/addToAnimations.cs
delete mode 100644 Core/Commands/Animation/resetAnimations.cs
delete mode 100644 Core/Commands/Avatars/NearMe.cs
delete mode 100644 Core/Commands/Avatars/PayAvatar.cs
delete mode 100644 Core/Commands/Chat/LocalChatHistory.cs
delete mode 100644 Core/Commands/Chat/im.cs
delete mode 100644 Core/Commands/Chat/say.cs
delete mode 100644 Core/Commands/Dialogs/DialogRelay.cs
delete mode 100644 Core/Commands/Dialogs/DialogResponce.cs
delete mode 100644 Core/Commands/Dialogs/DialogTrack.cs
delete mode 100644 Core/Commands/DiscordAPI/AddRole.cs
delete mode 100644 Core/Commands/DiscordAPI/Ban_Member.cs
delete mode 100644 Core/RLV/Blacklist/getblacklist.cs
delete mode 100644 Core/RLV/Blacklist/versionnumbl.cs
delete mode 100644 Core/RLV/Camera/camavdist.cs
delete mode 100644 Core/RLV/Camera/camdistmax.cs
delete mode 100644 Core/RLV/Camera/camdistmin.cs
delete mode 100644 Core/RLV/Camera/camdrawalphamax.cs
delete mode 100644 Core/RLV/Camera/camdrawalphamin.cs
delete mode 100644 Core/RLV/Camera/camdrawcolor.cs
delete mode 100644 Core/RLV/Camera/camdrawmax.cs
delete mode 100644 Core/RLV/Camera/camdrawmin.cs
delete mode 100644 Core/RLV/Camera/camtextures.cs
delete mode 100644 Core/RLV/Camera/camunlock.cs
delete mode 100644 Core/RLV/Camera/camzoommax.cs
delete mode 100644 Core/RLV/Camera/camzoommin.cs
delete mode 100644 Core/RLV/Camera/getcam_avdistmax.cs
delete mode 100644 Core/RLV/Camera/getcam_avdistmin.cs
delete mode 100644 Core/RLV/Camera/getcam_fov.cs
delete mode 100644 Core/RLV/Camera/getcam_fovmax.cs
delete mode 100644 Core/RLV/Camera/getcam_fovmin.cs
delete mode 100644 Core/RLV/Camera/getcam_zoommin.cs
delete mode 100644 Core/RLV/Camera/setcam_avdistmax.cs
delete mode 100644 Core/RLV/Camera/setcam_avdistmin.cs
delete mode 100644 Core/RLV/Camera/setcam_fov.cs
delete mode 100644 Core/RLV/Camera/setcam_fovmax.cs
delete mode 100644 Core/RLV/Camera/setcam_fovmin.cs
delete mode 100644 Core/RLV/Camera/setcam_textures.cs
delete mode 100644 Core/RLV/Camera/setcam_unlock.cs
delete mode 100644 Core/RLV/Chat/chatnormal.cs
delete mode 100644 Core/RLV/Chat/chatshout.cs
delete mode 100644 Core/RLV/Chat/chatwhisper.cs
delete mode 100644 Core/RLV/Chat/recvchat.cs
delete mode 100644 Core/RLV/Chat/recvchat_sec.cs
delete mode 100644 Core/RLV/Chat/recvchatfrom.cs
delete mode 100644 Core/RLV/Chat/redirchat.cs
delete mode 100644 Core/RLV/Chat/sendchat.cs
delete mode 100644 Core/RLV/Chat/sendgesture.cs
delete mode 100644 Core/RLV/Emotes/emote.cs
delete mode 100644 Core/RLV/Emotes/recvemote.cs
delete mode 100644 Core/RLV/Emotes/recvemote_sec.cs
delete mode 100644 Core/RLV/Emotes/rediremote.cs
delete mode 100644 Core/RLV/InstantMessages/sendim.cs
delete mode 100644 Core/RLV/InstantMessages/sendim_sec.cs
delete mode 100644 Core/RLV/Miscellaneous/clear.cs
delete mode 100644 Core/RLV/Miscellaneous/getstatus.cs
delete mode 100644 Core/RLV/Miscellaneous/getstatusall.cs
delete mode 100644 Core/RLV/Miscellaneous/notify.cs
delete mode 100644 Core/RLV/Miscellaneous/permissive.cs
delete mode 100644 Core/RLV/Movement/adjustheight.cs
delete mode 100644 Core/RLV/Movement/alwaysrun.cs
delete mode 100644 Core/RLV/Movement/fly.cs
delete mode 100644 Core/RLV/Movement/setrot.cs
delete mode 100644 Core/RLV/Movement/temprun.cs
delete mode 100644 Core/RLV/PrivateChannels/sendchannel.cs
delete mode 100644 Core/RLV/PrivateChannels/sendchannel_except.cs
delete mode 100644 Core/RLV/PrivateChannels/sendchannel_sec.cs
delete mode 100644 Core/RLV/RLV_commandlib.cs
delete mode 100644 Core/RLV/Sitting/getsitid.cs
delete mode 100644 Core/RLV/Sitting/sit.cs
delete mode 100644 Core/RLV/Sitting/unsit.cs
delete mode 100644 Core/RLV/Version/version.cs
delete mode 100644 Core/RLV/Version/versionnew.cs
delete mode 100644 Core/RLV/Version/versionnum.cs
delete mode 100644 Core/bottypes/RLVbot.cs
diff --git a/BetterSecondbot/HttpService/Animation.cs b/BetterSecondbot/HttpService/Animation.cs
new file mode 100644
index 0000000..c503689
--- /dev/null
+++ b/BetterSecondbot/HttpService/Animation.cs
@@ -0,0 +1,79 @@
+using BetterSecondBot.bottypes;
+using BetterSecondBot.Static;
+using EmbedIO;
+using EmbedIO.Routing;
+using EmbedIO.WebApi;
+using System;
+using System.Collections.Generic;
+using System.Text;
+using OpenMetaverse;
+using Newtonsoft.Json;
+using System.Reflection;
+
+namespace BetterSecondBot.HttpService
+{
+ public class HttpApiAnimation : WebApiControllerWithTokens
+ {
+ public HttpApiAnimation(SecondBot mainbot, TokenStorage setuptokens) : base(mainbot, setuptokens) { }
+
+ [About("Toggles if animation requests from this avatar (used for remote poseballs) are accepted")]
+ [ReturnHints("Granted perm animation")]
+ [ReturnHints("Removed perm animation")]
+ [ReturnHints("avatar lookup")]
+ [ArgHints("avatar", "URLARG", "UUID (or Firstname Lastname)")]
+ [Route(HttpVerbs.Get, "/AddToAllowAnimations/{avatar}/{token}")]
+ public object AddToAllowAnimations(string avatar, string token)
+ {
+ if (tokens.Allow(token, "animation", "addtoallowanimations", getClientIP()) == false)
+ {
+ return BasicReply("Token not accepted");
+ }
+ ProcessAvatar(avatar);
+ if (avataruuid == UUID.Zero)
+ {
+ return BasicReply("avatar lookup");
+ }
+ if (bot.Accept_action_from("animation", avataruuid) == false)
+ {
+ bot.Add_action_from("animation", avataruuid);
+ return BasicReply("Granted perm animation");
+ }
+ bot.Remove_action_from("animation", avataruuid, true);
+ return BasicReply("Removed perm animation");
+ }
+
+ [About("Attempts to play a gesture")]
+ [ReturnHints("Error with gesture")]
+ [ReturnHints("Accepted")]
+ [ArgHints("gesture", "URLARG", "Inventory UUID of the gesture")]
+ [Route(HttpVerbs.Get, "/PlayGesture/{gesture}/{token}")]
+ public object PlayGesture(string gesture, string token)
+ {
+ if (tokens.Allow(token, "animation", "gesture", getClientIP()) == false)
+ {
+ return BasicReply("Token not accepted");
+ }
+ if (UUID.TryParse(gesture, out UUID gestureUUID) == false)
+ {
+ return BasicReply("Error with gesture");
+ }
+ InventoryItem itm = bot.GetClient.Inventory.FetchItem(gestureUUID, bot.GetClient.Self.AgentID, (3 * 1000));
+ bot.GetClient.Self.PlayGesture(itm.AssetUUID);
+ return BasicReply("Accepted");
+ }
+
+ [About("Resets the animation stack for the bot")]
+ [ReturnHints("Accepted")]
+ [Route(HttpVerbs.Get, "/ResetAnimations/{token}")]
+ public object ResetAnimations(string token)
+ {
+ if (tokens.Allow(token, "animation", "resetanimations", getClientIP()) == false)
+ {
+ return BasicReply("Token not accepted");
+ }
+ bot.ResetAnimations();
+ return BasicReply("Accepted");
+ }
+
+ }
+}
diff --git a/BetterSecondbot/HttpService/Avatars.cs b/BetterSecondbot/HttpService/Avatars.cs
new file mode 100644
index 0000000..62903dc
--- /dev/null
+++ b/BetterSecondbot/HttpService/Avatars.cs
@@ -0,0 +1,112 @@
+using BetterSecondBot.bottypes;
+using BetterSecondBot.Static;
+using EmbedIO;
+using EmbedIO.Routing;
+using EmbedIO.WebApi;
+using System;
+using System.Collections.Generic;
+using System.Text;
+using OpenMetaverse;
+using Newtonsoft.Json;
+using System.Reflection;
+
+namespace BetterSecondBot.HttpService
+{
+ public class HTTP_Avatars : WebApiControllerWithTokens
+ {
+ public HTTP_Avatars(SecondBot mainbot, TokenStorage setuptokens) : base(mainbot, setuptokens) { }
+
+ [About("an improved version of near me with extra details
NearMeDetails is a object formated as follows
")]
+ [ReturnHints("array NearMeDetails")]
+ [ReturnHints("Error not in a sim")]
+ [Route(HttpVerbs.Get, "/NearmeWithDetails/{token}")]
+ public object NearmeWithDetails(string token)
+ {
+ if (tokens.Allow(token, "avatars", "nearmewithdetails", getClientIP()) == false)
+ {
+ return BasicReply("Token not accepted");
+ }
+ if (bot.GetClient.Network.CurrentSim == null)
+ {
+ return BasicReply("Error not in a sim");
+ }
+ List BetterNearMe = new List();
+ Dictionary avcopy = bot.GetClient.Network.CurrentSim.ObjectsAvatars.Copy();
+ foreach (Avatar av in avcopy.Values)
+ {
+ if (av.ID != bot.GetClient.Self.AgentID)
+ {
+ NearMeDetails details = new NearMeDetails();
+ details.id = av.ID.ToString();
+ details.name = av.Name;
+ details.x = (int)Math.Round(av.Position.X);
+ details.y = (int)Math.Round(av.Position.Y);
+ details.z = (int)Math.Round(av.Position.Z);
+ details.range = (int)Math.Round(Vector3.Distance(av.Position, bot.GetClient.Self.SimPosition));
+ BetterNearMe.Add(details);
+ }
+ }
+ return BasicReply(JsonConvert.SerializeObject(BetterNearMe));
+ }
+
+ [About("returns a list of all known avatars nearby")]
+ [ReturnHints("array UUID = Name")]
+ [ReturnHints("Error not in a sim")]
+ [Route(HttpVerbs.Get, "/Nearme/{token}")]
+ public object Nearme(string token)
+ {
+ if (tokens.Allow(token, "avatars", "nearme", getClientIP()) == false)
+ {
+ return BasicReply("Token not accepted");
+ }
+ if (bot.GetClient.Network.CurrentSim == null)
+ {
+ return BasicReply("Error not in a sim");
+ }
+ Dictionary NearMe = new Dictionary();
+ Dictionary avcopy = bot.GetClient.Network.CurrentSim.ObjectsAvatars.Copy();
+ foreach (Avatar av in avcopy.Values)
+ {
+ if (av.ID != bot.GetClient.Self.AgentID)
+ {
+ NearMe.Add(av.ID, av.Name);
+ }
+ }
+ return BasicReply(JsonConvert.SerializeObject(NearMe));
+ }
+
+
+ [About("Makes the bot pay a avatar")]
+ [ReturnHints("Accepted")]
+ [ReturnHints("avatar lookup")]
+ [ReturnHints("Invaild amount")]
+ [ReturnHints("Transfer funds to avatars disabled")]
+ [Route(HttpVerbs.Get, "/PayAvatar/{avatar}/{amount}/{token}")]
+ public object PayAvatar(string avatar,string amount,string token)
+ {
+ if (tokens.Allow(token, "avatars", "payavatar", getClientIP()) == false)
+ {
+ return BasicReply("Token not accepted");
+ }
+ if (bot.GetAllowFunds == false)
+ {
+ return BasicReply("Transfer funds to avatars disabled");
+ }
+ ProcessAvatar(avatar);
+ if (avataruuid == UUID.Zero)
+ {
+ return BasicReply("avatar lookup");
+ }
+ if (int.TryParse(amount, out int amountvalue) == false)
+ {
+ return BasicReply("Invaild amount");
+ }
+ if(amountvalue < 1)
+ {
+ return BasicReply("Invaild amount");
+ }
+ bot.GetClient.Self.GiveAvatarMoney(avataruuid, amountvalue);
+ return BasicReply("Accepted");
+ }
+ }
+}
diff --git a/BetterSecondbot/HttpService/Chat.cs b/BetterSecondbot/HttpService/Chat.cs
index fe7f7a0..1ddf9bc 100644
--- a/BetterSecondbot/HttpService/Chat.cs
+++ b/BetterSecondbot/HttpService/Chat.cs
@@ -8,6 +8,7 @@ using System.Collections.Generic;
using System.Text;
using OpenMetaverse;
using Newtonsoft.Json;
+using BetterSecondBotShared.Static;
namespace BetterSecondBot.HttpService
{
@@ -17,8 +18,8 @@ namespace BetterSecondBot.HttpService
[About("fetchs the last 20 localchat messages")]
[ReturnHints("array string")]
- [Route(HttpVerbs.Get, "/localchathistory/{token}")]
- public object localchatHistory(string token)
+ [Route(HttpVerbs.Get, "/LocalChatHistory/{token}")]
+ public object LocalChatHistory(string token)
{
if (tokens.Allow(token, "chat", "localchathistory", getClientIP()) == true)
{
@@ -30,15 +31,52 @@ namespace BetterSecondBot.HttpService
[About("sends a message to localchat")]
[ArgHints("message", "URLARG", "the message to send")]
[ReturnHints("array string")]
- [Route(HttpVerbs.Post, "/localchatsay/{token}")]
- public object localchatSay(string token, [FormField] string message)
+ [ReturnHints("Message empty")]
+ [ReturnHints("Invaild channel")]
+ [Route(HttpVerbs.Post, "/Say/{channel}/{token}")]
+ public object Say(string channel,[FormField] string message,string token)
{
- if (tokens.Allow(token, "chat", "localchatsay", getClientIP()) == true)
+ if (tokens.Allow(token, "chat", "localchatsay", getClientIP()) == false)
{
- bot.GetCommandsInterface.Call("say", message);
- return BasicReply(JsonConvert.SerializeObject(bot.getLocalChatHistory()));
+ return BasicReply("Token not accepted");
}
- return BasicReply("Token not accepted");
+ if (helpers.notempty(message) == false)
+ {
+ return BasicReply("Message empty");
+ }
+ if(int.TryParse(channel,out int channelnum) == false)
+ {
+ return BasicReply("Invaild channel");
+ }
+ bot.GetClient.Self.Chat(message, channelnum, ChatType.Normal);
+ return BasicReply(JsonConvert.SerializeObject(bot.getLocalChatHistory()));
+
+ }
+
+ [About("sends a im to the selected avatar")]
+ [ArgHints("avatar", "URLARG", "a UUID or Firstname Lastname")]
+ [ArgHints("message", "Text", "the message to send")]
+ [ReturnHints("ok")]
+ [ReturnHints("Message empty")]
+ [ReturnHints("avatar lookup")]
+ [Route(HttpVerbs.Post, "/IM/{avatar}/{token}")]
+ public object IM(string avatar, [FormField] string message, string token)
+ {
+ if (tokens.Allow(token, "chat", "im", getClientIP()) == false)
+ {
+ return BasicReply("Token not accepted");
+ }
+ ProcessAvatar(avatar);
+ if(avataruuid == UUID.Zero)
+ {
+ return BasicReply("avatar lookup");
+ }
+ if (helpers.notempty(message) == false)
+ {
+ return BasicReply("Message empty");
+ }
+ bot.SendIM(avataruuid, message);
+ return BasicReply("ok");
}
}
diff --git a/BetterSecondbot/HttpService/Core.cs b/BetterSecondbot/HttpService/Core.cs
index 07aa2a2..3defd91 100644
--- a/BetterSecondbot/HttpService/Core.cs
+++ b/BetterSecondbot/HttpService/Core.cs
@@ -12,9 +12,6 @@ using Newtonsoft.Json;
namespace BetterSecondBot.HttpService
{
-
-
-
public class HttpApiCore : WebApiControllerWithTokens
{
@@ -30,7 +27,7 @@ namespace BetterSecondBot.HttpService
[ReturnHints("A new token with full system scope")]
[ArgHints("authcode", "text", "the first 10 chars of SHA1(unixtime+WebUIkey)
unixtime can be +- 30 of the bots time.")]
[ArgHints("unixtimegiven", "number", "the unixtime you made this request")]
- [Route(HttpVerbs.Post, "/gettoken")]
+ [Route(HttpVerbs.Post, "/GetToken")]
public Object GetToken([FormField] string authcode, [FormField] string unixtimegiven)
{
long now = helpers.UnixTimeNow();
@@ -56,7 +53,7 @@ namespace BetterSecondBot.HttpService
[About("Gets the friendslist
Formated as follows
friendreplyobject
- name: String
- id: String
- online: bool
")]
[ReturnHints("array UUID = friendreplyobject")]
- [Route(HttpVerbs.Get, "/friends/{token}")]
+ [Route(HttpVerbs.Get, "/Friends/{token}")]
public object Friends(string token)
{
if (tokens.Allow(token, "core", "friends", getClientIP()) == true)
@@ -72,7 +69,7 @@ namespace BetterSecondBot.HttpService
[ArgHints("x", "URLARG", "X location to AutoPilot to")]
[ArgHints("y", "URLARG", "y location to AutoPilot to")]
[ArgHints("z", "URLARG", "z location to AutoPilot to")]
- [Route(HttpVerbs.Get, "/walkto/{x}/{y}/{z}/{token}")]
+ [Route(HttpVerbs.Get, "/WalkTo/{x}/{y}/{z}/{token}")]
public object WalkTo(string x, string y, string z, string token)
{
if (tokens.Allow(token, "core", "walkto", getClientIP()) == true)
@@ -87,24 +84,7 @@ namespace BetterSecondBot.HttpService
return BasicReply("Token not accepted");
}
- [About("Attempts to play a gesture")]
- [ReturnHints("Invaild gesture UUID for arg 1")]
- [ReturnHints("Accepted")]
- [ArgHints("gesture", "URLARG", "Inventory UUID of the gesture")]
- [Route(HttpVerbs.Get, "/gesture/{gesture}/{token}")]
- public object Gesture(string gesture, string token)
- {
- if (tokens.Allow(token, "core", "gesture", getClientIP()) == true)
- {
- bool status = bot.GetCommandsInterface.Call("PlayGesture", gesture);
- if (status == true)
- {
- return BasicReply("Accepted");
- }
- return BasicReply("Error with gesture");
- }
- return BasicReply("Token not accepted");
- }
+
[About("Attempt to teleport to a new region")]
[ReturnHints("Error Unable to Teleport to location")]
@@ -113,7 +93,7 @@ namespace BetterSecondBot.HttpService
[ArgHints("x", "URLARG", "X location to teleport to")]
[ArgHints("y", "URLARG", "y location to teleport to")]
[ArgHints("z", "URLARG", "z location to teleport to")]
- [Route(HttpVerbs.Get, "/teleport/{region}/{x}/{y}/{z}/{token}")]
+ [Route(HttpVerbs.Get, "/Teleport/{region}/{x}/{y}/{z}/{token}")]
public object Teleport(string region,string x, string y, string z, string token)
{
if (tokens.Allow(token, "core", "teleport", getClientIP()) == true)
@@ -132,7 +112,7 @@ namespace BetterSecondBot.HttpService
[ReturnHints("Unable to find region")]
[ReturnHints("Texture UUID")]
[ArgHints("regionname", "URLARG", "the name of the region we are fetching")]
- [Route(HttpVerbs.Get, "/regiontile/{regionname}/{token}")]
+ [Route(HttpVerbs.Get, "/Regiontile/{regionname}/{token}")]
public object Regiontile(string regionname, string token)
{
if (tokens.Allow(token, "core", "regiontile", getClientIP()) == true)
@@ -149,69 +129,12 @@ namespace BetterSecondBot.HttpService
return BasicReply("Token not accepted");
}
- [About("an improved version of near me with extra details
NearMeDetails is a object formated as follows
")]
- [ReturnHints("array NearMeDetails")]
- [ReturnHints("Error not in a sim")]
- [Route(HttpVerbs.Get, "/nearmewithdetails/{token}")]
- public object NearmeWithDetails(string token)
- {
- if (tokens.Allow(token, "core", "nearmewithdetails", getClientIP()) == true)
- {
- if (bot.GetClient.Network.CurrentSim != null)
- {
- List BetterNearMe = new List();
- Dictionary avcopy = bot.GetClient.Network.CurrentSim.ObjectsAvatars.Copy();
- foreach (Avatar av in avcopy.Values)
- {
- if (av.ID != bot.GetClient.Self.AgentID)
- {
- NearMeDetails details = new NearMeDetails();
- details.id = av.ID.ToString();
- details.name = av.Name;
- details.x = (int)Math.Round(av.Position.X);
- details.y = (int)Math.Round(av.Position.Y);
- details.z = (int)Math.Round(av.Position.Z);
- details.range = (int)Math.Round(Vector3.Distance(av.Position, bot.GetClient.Self.SimPosition));
- BetterNearMe.Add(details);
- }
- }
- return BasicReply(JsonConvert.SerializeObject(BetterNearMe));
- }
- return BasicReply("Error not in a sim");
- }
- return BasicReply("Token not accepted");
- }
- [About("returns a list of all known avatars nearby")]
- [ReturnHints("array UUID = Name")]
- [ReturnHints("Error not in a sim")]
- [Route(HttpVerbs.Get, "/nearme/{token}")]
- public object Nearme(string token)
- {
- if (tokens.Allow(token, "core", "nearme", getClientIP()) == true)
- {
- if (bot.GetClient.Network.CurrentSim != null)
- {
- Dictionary NearMe = new Dictionary();
- Dictionary avcopy = bot.GetClient.Network.CurrentSim.ObjectsAvatars.Copy();
- foreach (Avatar av in avcopy.Values)
- {
- if (av.ID != bot.GetClient.Self.AgentID)
- {
- NearMe.Add(av.ID, av.Name);
- }
- }
- return BasicReply(JsonConvert.SerializeObject(NearMe));
- }
- return BasicReply("Error not in a sim");
- }
- return BasicReply("Token not accepted");
- }
[About("Used to check HTTP connections")]
[ReturnHints("world")]
[NeedsToken(false)]
- [Route(HttpVerbs.Get, "/hello")]
+ [Route(HttpVerbs.Get, "/Hello")]
public object Hello()
{
return BasicReply("world");
@@ -221,7 +144,7 @@ namespace BetterSecondBot.HttpService
[About("Removes the given token from the accepted token pool")]
[ReturnHints("Failed to remove token")]
[ReturnHints("ok")]
- [Route(HttpVerbs.Get, "/logout/{token}")]
+ [Route(HttpVerbs.Get, "/Logout/{token}")]
public object Logout(string token)
{
if (tokens.Allow(token, "core", "logout", getClientIP()) == true)
@@ -235,7 +158,7 @@ namespace BetterSecondBot.HttpService
[About("Fetchs the current bot")]
[ReturnHints("The build ID of the bot")]
- [Route(HttpVerbs.Get, "/version/{token}")]
+ [Route(HttpVerbs.Get, "/Version/{token}")]
public object Version(string token)
{
if (tokens.Allow(token, "core", "version", getClientIP()) == true)
@@ -247,7 +170,7 @@ namespace BetterSecondBot.HttpService
[About("Fetchs the name of the bot")]
[ReturnHints("Firstname Lastname")]
- [Route(HttpVerbs.Get, "/name/{token}")]
+ [Route(HttpVerbs.Get, "/Name/{token}")]
public object Name(string token)
{
if (tokens.Allow(token, "core", "name", getClientIP()) == true)
@@ -260,7 +183,7 @@ namespace BetterSecondBot.HttpService
[About("Fetchs the current region name")]
[ReturnHints("Regionname")]
[ReturnHints("Error not in a sim")]
- [Route(HttpVerbs.Get, "/regionname/{token}")]
+ [Route(HttpVerbs.Get, "/Regionname/{token}")]
public object Regionname(string token)
{
if (tokens.Allow(token, "core", "regionname", getClientIP()) == true)
@@ -277,7 +200,7 @@ namespace BetterSecondBot.HttpService
[About("Fetchs the current location of the bot")]
[ReturnHints("array of X,Y,Z values")]
[ReturnHints("Error not in a sim")]
- [Route(HttpVerbs.Get, "/location/{token}")]
+ [Route(HttpVerbs.Get, "/Location/{token}")]
public object Location(string token)
{
if (tokens.Allow(token, "core", "location", getClientIP()) == true)
@@ -301,8 +224,8 @@ namespace BetterSecondBot.HttpService
[ReturnHints("accepted")]
[ReturnHints("Auth not accepted")]
[ReturnHints("Failed")]
- [Route(HttpVerbs.Post, "/command/{token}")]
- public async Task