Closed zontreck closed 2 years ago
Can you share a snippet of how you are invoking the method?
Sorry was busy with RL. Heres that snippet i promised
inv.RequestUploadNotecardAsset(Encode2Bytes(QT.Text), actualItem.UUID, delegate (bool success, string status, UUID itemID, UUID assetID)
{
if (success)
{
Queue.Instance.UploadSuccess = success;
Queue.Instance.ARE.Set();
}
});
if anyone ever needs it, here is the function my bot uses to write notecards
public bool SendNotecard(string name, string content, UUID sendToUUID)
{
bool returnstatus = true;
name = name + " " + DateTime.Now;
Client.Inventory.RequestCreateItem(
Client.Inventory.FindFolderForType(AssetType.Notecard),
name,
name + " Created via SecondBot notecard API",
AssetType.Notecard,
UUID.Random(),
InventoryType.Notecard,
PermissionMask.All,
(bool Success, InventoryItem item) =>
{
if (Success)
{
AssetNotecard empty = new AssetNotecard { BodyText = "\n" };
empty.Encode();
Client.Inventory.RequestUploadNotecardAsset(empty.AssetData, item.UUID,
(bool emptySuccess, string emptyStatus, UUID emptyItemID, UUID emptyAssetID) =>
{
if (emptySuccess)
{
empty.BodyText = content;
empty.Encode();
Client.Inventory.RequestUploadNotecardAsset(empty.AssetData, emptyItemID,
(bool finalSuccess, string finalStatus, UUID finalItemID, UUID finalID) =>
{
if (finalSuccess)
{
Info("Sending notecard now");
Client.Inventory.GiveItem(finalItemID, name, AssetType.Notecard, sendToUUID, false);
}
else
{
returnstatus = false;
Warn("Unable to request notecard upload");
}
});
}
else
{
Crit("The fuck empty success notecard create");
returnstatus = false;
}
});
}
else
{
Warn("Unable to find default notecards folder");
returnstatus = false;
}
}
);
return returnstatus;
}
Are you uploading the notecard in task inventory (in a prim) or into avatar inventory? It works flawlessly in Radegast: https://github.com/cinderblocks/radegast/blob/master/Radegast/GUI/Consoles/Assets/Notecard.cs#L325
If this is still an issue, please open a new ticket.
When uploading a notecard's contents using this method: RequestUploadNotecardAsset, the function always returns a fail. The asset In world when opened with a viewer reports it isn't in the database.
I can share a snippet of how I invoked this when next at the computer.