Ejemplo n.º 1
0
 public object InventoryContents(string folderUUID, string token)
 {
     if (tokens.Allow(token, "inventory", "InventoryContents", handleGetClientIP()) == false)
     {
         return(Failure("Token not accepted", "InventoryContents", new [] { folderUUID }));
     }
     if (UUID.TryParse(folderUUID, out UUID folder) == false)
     {
         return(Failure("Invaild folder UUID", "InventoryContents", new [] { folderUUID }));
     }
     return(BasicReply(HelperInventory.MapFolderInventoryJson(bot, folder), "InventoryContents", new [] { folderUUID }));
 }
Ejemplo n.º 2
0
 public override bool CallFunction(string[] args)
 {
     if (base.CallFunction(args) == true)
     {
         if (UUID.TryParse(args[1], out UUID targetfolder) == true)
         {
             if (UUID.TryParse(args[0], out UUID targetavatar) == true)
             {
                 KeyValuePair <string, string> content = HelperInventory.MapFolderInventoryHumanReadable(bot, targetfolder);
                 if (content.Value != null)
                 {
                     string notecardname = "" + content.Key + " Contents @" + helpers.UnixTimeNow().ToString() + "";
                     bot.SendNotecard(notecardname, content.Value, targetavatar);
                 }
                 else
                 {
                     bot.GetClient.Self.InstantMessage(targetavatar, "Unable to load folder or it is empty");
                 }
                 return(true);
             }
             else
             {
                 return(bot.GetCommandsInterface.SmartCommandReply(true, args[0], HelperInventory.MapFolderInventoryJson(bot, targetfolder), CommandName));
             }
         }
         else
         {
             return(Failed("Invaild folder UUID"));
         }
     }
     return(false);
 }