Small non-functional inventory changes
parent
69cc4596b1
commit
e9efd5bee2
|
@ -38,18 +38,18 @@ using OpenSim.Framework.Servers;
|
||||||
namespace OpenSim.Region.Capabilities
|
namespace OpenSim.Region.Capabilities
|
||||||
{
|
{
|
||||||
public delegate void UpLoadedAsset(
|
public delegate void UpLoadedAsset(
|
||||||
string assetName, string description, LLUUID assetID, LLUUID inventoryItem, LLUUID parentFolder, byte[] data,
|
string assetName, string description, LLUUID assetID, LLUUID inventoryItem, LLUUID parentFolder,
|
||||||
string inventoryType, string assetType);
|
byte[] data, string inventoryType, string assetType);
|
||||||
|
|
||||||
public delegate LLUUID UpdateItem(LLUUID itemID, byte[] data);
|
public delegate LLUUID UpdateItem(LLUUID itemID, byte[] data);
|
||||||
|
|
||||||
public delegate LLUUID UpdateTaskScript(LLUUID itemID, LLUUID primID, bool isScriptRunning, byte[] data);
|
public delegate void UpdateTaskScript(LLUUID itemID, LLUUID primID, bool isScriptRunning, byte[] data);
|
||||||
|
|
||||||
public delegate void NewInventoryItem(LLUUID userID, InventoryItemBase item);
|
public delegate void NewInventoryItem(LLUUID userID, InventoryItemBase item);
|
||||||
|
|
||||||
public delegate LLUUID ItemUpdatedCallback(LLUUID userID, LLUUID itemID, byte[] data);
|
public delegate LLUUID ItemUpdatedCallback(LLUUID userID, LLUUID itemID, byte[] data);
|
||||||
|
|
||||||
public delegate LLUUID TaskScriptUpdatedCallback(LLUUID userID, LLUUID itemID, LLUUID primID,
|
public delegate void TaskScriptUpdatedCallback(LLUUID userID, LLUUID itemID, LLUUID primID,
|
||||||
bool isScriptRunning, byte[] data);
|
bool isScriptRunning, byte[] data);
|
||||||
|
|
||||||
public class Caps
|
public class Caps
|
||||||
|
@ -349,7 +349,10 @@ namespace OpenSim.Region.Capabilities
|
||||||
uploadResponse.uploader = uploaderURL;
|
uploadResponse.uploader = uploaderURL;
|
||||||
uploadResponse.state = "upload";
|
uploadResponse.state = "upload";
|
||||||
|
|
||||||
MainLog.Instance.Verbose("CAPS", "NoteCardAgentInventory response: {0}", LLSDHelpers.SerialiseLLSDReply(uploadResponse));
|
// MainLog.Instance.Verbose(
|
||||||
|
// "CAPS",
|
||||||
|
// "NoteCardAgentInventory response: {0}",
|
||||||
|
// LLSDHelpers.SerialiseLLSDReply(uploadResponse));
|
||||||
|
|
||||||
return LLSDHelpers.SerialiseLLSDReply(uploadResponse);
|
return LLSDHelpers.SerialiseLLSDReply(uploadResponse);
|
||||||
}
|
}
|
||||||
|
@ -461,14 +464,12 @@ namespace OpenSim.Region.Capabilities
|
||||||
/// <param name="primID">Prim containing item to update</param>
|
/// <param name="primID">Prim containing item to update</param>
|
||||||
/// <param name="isScriptRunning">Signals whether the script to update is currently running</param>
|
/// <param name="isScriptRunning">Signals whether the script to update is currently running</param>
|
||||||
/// <param name="data">New asset data</param>
|
/// <param name="data">New asset data</param>
|
||||||
public LLUUID TaskScriptUpdated(LLUUID itemID, LLUUID primID, bool isScriptRunning, byte[] data)
|
public void TaskScriptUpdated(LLUUID itemID, LLUUID primID, bool isScriptRunning, byte[] data)
|
||||||
{
|
{
|
||||||
if (TaskScriptUpdatedCall != null)
|
if (TaskScriptUpdatedCall != null)
|
||||||
{
|
{
|
||||||
return TaskScriptUpdatedCall(m_agentID, itemID, primID, isScriptRunning, data);
|
TaskScriptUpdatedCall(m_agentID, itemID, primID, isScriptRunning, data);
|
||||||
}
|
}
|
||||||
|
|
||||||
return LLUUID.Zero;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public class AssetUploader
|
public class AssetUploader
|
||||||
|
@ -661,11 +662,10 @@ namespace OpenSim.Region.Capabilities
|
||||||
|
|
||||||
string res = "";
|
string res = "";
|
||||||
LLSDTaskInventoryUploadComplete uploadComplete = new LLSDTaskInventoryUploadComplete();
|
LLSDTaskInventoryUploadComplete uploadComplete = new LLSDTaskInventoryUploadComplete();
|
||||||
LLUUID assetID = LLUUID.Zero;
|
|
||||||
|
|
||||||
if (OnUpLoad != null)
|
if (OnUpLoad != null)
|
||||||
{
|
{
|
||||||
assetID = OnUpLoad(inventoryItemID, primID, isScriptRunning, data);
|
OnUpLoad(inventoryItemID, primID, isScriptRunning, data);
|
||||||
}
|
}
|
||||||
|
|
||||||
uploadComplete.item_id = inventoryItemID;
|
uploadComplete.item_id = inventoryItemID;
|
||||||
|
|
|
@ -42,16 +42,12 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
//split these method into this partial as a lot of these (hopefully) are only temporary and won't be needed once Caps is more complete
|
//split these method into this partial as a lot of these (hopefully) are only temporary and won't be needed once Caps is more complete
|
||||||
// or at least some of they can be moved somewhere else
|
// or at least some of they can be moved somewhere else
|
||||||
|
|
||||||
public void AddInventoryItem(LLUUID avatarId, InventoryItemBase item)
|
/// <summary>
|
||||||
{
|
/// Add an inventory item to an avatar's inventory.
|
||||||
ScenePresence avatar;
|
/// </summary>
|
||||||
|
/// <param name="remoteClient">The remote client controlling the avatar</param>
|
||||||
if (TryGetAvatar(avatarId, out avatar))
|
/// <param name="item">The item. This structure contains all the item metadata, including the folder
|
||||||
{
|
/// in which the item is to be placed.</param>
|
||||||
AddInventoryItem(avatar.ControllingClient, item);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void AddInventoryItem(IClientAPI remoteClient, InventoryItemBase item)
|
public void AddInventoryItem(IClientAPI remoteClient, InventoryItemBase item)
|
||||||
{
|
{
|
||||||
CachedUserInfo userInfo = CommsManager.UserProfileCacheService.GetUserDetails(remoteClient.AgentId);
|
CachedUserInfo userInfo = CommsManager.UserProfileCacheService.GetUserDetails(remoteClient.AgentId);
|
||||||
|
@ -62,16 +58,24 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public LLUUID CapsUpdateInventoryItemAsset(LLUUID avatarId, LLUUID itemID, byte[] data)
|
/// <summary>
|
||||||
|
/// <see>AddInventoryItem(LLUUID, InventoryItemBase)</see>
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="avatarId">The ID of the avatar</param>
|
||||||
|
/// <param name="item">The item. This structure contains all the item metadata, including the folder
|
||||||
|
/// in which the item is to be placed.</param>
|
||||||
|
public void AddInventoryItem(LLUUID avatarId, InventoryItemBase item)
|
||||||
{
|
{
|
||||||
ScenePresence avatar;
|
ScenePresence avatar;
|
||||||
|
|
||||||
if (TryGetAvatar(avatarId, out avatar))
|
if (!TryGetAvatar(avatarId, out avatar))
|
||||||
{
|
{
|
||||||
return CapsUpdateInventoryItemAsset(avatar.ControllingClient, itemID, data);
|
MainLog.Instance.Error(
|
||||||
|
"AGENTINVENTORY", "Could not find avatar {0} to add inventory item", avatarId);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
return LLUUID.Zero;
|
AddInventoryItem(avatar.ControllingClient, item);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -114,6 +118,28 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
return LLUUID.Zero;
|
return LLUUID.Zero;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// <see>CapsUpdatedInventoryItemAsset(IClientAPI, LLUUID, byte[])</see>
|
||||||
|
/// </summary>
|
||||||
|
private LLUUID CapsUpdateInventoryItemAsset(LLUUID avatarId, LLUUID itemID, byte[] data)
|
||||||
|
{
|
||||||
|
ScenePresence avatar;
|
||||||
|
|
||||||
|
if (TryGetAvatar(avatarId, out avatar))
|
||||||
|
{
|
||||||
|
return CapsUpdateInventoryItemAsset(avatar.ControllingClient, itemID, data);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
MainLog.Instance.Error(
|
||||||
|
"AGENTINVENTORY",
|
||||||
|
"Avatar {0} cannot be found to update its inventory item asset",
|
||||||
|
avatarId);
|
||||||
|
}
|
||||||
|
|
||||||
|
return LLUUID.Zero;
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Capability originating call to update the asset of a script in a prim's (task's) inventory
|
/// Capability originating call to update the asset of a script in a prim's (task's) inventory
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -123,8 +149,8 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
/// <param name="isScriptRunning">Indicates whether the script to update is currently running</param>
|
/// <param name="isScriptRunning">Indicates whether the script to update is currently running</param>
|
||||||
/// <param name="data"></param>
|
/// <param name="data"></param>
|
||||||
/// <returns>Asset LLUID created</returns>
|
/// <returns>Asset LLUID created</returns>
|
||||||
public LLUUID CapsUpdateTaskInventoryScriptAsset(LLUUID avatarID, LLUUID itemID,
|
public void CapsUpdateTaskInventoryScriptAsset(IClientAPI remoteClient, LLUUID itemId,
|
||||||
LLUUID primID, bool isScriptRunning, byte[] data)
|
LLUUID primId, bool isScriptRunning, byte[] data)
|
||||||
{
|
{
|
||||||
// TODO Not currently doing anything with the isScriptRunning bool
|
// TODO Not currently doing anything with the isScriptRunning bool
|
||||||
|
|
||||||
|
@ -132,7 +158,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
"PRIMINVENTORY",
|
"PRIMINVENTORY",
|
||||||
"Prim inventory script save functionality not yet implemented."
|
"Prim inventory script save functionality not yet implemented."
|
||||||
+ " remoteClient: {0}, itemID: {1}, primID: {2}, isScriptRunning: {3}",
|
+ " remoteClient: {0}, itemID: {1}, primID: {2}, isScriptRunning: {3}",
|
||||||
avatarID, itemID, primID, isScriptRunning);
|
remoteClient, itemId, primId, isScriptRunning);
|
||||||
|
|
||||||
// TODO
|
// TODO
|
||||||
// Retrieve client LLUID
|
// Retrieve client LLUID
|
||||||
|
@ -143,8 +169,28 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
// Trigger SOG update (see RezScript)
|
// Trigger SOG update (see RezScript)
|
||||||
// Trigger rerunning of script (use TriggerRezScript event, see RezScript)
|
// Trigger rerunning of script (use TriggerRezScript event, see RezScript)
|
||||||
// return new asset id
|
// return new asset id
|
||||||
|
}
|
||||||
|
|
||||||
return null;
|
/// <summary>
|
||||||
|
/// <see>CapsUpdateTaskInventoryScriptAsset(IClientAPI, LLUUID, LLUUID, bool, byte[])</see>
|
||||||
|
/// </summary>
|
||||||
|
private void CapsUpdateTaskInventoryScriptAsset(LLUUID avatarId, LLUUID itemId,
|
||||||
|
LLUUID primId, bool isScriptRunning, byte[] data)
|
||||||
|
{
|
||||||
|
ScenePresence avatar;
|
||||||
|
|
||||||
|
if (TryGetAvatar(avatarId, out avatar))
|
||||||
|
{
|
||||||
|
CapsUpdateTaskInventoryScriptAsset(
|
||||||
|
avatar.ControllingClient, itemId, primId, isScriptRunning, data);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
MainLog.Instance.Error(
|
||||||
|
"PRIMINVENTORY",
|
||||||
|
"Avatar {0} cannot be found to update its prim item asset",
|
||||||
|
avatarId);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -213,14 +259,14 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
MainLog.Instance.Warn(
|
MainLog.Instance.Warn(
|
||||||
"INVENTORY",
|
"AGENTINVENTORY",
|
||||||
"Item ID " + itemID + " not found for an inventory item update.");
|
"Item ID " + itemID + " not found for an inventory item update.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
MainLog.Instance.Warn(
|
MainLog.Instance.Warn(
|
||||||
"INVENTORY",
|
"AGENTINVENTORY",
|
||||||
"Agent ID " + remoteClient.AgentId + " not found for an inventory item update.");
|
"Agent ID " + remoteClient.AgentId + " not found for an inventory item update.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -233,7 +279,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
CachedUserInfo userInfo = CommsManager.UserProfileCacheService.GetUserDetails(oldAgentID);
|
CachedUserInfo userInfo = CommsManager.UserProfileCacheService.GetUserDetails(oldAgentID);
|
||||||
if (userInfo == null)
|
if (userInfo == null)
|
||||||
{
|
{
|
||||||
MainLog.Instance.Warn("INVENTORY", "Failed to find user " + oldAgentID.ToString());
|
MainLog.Instance.Warn("AGENTINVENTORY", "Failed to find user " + oldAgentID.ToString());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -242,13 +288,13 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
item = userInfo.RootFolder.HasItem(oldItemID);
|
item = userInfo.RootFolder.HasItem(oldItemID);
|
||||||
if (item == null)
|
if (item == null)
|
||||||
{
|
{
|
||||||
MainLog.Instance.Warn("INVENTORY", "Failed to find item " + oldItemID.ToString());
|
MainLog.Instance.Warn("AGENTINVENTORY", "Failed to find item " + oldItemID.ToString());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
MainLog.Instance.Warn("INVENTORY", "Failed to find item " + oldItemID.ToString());
|
MainLog.Instance.Warn("AGENTINVENTORY", "Failed to find item " + oldItemID.ToString());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -257,7 +303,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
AssetBase asset = AssetCache.CopyAsset(item.assetID);
|
AssetBase asset = AssetCache.CopyAsset(item.assetID);
|
||||||
if (asset == null)
|
if (asset == null)
|
||||||
{
|
{
|
||||||
MainLog.Instance.Warn("INVENTORY", "Failed to find asset " + item.assetID.ToString());
|
MainLog.Instance.Warn("AGENTINVENTORY", "Failed to find asset " + item.assetID.ToString());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -282,13 +328,13 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
public void MoveInventoryItem(IClientAPI remoteClient,LLUUID folderID, LLUUID itemID, int length, string newName)
|
public void MoveInventoryItem(IClientAPI remoteClient,LLUUID folderID, LLUUID itemID, int length, string newName)
|
||||||
{
|
{
|
||||||
MainLog.Instance.Verbose(
|
MainLog.Instance.Verbose(
|
||||||
"INVENTORY",
|
"AGENTINVENTORY",
|
||||||
"Moving item for " + remoteClient.AgentId.ToString());
|
"Moving item for " + remoteClient.AgentId.ToString());
|
||||||
|
|
||||||
CachedUserInfo userInfo = CommsManager.UserProfileCacheService.GetUserDetails(remoteClient.AgentId);
|
CachedUserInfo userInfo = CommsManager.UserProfileCacheService.GetUserDetails(remoteClient.AgentId);
|
||||||
if (userInfo == null)
|
if (userInfo == null)
|
||||||
{
|
{
|
||||||
MainLog.Instance.Warn("INVENTORY", "Failed to find user " + remoteClient.AgentId.ToString());
|
MainLog.Instance.Warn("AGENTINVENTORY", "Failed to find user " + remoteClient.AgentId.ToString());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -309,13 +355,13 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
MainLog.Instance.Warn("INVENTORY", "Failed to find item " + itemID.ToString());
|
MainLog.Instance.Warn("AGENTINVENTORY", "Failed to find item " + itemID.ToString());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
MainLog.Instance.Warn("INVENTORY", "Failed to find item " + itemID.ToString() + ", no root folder");
|
MainLog.Instance.Warn("AGENTINVENTORY", "Failed to find item " + itemID.ToString() + ", no root folder");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue