*******************************************************************************************************
using System;
using System.Collections.Generic;
using System.Threading;
using OpenMetaverse;
using OpenMetaverse.Packets;
using System.Text;
namespace OpenMetaverse.TestClient
{
public class NotifyGroupCommand : Command
{
private UUID queryID = UUID.Zero;
private UUID resolvedGroupID = UUID.Zero;
private UUID attachmentId = UUID.Zero;
private UUID targetID = UUID.Zero;
private InventoryManager Manager;
private OpenMetaverse.Inventory Inventory;
public NotifyGroupCommand(TestClient testClient)
{
Name = "notifygroup";
Description = "send a notice to a group. Usage: notifygroup GroupId Subject Message AttachmentId";
Category = CommandCategory.Groups;
}
public override string Execute(string[] args, UUID fromAgentID)
{
if (args.Length < 3)
return Description;
// check for the group id
if (!UUID.TryParse((args[0]), out resolvedGroupID))
return "GroupId "args[0]" doesn't seem a valid UUID";
// declare the notice
GroupNotice notice = new GroupNotice();
notice.Subject = args[1];
notice.Message = args[2];
notice.OwnerID = fromAgentID;
string ret = "";
// check for the attachment id
if ( args.Length > 3 )
{
if (!UUID.TryParse((args[3]), out attachmentId))
return "AttachmentID "args[3]" doesn't seem a valid UUID";
Manager = Client.Inventory;
Inventory = Manager.Store;
// WARNING: Uses local copy of inventory contents, need to download them first.
List<InventoryBase> contents = Inventory.GetContents(Client.CurrentDirectory);
bool found = false;
string nl = "\n";
foreach (InventoryBase b in contents)
{
if (attachmentId == b.UUID)
{
found = true;
if (b is InventoryItem)
{
InventoryItem item = b as InventoryItem;
notice.AttachmentID = item.UUID;
ret += "Gave " + item.Name+nl;
}
else
{
ret += "Unable to give folder " + b.Name+nl;
}
}
}
if (!found)
ret += "No inventory item " + attachmentId.ToString() + " found." + nl;
}
Client.Groups.SendGroupNotice(resolvedGroupID,notice);
ret += "Notification sent";
return ret;
}
}
}
*******************************************************************************************************
packet capture with the "official graphical client"(1.21.6) :
--> 216.82.19.47:12035 693 [ Rel Zer]
— ImprovedInstantMessage —
– AgentData –
AgentID: bf362c0b-67ec-49c7-a852-77968e3f7f56
SessionID: c6d421d0-05e3-402f-be1e-b4309f3c087c
– MessageBlock –
FromGroup: False
ToAgentID: a81e9cff-cf2c-8344-6c1a-ac731c583b74
ParentEstateID: 0
RegionID: 00000000-0000-0000-0000-000000000000
Position: <66.6141, 88.2174, 22.40714>
Offline: 0
Dialog: 32
ID: 00000000-0000-0000-0000-000000000000
Timestamp: 0
FromAgentName: ssm2017 Binder
Message: testagain|testagain
BinaryBucket: <? LLSD/XML ?>
<llsd><map><key>item_id</key><uuid>57df262b-14bf-8379-7c3b-e7bf3fd5f8ea</uuid><key>owner_id</key><uuid>bf362c0b-67ec-49c7-a852-77968e3f7f56</uuid></map></llsd>
*******************************************************************************************************
using the "official graphical client"(1.21.6)
using the "master" avatar :
- right click on the landmark in the inventory the "copy asset uuid" :
fa098a58-00f8-3da4-efb5-8cf24249ecb9
- i create a box, then put the landmark inside and create a script :
llOwnerSay((string)(llGetInventoryKey(llGetInventoryName(3, 0))));
result :
fa098a58-00f8-3da4-efb5-8cf24249ecb9
- i send the landmark in a group notice and i capture the packet and see :
57df262b-14bf-8379-7c3b-e7bf3fd5f8ea
using the "bot" avatar :
- right click on the landmark in the inventory the "copy asset uuid" :
fa098a58-00f8-3da4-efb5-8cf24249ecb9
- i create a box, then put the landmark inside and create a script :
llOwnerSay((string)(llGetInventoryKey(llGetInventoryName(3, 0))));
result :
fa098a58-00f8-3da4-efb5-8cf24249ecb9
- i send the landmark in a group notice and i capture the packet and see :
db7afdab-bb40-76e5-8ddd-748f82b96ff7
using the "TestClient" ( trunk 2363 ) :
using the "bot" avatar :
- command "i" :
db7afdab-bb40-76e5-8ddd-748f82b96ff7
- when using my command :
notifygroup a81e9cff-cf2c-8344-6c1a-ac731c583b74 "test" "test" db7afdab-bb40-76e5-8ddd-748f82b96ff7
result :
"No inventory item db7afdab-bb40-76e5-8ddd-748f82b96ff7 found."
- when using my command :
notifygroup a81e9cff-cf2c-8344-6c1a-ac731c583b74 "test" "test" fa098a58-00f8-3da4-efb5-8cf24249ecb9
result :
"No inventory item fa098a58-00f8-3da4-efb5-8cf24249ecb9 found."