it works but it sucks

This commit is contained in:
Madpeter 2022-04-15 19:34:49 +01:00
parent 41bf241970
commit 3aa9ddc73f
11 changed files with 83 additions and 230 deletions

View file

@ -94,7 +94,7 @@ namespace SecondBotEvents.Commands
{
return Failure("Token not accepted");
}
return BasicReply(JsonConvert.SerializeObject(bot.GetIMChatWindowKeyNames()), "chatwindows");
return Failure("@todo chat windows list");
}
[About("gets a list of chat windows with unread messages")]
@ -107,14 +107,7 @@ namespace SecondBotEvents.Commands
return Failure("Token not accepted");
}
List<UUID> unreadimwindows = new List<UUID>();
foreach (UUID window in bot.IMChatWindows())
{
if (bot.ImChatWindowHasUnread(window) == true)
{
unreadimwindows.Add(window);
}
}
return BasicReply(JsonConvert.SerializeObject(unreadimwindows), "listwithunread");
return Failure("@todo chat windows list unread");
}
[About("gets if there are any unread im messages at all")]
@ -126,16 +119,7 @@ namespace SecondBotEvents.Commands
{
return Failure("Token not accepted");
}
bool reply = false;
foreach (UUID window in bot.IMChatWindows())
{
if (bot.ImChatWindowHasUnread(window) == true)
{
reply = true;
break;
}
}
return BasicReply(reply.ToString(), "haveunreadims");
return Failure("@todo have any unread ims");
}
[About("gets the chat from the selected window")]
@ -153,7 +137,7 @@ namespace SecondBotEvents.Commands
{
return Failure("Window UUID invaild", "getimchat", new[] { window });
}
return BasicReply(JsonConvert.SerializeObject(bot.GetIMChatWindow(windowUUID)), "getimchat", new[] { window });
return Failure("@todo chat window fetch");
}
}

View file

@ -64,8 +64,7 @@ namespace SecondBotEvents.Commands
{
return Failure("bad status", "DialogTrack", new [] { status });
}
bot.SetTrackDialogs(statuscode);
return BasicReply("updated", "DialogTrack", new [] { status });
return Failure("@todo dialog relay");
}
}

View file

@ -2,6 +2,7 @@
using EmbedIO.Routing;
using OpenMetaverse;
using SecondBotEvents.Services;
using Newtonsoft.Json;
namespace SecondBotEvents.Commands
@ -11,7 +12,7 @@ namespace SecondBotEvents.Commands
public Friends(EventsSecondBot setmaster) : base(setmaster)
{
}
[About("Gets the friendslist <br/>Formated as follows<br/>friendreplyobject<br/><ul><li>name: String</li><li>id: String</li><li>online: bool</li></ul>")]
[About("Gets the friendslist")]
[ReturnHints("array UUID = friendreplyobject")]
[Route(HttpVerbs.Get, "/Friendslist/{token}")]
public object Friendslist(string token)
@ -20,7 +21,7 @@ namespace SecondBotEvents.Commands
{
return Failure("Token not accepted");
}
return BasicReply(bot.getJsonFriendlist(), "Friendslist");
return BasicReply(JsonConvert.SerializeObject(getClient().Friends.FriendList));
}
[About("Updates the friend perms for avatar avatar to State \n if true grants (Online/Map/Modify) perms")]

View file

@ -34,26 +34,9 @@ namespace SecondBotEvents.Commands
{
return Failure("Invaild group UUID", "IsGroupMember", new [] { group, avatar });
}
if (bot.MyGroups.ContainsKey(groupuuid) == false)
{
return Failure("Unknown group", "IsGroupMember", new [] { group, avatar });
}
if (bot.NeedReloadGroupData(groupuuid) == true)
{
getClient().Groups.RequestGroupMembers(groupuuid);
}
ProcessAvatar(avatar);
KeyValuePair<bool, string> reply = waitForReady(true, true, groupuuid);
if (reply.Key == false)
{
return Failure(reply.Value, "IsGroupMember", new [] { group, avatar });
}
IsGroupMemberReply replyobject = new IsGroupMemberReply();
replyobject.membershipStatus = bot.FastCheckInGroup(groupuuid, avataruuid);
replyobject.AvatarUUID = avataruuid.ToString();
replyobject.AvatarnameIfKnown = bot.FindAvatarKey2Name(avataruuid);
replyobject.GroupUUID = groupuuid.ToString();
return BasicReply(JsonConvert.SerializeObject(replyobject), "IsGroupMember", new [] { group, avatar });
return Failure("@todo group membership storage");
// IsGroupMemberReply object
}
[About("Gets membership of a group")]
@ -74,25 +57,11 @@ namespace SecondBotEvents.Commands
{
return Failure("Invaild group UUID", "GetGroupMembers", new [] { group });
}
if (bot.MyGroups.ContainsKey(groupuuid) == false)
{
return Failure("Unknown group", "GetGroupMembers", new [] { group });
}
if (bot.NeedReloadGroupData(groupuuid) == true)
{
getClient().Groups.RequestGroupMembers(groupuuid);
}
KeyValuePair<bool, string> reply = waitForReady(false, true, groupuuid);
if (reply.Key == false)
{
return Failure(reply.Value, "GetGroupMembers", new [] { group });
}
SuccessNoReturn("GetGroupMembers", new [] { group });
return bot.GetGroupMembers(groupuuid);
return Failure("@todo group membership storage");
}
[About("Attempts to ban/unban a given avatar from a group")]
[ReturnHints("? request accepted")]
[ReturnHints("Accepted")]
[ReturnHintsFailure("Updating")]
[ReturnHintsFailure("Unknown group")]
[ReturnHintsFailure("Invaild group UUID")]
@ -110,41 +79,32 @@ namespace SecondBotEvents.Commands
}
if (UUID.TryParse(group, out UUID groupuuid) == false)
{
return Failure("Invaild group UUID", "GroupBan", new [] { group, avatar, state });
return Failure("Invaild group UUID", "GroupBan", new[] { group, avatar, state });
}
if (bot.MyGroups.ContainsKey(groupuuid) == false)
if (getClient().Groups.GroupName2KeyCache.ContainsKey(groupuuid) == false)
{
return Failure("Unknown group", "GroupBan", new [] { group, avatar, state });
}
Group G = bot.MyGroups[groupuuid];
if (G.Powers.HasFlag(GroupPowers.GroupBanAccess) == false)
{
return Failure("Missing group GroupBanAccess power", "GroupBan", new [] { group, avatar, state });
}
if (bool.TryParse(state, out bool banstate) == false)
{
return Failure("Invaild ban state", "GroupBan", new [] { group, avatar, state });
return Failure("Unknown group", "GroupBan", new[] { group, avatar, state });
}
ProcessAvatar(avatar);
if(avataruuid == UUID.Zero)
if(avataruuid == null)
{
return Failure("avatar lookup", "GroupBan", new [] { group, avatar, state });
return Failure("Unknown avatar", "GroupBan", new[] { group, avatar, state });
}
GroupBanAction action = GroupBanAction.Unban;
string statename = "Unban";
if (banstate == true)
GroupBanAction Action = GroupBanAction.Ban;
if (state == "false")
{
action = GroupBanAction.Ban;
statename = "Ban";
Action = GroupBanAction.Unban;
}
getClient().Groups.RequestBanAction(groupuuid, action, new UUID[] { avataruuid });
return BasicReply(statename+" request accepted", "GroupBan", new [] { group, avatar, state });
List<UUID> avatarstoaction = new List<UUID>();
avatarstoaction.Add(avataruuid);
getClient().Groups.RequestBanAction(groupuuid, Action, avatarstoaction.ToArray());
return BasicReply("Accepted");
}
[About("Eject selected avatar from group")]
[ReturnHints("Requested")]
[ReturnHints("Accepted")]
[ReturnHintsFailure("Updating")]
[ReturnHintsFailure("Unknown group")]
[ReturnHintsFailure("Invaild group UUID")]
@ -164,22 +124,13 @@ namespace SecondBotEvents.Commands
{
return Failure("Invaild group UUID", "GroupEject", new [] { group, avatar });
}
if (bot.MyGroups.ContainsKey(groupuuid) == false)
{
return Failure("Unknown group", "GroupEject", new [] { group, avatar });
}
Group G = bot.MyGroups[groupuuid];
if (G.Powers.HasFlag(GroupPowers.Eject) == false)
{
return Failure("Missing group Eject power", "GroupEject", new [] { group, avatar });
}
ProcessAvatar(avatar);
if (avataruuid == UUID.Zero)
if (avataruuid == null)
{
return Failure("avatar lookup", "GroupEject", new [] { group, avatar });
return Failure("Unknown avatar", "GroupEject", new[] { group, avatar});
}
getClient().Groups.EjectUser(groupuuid, avataruuid);
return BasicReply("Requested", "GroupEject", new [] { group, avatar });
return BasicReply("Accepted");
}
[About("Adds the avatar to the Group with the role \n if they are not in the group then it invites them at that role")]
@ -208,28 +159,7 @@ namespace SecondBotEvents.Commands
{
return Failure("Invaild role UUID", "GroupAddRole", new [] { group, avatar });
}
if (bot.MyGroups.ContainsKey(groupuuid) == false)
{
return Failure("Unknown group", "GroupAddRole", new [] { group, avatar });
}
if (bot.NeedReloadGroupData(groupuuid) == true)
{
getClient().Groups.RequestGroupMembers(groupuuid);
}
ProcessAvatar(avatar);
KeyValuePair<bool, string> reply = waitForReady(true, true, groupuuid);
if (reply.Key == false)
{
return Failure(reply.Value, "GroupAddRole", new [] { group, avatar });
}
bool status = bot.FastCheckInGroup(groupuuid, avataruuid);
if (status == false)
{
getClient().Groups.Invite(groupuuid, new List<UUID>() { roleuuid }, avataruuid);
return BasicReply("Invite sent", "GroupAddRole", new [] { group, avatar });
}
getClient().Groups.AddToRole(groupuuid, roleuuid, avataruuid);
return BasicReply("Roles updated", "GroupAddRole", new [] { group, avatar });
return Failure("@todo group membership storage");
}
[About("Invites selected avatar to the group with the selected role")]
@ -254,24 +184,11 @@ namespace SecondBotEvents.Commands
{
return Failure("Invaild group UUID", "GroupInvite", new [] { group, avatar, role });
}
if (bot.MyGroups.ContainsKey(groupuuid) == false)
{
return Failure("Unknown group", "GroupInvite", new [] { group, avatar, role });
}
if (bot.NeedReloadGroupData(groupuuid) == true)
{
getClient().Groups.RequestGroupMembers(groupuuid);
}
ProcessAvatar(avatar);
if (avataruuid == UUID.Zero)
{
return Failure("avatar lookup", "GroupInvite", new [] { group, avatar, role });
}
bool status = bot.FastCheckInGroup(groupuuid, avataruuid);
if (status == true)
{
return BasicReply("Already in group", "GroupInvite", new[] { group, avatar, role });
}
if(role == "everyone")
{
role = UUID.Zero.ToString();
@ -280,11 +197,6 @@ namespace SecondBotEvents.Commands
{
return Failure("Unable to process role UUID", "GroupInvite", new [] { group, avatar, role });
}
Group G = bot.MyGroups[groupuuid];
if(G.Powers.HasFlag(GroupPowers.Invite) == false)
{
return Failure("Missing group invite power", "GroupInvite", new [] { group, avatar, role });
}
getClient().Groups.Invite(groupuuid, new List<UUID>() { roleuuid }, avataruuid);
return BasicReply("Invite sent", "GroupInvite", new [] { group, avatar, role });
}
@ -310,7 +222,7 @@ namespace SecondBotEvents.Commands
{
return Failure("Invaild group UUID", "Groupnotice", new [] { group, title, message });
}
if (bot.MyGroups.ContainsKey(groupuuid) == false)
if (getClient().Groups.GroupName2KeyCache.ContainsKey(groupuuid) == false)
{
return Failure("Unknown group", "Groupnotice", new [] { group, title, message });
}
@ -322,17 +234,15 @@ namespace SecondBotEvents.Commands
{
return Failure("Message empty", "Groupnotice", new [] { group, title, message });
}
Group G = bot.MyGroups[groupuuid];
if (G.Powers.HasFlag(GroupPowers.SendNotices) == false)
{
return Failure("Missing group notice power", "Groupnotice", new [] { group, title, message });
}
return Failure("@todo groups stoage");
/*
GroupNotice NewNotice = new GroupNotice();
NewNotice.Subject = title;
NewNotice.Message = message;
NewNotice.OwnerID = getClient().Self.AgentID;
getClient().Groups.SendGroupNotice(groupuuid, NewNotice);
return BasicReply("Sending notice", "Groupnotice", new [] { group, title, message });
*/
}
[About("Activates the selected title")]
@ -357,7 +267,7 @@ namespace SecondBotEvents.Commands
{
return Failure("Invaild role UUID", "GroupActiveTitle", new [] { group, role });
}
if (bot.MyGroups.ContainsKey(groupuuid) == false)
if (getClient().Groups.GroupName2KeyCache.ContainsKey(groupuuid) == false)
{
return Failure("Unknown group", "GroupActiveTitle", new [] { group, role });
}
@ -381,9 +291,9 @@ namespace SecondBotEvents.Commands
{
return Failure("Invaild group UUID", "GroupActiveGroup", new [] { group });
}
if (bot.MyGroups.ContainsKey(groupuuid) == false)
if (getClient().Groups.GroupName2KeyCache.ContainsKey(groupuuid) == false)
{
return Failure("Unknown group", "GroupActiveGroup", new [] { group });
return Failure("Unknown group", "GroupActiveGroup", new[] { group });
}
getClient().Groups.ActivateGroup(groupuuid);
return BasicReply("Switching active group", "GroupActiveGroup", new [] { group });
@ -416,7 +326,7 @@ namespace SecondBotEvents.Commands
{
return Failure("Invaild inventory UUID", "GroupnoticeWithAttachment", new [] { group, title, message, attachment });
}
if (bot.MyGroups.ContainsKey(groupuuid) == false)
if (getClient().Groups.GroupName2KeyCache.ContainsKey(groupuuid) == false)
{
return Failure("Unknown group", "GroupnoticeWithAttachment", new [] { group, title, message, attachment });
}
@ -428,6 +338,8 @@ namespace SecondBotEvents.Commands
{
return Failure("Message empty", "GroupnoticeWithAttachment", new [] { group, title, message, attachment });
}
return Failure("@togo groups storage");
/*
Group G = bot.MyGroups[groupuuid];
if (G.Powers.HasFlag(GroupPowers.SendNotices) == false)
{
@ -440,6 +352,7 @@ namespace SecondBotEvents.Commands
NewNotice.AttachmentID = inventoryuuid;
getClient().Groups.SendGroupNotice(groupuuid, NewNotice);
return BasicReply("Sending notice with attachment", "GroupnoticeWithAttachment", new [] { group, title, message, attachment });
*/
}
@ -452,12 +365,15 @@ namespace SecondBotEvents.Commands
{
return Failure("Token not accepted");
}
return Failure("@togo groups storage");
/*
Dictionary<string, string> grouppackage = new Dictionary<string, string>();
foreach (KeyValuePair<UUID, Group> entry in bot.MyGroups)
{
grouppackage.Add(entry.Value.ID.ToString(), entry.Value.Name);
}
return BasicReply(JsonConvert.SerializeObject(grouppackage), "GetGroupList");
*/
}
[About("Requests the roles for the selected group<br/>Replys with GroupRoleDetails object formated as follows <ul><li>UpdateUnderway (Bool)</li><li>RoleDataAge (Int) [default -1]</li><li>Roles (KeyPair array of UUID=Name)</li></ul><br/>")]
@ -477,10 +393,12 @@ namespace SecondBotEvents.Commands
{
return Failure("Invaild group UUID", "GetGroupRoles", new [] { group });
}
if (bot.MyGroups.ContainsKey(groupuuid) == false)
if (getClient().Groups.GroupName2KeyCache.ContainsKey(groupuuid) == false)
{
return Failure("Unknown group", "GetGroupRoles", new [] { group });
}
return Failure("@todo group role storage");
/*
GroupRoleDetails reply = new GroupRoleDetails();
reply.UpdateUnderway = false;
reply.RoleDataAge = -1;
@ -511,6 +429,7 @@ namespace SecondBotEvents.Commands
}
}
return BasicReply(JsonConvert.SerializeObject(reply), "GetGroupRoles", new [] { group });
*/
}
[About("fetchs a list of all groups with unread messages")]
@ -522,7 +441,7 @@ namespace SecondBotEvents.Commands
{
return Failure("Token not accepted");
}
return BasicReply(JsonConvert.SerializeObject(bot.UnreadGroupchatGroups()), "GroupchatListAllUnreadGroups");
return Failure("@todo group message storage");
}
[About("fetchs a list of all groups with unread messages")]
@ -542,11 +461,11 @@ namespace SecondBotEvents.Commands
{
return Failure("group value is invaild", "GroupchatGroupHasUnread", new [] { group });
}
if(bot.MyGroups.ContainsKey(groupUUID) == false)
if(getClient().Groups.GroupName2KeyCache.ContainsKey(groupUUID) == false)
{
return Failure("Unknown group", "GroupchatGroupHasUnread", new [] { group });
}
return BasicReply(bot.GroupHasUnread(groupUUID).ToString(), "GroupchatGroupHasUnread", new [] { group });
return Failure("@todo group message storage");
}
@ -559,7 +478,7 @@ namespace SecondBotEvents.Commands
{
return Failure("Token not accepted");
}
return BasicReply(bot.HasUnreadGroupchats().ToString(), "GroupchatAnyUnread");
return Failure("@todo group message storage");
}
[About("Clears all group chat buffers at once")]
@ -571,8 +490,7 @@ namespace SecondBotEvents.Commands
{
return Failure("Token not accepted");
}
bot.ClearAllGroupchat();
return BasicReply("ok", "GroupchatClearAll");
return Failure("@todo group message storage");
}
[About("fetchs the groupchat history")]
@ -590,7 +508,7 @@ namespace SecondBotEvents.Commands
{
return Failure("Group UUID invaild", "GroupchatHistory", new [] { group });
}
return BasicReply(JsonConvert.SerializeObject(bot.GetGroupchat(groupUUID)), "GroupchatHistory", new [] { group });
return Failure("@todo group message storage");
}
[About("sends a message to the groupchat")]
@ -612,22 +530,11 @@ namespace SecondBotEvents.Commands
{
return Failure("group value is invaild", "Groupchat", new [] { group, message });
}
if (bot.MyGroups.ContainsKey(groupUUID) == false)
if (getClient().Groups.GroupName2KeyCache.ContainsKey(groupUUID) == false)
{
return Failure("Unknown group", "Groupchat", new [] { group, message });
}
Group G = bot.MyGroups[groupUUID];
if (G.Powers.HasFlag(GroupPowers.JoinChat) == false)
{
return Failure("Missing group JoinChat power", "Groupchat", new [] { group, message });
}
if (bot.GetActiveGroupchatSessions.Contains(groupUUID) == false)
{
getClient().Self.RequestJoinGroupChat(groupUUID);
return Failure("Opening groupchat - Please retry later", "Groupchat", new [] { group, message });
}
getClient().Self.InstantMessageGroup(groupUUID, message);
return BasicReply("Sending", "Groupchat", new [] { group, message });
return Failure("@todo groupchat");
}
protected KeyValuePair<bool, string> waitForReady(bool avatar, bool group, UUID groupuuid)

View file

@ -31,7 +31,7 @@ namespace SecondBotEvents.Commands
{
return Failure("Token not accepted");
}
return BasicReply(bot.addInventoryUpdateEvent(inventoryType, outputTarget), "SetInventoryUpdate");
return Failure("@todo inventory update events");
}
[About("Uploads a new sound file to inventory")]
@ -114,7 +114,7 @@ namespace SecondBotEvents.Commands
{
return Failure("Item name is to short", "RenameInventory", new [] { item, newname });
}
InventoryItem realitem = HelperInventory.getItemByInventoryUUID(bot, target);
InventoryItem realitem = HelperInventory.getItemByInventoryUUID(getClient(), target);
if (realitem == null)
{
return Failure("Unable to find inventory item", "RenameInventory", new [] { item, newname });
@ -177,7 +177,7 @@ namespace SecondBotEvents.Commands
{
return Failure("invaild item uuid", "Attach", new [] { item });
}
InventoryItem realitem = HelperInventory.getItemByInventoryUUID(bot, itemuuid);
InventoryItem realitem = HelperInventory.getItemByInventoryUUID(getClient(), itemuuid);
getClient().Appearance.AddAttachments(new List<InventoryItem>() { realitem }, false, false);
return BasicReply("Ok", "Attach", new [] { item });
}
@ -197,7 +197,7 @@ namespace SecondBotEvents.Commands
{
return Failure("invaild item uuid", "Detach", new [] { item });
}
InventoryItem realitem = HelperInventory.getItemByInventoryUUID(bot, itemuuid);
InventoryItem realitem = HelperInventory.getItemByInventoryUUID(getClient(), itemuuid);
getClient().Appearance.RemoveFromOutfit(realitem);
return BasicReply("Ok", "Detach", new [] { item });
}
@ -331,7 +331,7 @@ namespace SecondBotEvents.Commands
{
return Failure("Invaild item uuid", "getRealUUID", new [] { item });
}
UUID reply = HelperInventory.GetAssetUUID(bot, itemUUID);
UUID reply = HelperInventory.GetAssetUUID(getClient(), itemUUID);
return BasicReply(reply.ToString(), "getRealUUID", new [] { item });
}
@ -392,7 +392,7 @@ namespace SecondBotEvents.Commands
{
return Failure("Invaild folder uuid", "SendFolder", new [] { folder, avatar });
}
InventoryBase FindFolderHelper = HelperInventory.FindFolder(bot, getClient().Inventory.Store.RootFolder, targetfolder);
InventoryBase FindFolderHelper = HelperInventory.FindFolder(getClient(), getClient().Inventory.Store.RootFolder, targetfolder);
if (FindFolderHelper == null)
{
return Failure("Unable to find folder", "SendFolder", new [] { folder, avatar });
@ -478,7 +478,7 @@ namespace SecondBotEvents.Commands
{
return Failure("Token not accepted");
}
string reply = HelperInventory.MapFolderJson(bot);
string reply = HelperInventory.MapFolderJson(getClient());
if (reply != null) return BasicReply(reply, "InventoryFolders");
return Failure("Error", "InventoryFolders");
}
@ -494,7 +494,7 @@ namespace SecondBotEvents.Commands
{
return Failure("Token not accepted");
}
string reply = HelperInventory.MapFolderJson(bot, targetfolder,false);
string reply = HelperInventory.MapFolderJson(getClient(), targetfolder,false);
if (reply != null) return BasicReply(reply, "InventoryFoldersLimited");
return Failure("Error", "InventoryFoldersLimited");
}
@ -514,7 +514,7 @@ namespace SecondBotEvents.Commands
{
return Failure("Invaild folder UUID", "InventoryContents", new [] { folderUUID });
}
return BasicReply(HelperInventory.MapFolderInventoryJson(bot, folder), "InventoryContents", new [] { folderUUID });
return BasicReply(HelperInventory.MapFolderInventoryJson(getClient(), folder), "InventoryContents", new [] { folderUUID });
}
}
}

View file

@ -105,7 +105,7 @@ namespace SecondBotEvents.Commands
{
return Failure("Invaild avatar UUID", "RequestTeleport", new [] { avatar });
}
bot.Add_action_from("teleport", avataruuid, bot.FindAvatarKey2Name(avataruuid));
// @todo action from event log with accept
getClient().Self.SendTeleportLureRequest(avataruuid, "I would like to teleport to you");
return BasicReply("ok", "RequestTeleport", new [] { avatar });
}
@ -248,7 +248,6 @@ namespace SecondBotEvents.Commands
{
return Failure("Error Unable to Teleport to location", "Teleport", new [] { region, x, y, z });
}
bot.SetTeleported();
return BasicReply("Accepted", "Teleport", new [] { region, x, y, z });
}
@ -268,7 +267,6 @@ namespace SecondBotEvents.Commands
{
return Failure("slurl is empty", "TeleportSLURL", new [] { slurl });
}
bot.SetTeleported();
return BasicReply(TeleportRequest(new [] { slurl }).ToString(), "TeleportSLURL", new [] { slurl });
}
@ -277,11 +275,7 @@ namespace SecondBotEvents.Commands
getClient().Self.AutoPilotCancel();
if (args[0].Contains("http://maps.secondlife.com/secondlife/") == true)
{
if (bot.TeleportWithSLurl(args[0]) == "ok")
{
return true;
}
return false;
return false; // @todo SL url teleport
}
else
{
@ -298,9 +292,7 @@ namespace SecondBotEvents.Commands
float.TryParse(argvalues[1], out float posX);
float.TryParse(argvalues[2], out float posY);
float.TryParse(argvalues[3], out float posZ);
bot.SetTeleported();
bool status = getClient().Self.Teleport(regionName, new Vector3(posX, posY, posZ));
bot.ResetAnimations();
return true;
}
else

View file

@ -34,8 +34,8 @@ namespace SecondBotEvents.Commands
{
return Failure("Content value is empty", "NotecardAdd", new [] { collection, content });
}
bot.NotecardAddContent(collection, content);
return BasicReply("ok", "NotecardAdd", new [] { collection, content });
return Failure("@todo notecard temp stroage");
//return BasicReply("ok", "NotecardAdd", new [] { collection, content });
}
[About("Clears the contents of a collection")]
@ -53,8 +53,7 @@ namespace SecondBotEvents.Commands
{
return Failure("Collection value is empty", "NotecardClear", new [] { collection });
}
bot.ClearNotecardStorage(collection);
return BasicReply("ok", "NotecardClear", new [] { collection });
return Failure("@todo notecard storage");
}
[About("Sends a notecard to a avatar using the text in the prebuilt collection [see NotecardAdd] and also clears the collection just before sending [see NotecardClear]")]
@ -86,13 +85,7 @@ namespace SecondBotEvents.Commands
{
return Failure("Invaild avatar uuid", "NotecardSend", new [] { avatar, collection, notecardname });
}
string content = bot.GetNotecardContent(collection);
if (content == null)
{
return Failure("No content in notecard storage " + collection, "NotecardSend", new [] { avatar, collection, notecardname });
}
bot.ClearNotecardStorage(collection);
return BasicReply(bot.SendNotecard(notecardname, content, avataruuid).ToString(), "NotecardSend", new [] { avatar, collection, notecardname });
return Failure("@todo notecard storage");
}
[About("Creates and sends a notecard in one command good if you are using HTTP otherwise see [NotecardSend]")]
@ -123,7 +116,7 @@ namespace SecondBotEvents.Commands
{
return Failure("Invaild avatar uuid", "NotecardDirectSend", new[] { avatar, content, notecardname });
}
return BasicReply(bot.SendNotecard(notecardname, content, avataruuid).ToString(), "NotecardDirectSend", new[] { avatar, content, notecardname });
return Failure("@todo notecard sending");
}
}
}

View file

@ -362,7 +362,7 @@ namespace SecondBotEvents.Commands
{
return Failure(tests.Value, "SetParcelMusic", new [] { musicurl });
}
bool status = parcel_static.set_parcel_music(bot, targetparcel, musicurl);
bool status = parcel_static.set_parcel_music(getClient(), targetparcel, musicurl);
return BasicReply(status.ToString(), "SetParcelMusic", new [] { musicurl });
}
@ -417,7 +417,7 @@ namespace SecondBotEvents.Commands
{
return Failure("No accepted flags", "SetParcelFlag", new [] { escapedflagdata });
}
if (parcel_static.has_parcel_perm(targetparcel, bot) == false)
if (parcel_static.has_parcel_perm(targetparcel, getClient()) == false)
{
return Failure("Incorrect perms to control parcel", "SetParcelFlag", new [] { escapedflagdata });
}
@ -482,7 +482,7 @@ namespace SecondBotEvents.Commands
{
return Failure("Invaild group uuid", "ParcelDeedToGroup", new [] { group });
}
if (bot.MyGroups.ContainsKey(groupuuid) == false)
if (getClient().Groups.GroupName2KeyCache.ContainsKey(groupuuid) == false)
{
return Failure("Not in group", "ParcelDeedToGroup", new [] { group });
}
@ -597,10 +597,7 @@ namespace SecondBotEvents.Commands
{
if (e.AgentID != UUID.Zero)
{
if (bot.FindAvatarKey2Name(e.AgentID) == "lookup")
{
haslookup = true;
}
break;
}
}
if(haslookup == true)

View file

@ -23,8 +23,7 @@ namespace SecondBotEvents.Commands
{
return Failure("Token not accepted");
}
bot.GotoNextHomeRegion();
return BasicReply("ok", "GoHome");
return Failure("@todo home system");
}
[About("Makes the bot turn to face avatar and point at them (if found)")]
@ -42,7 +41,6 @@ namespace SecondBotEvents.Commands
{
return Failure("Cant find UUID in sim", "PointAt", new [] { avatar });
}
bot.ResetAnimations();
getClient().Self.Stand();
getClient().Self.Movement.TurnToward(getClient().Network.CurrentSim.AvatarPositions[avataruuid]);
getClient().Self.Movement.SendUpdate();
@ -63,11 +61,7 @@ namespace SecondBotEvents.Commands
{
return Failure("Token not accepted");
}
if (bot.HaveLocalKeyStorage(Key) == true)
{
return BasicReply(bot.ReadLocalKeyStorage(Key), "ReadKeyValue");
}
return Failure("Unknown Key: "+Key, "ReadKeyValue");
return Failure("@todo key value storage");
}
[About("sets a value for KeyValue storage (temp unless SQL is enabled)")]
@ -91,8 +85,7 @@ namespace SecondBotEvents.Commands
{
return Failure("Value is empty", "SetKeyValue", new[] { Key, Value });
}
bot.setLocalKeyStorage(Key, Value);
return BasicReply("ok", "SetKeyValue");
return Failure("@todo key value storage");
}
[About("Reads a value from the KeyValue storage (temp unless SQL is enabled)")]
@ -110,8 +103,7 @@ namespace SecondBotEvents.Commands
{
return Failure("Key is empty", "SetKeyValue", new[] { Key });
}
bot.clearLocalKeyStorage(Key);
return BasicReply("ok", "SetKeyValue");
return Failure("@todo key value storage");
}
[About("Makes the bot sit on the ground or on a object if it can see it")]
@ -148,7 +140,6 @@ namespace SecondBotEvents.Commands
return Failure("Token not accepted");
}
getClient().Self.Stand();
bot.ResetAnimations();
return BasicReply("ok", "Stand");
}
@ -195,11 +186,7 @@ namespace SecondBotEvents.Commands
{
return Failure("Token not accepted");
}
if (bot.KillMe == false)
{
getClient().Self.Chat("Laters im out", 0, ChatType.Normal);
bot.KillMePlease();
}
getClient().Network.BeginLogout();
return BasicReply("ok", "Logoff");
}
@ -213,7 +200,7 @@ namespace SecondBotEvents.Commands
return Failure("Token not accepted");
}
SuccessNoReturn("GetLastCommands");
return bot.GetLastCommands(5);
return Failure("@todo command storage");
}
[About("Sets the bot to accept a request type from the avatar (or a object owned by the avatar)\n " +

View file

@ -68,14 +68,7 @@ namespace SecondBotEvents.Commands
{
return Failure("Notecard title is to short", "FetchNextNotecard", new [] { endpoint, endpointcode });
}
return BasicReply
(
bot.SendNotecard(server_reply.NotecardTitle,
server_reply.NotecardContent,
(UUID)server_reply.AvatarUUID).ToString(),
"FetchNextNotecard",
new [] { endpoint, endpointcode }
);
return Failure("@todo notecard sending");
}
catch (Exception e)
{

View file

@ -62,7 +62,7 @@ namespace SecondBotEvents
{
fromFolder = args[0];
}
RestartServices();
StartServices();
}
public void RestartServices()