From 76c60f1f99ca8aa7c1a336918aa0ef5f83b1ae04 Mon Sep 17 00:00:00 2001
From: Diva Canto
Date: Fri, 3 Jun 2011 08:27:01 -0700
Subject: Moved CreateNewInventoryItem to the InventoryAccessModule in
preparation for supporting HG landmarks.
---
OpenSim/Region/Framework/Scenes/Scene.Inventory.cs | 74 +---------------------
OpenSim/Region/Framework/Scenes/Scene.cs | 4 +-
2 files changed, 3 insertions(+), 75 deletions(-)
(limited to 'OpenSim/Region/Framework')
diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
index 3c47873..b70e1c3 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
@@ -778,7 +778,7 @@ namespace OpenSim.Region.Framework.Scenes
///
///
///
- private void CreateNewInventoryItem(IClientAPI remoteClient, string creatorID, string creatorData, UUID folderID, string name, uint flags, uint callbackID,
+ public void CreateNewInventoryItem(IClientAPI remoteClient, string creatorID, string creatorData, UUID folderID, string name, uint flags, uint callbackID,
AssetBase asset, sbyte invType, uint nextOwnerMask, int creationDate)
{
CreateNewInventoryItem(
@@ -833,78 +833,6 @@ namespace OpenSim.Region.Framework.Scenes
}
///
- /// Create a new inventory item. Called when the client creates a new item directly within their
- /// inventory (e.g. by selecting a context inventory menu option).
- ///
- ///
- ///
- ///
- ///
- ///
- ///
- ///
- ///
- ///
- ///
- public void CreateNewInventoryItem(IClientAPI remoteClient, UUID transactionID, UUID folderID,
- uint callbackID, string description, string name, sbyte invType,
- sbyte assetType,
- byte wearableType, uint nextOwnerMask, int creationDate)
- {
- m_log.DebugFormat("[AGENT INVENTORY]: Received request to create inventory item {0} in folder {1}", name, folderID);
-
- if (!Permissions.CanCreateUserInventory(invType, remoteClient.AgentId))
- return;
-
- InventoryFolderBase f = new InventoryFolderBase(folderID, remoteClient.AgentId);
- InventoryFolderBase folder = InventoryService.GetFolder(f);
-
- if (folder == null || folder.Owner != remoteClient.AgentId)
- return;
-
- if (transactionID == UUID.Zero)
- {
- ScenePresence presence;
- if (TryGetScenePresence(remoteClient.AgentId, out presence))
- {
- byte[] data = null;
-
- if (invType == (sbyte)InventoryType.Landmark && presence != null)
- {
- Vector3 pos = presence.AbsolutePosition;
- string strdata = String.Format(
- "Landmark version 2\nregion_id {0}\nlocal_pos {1} {2} {3}\nregion_handle {4}\n",
- presence.Scene.RegionInfo.RegionID,
- pos.X, pos.Y, pos.Z,
- presence.RegionHandle);
- data = Encoding.ASCII.GetBytes(strdata);
- }
-
- AssetBase asset = CreateAsset(name, description, assetType, data, remoteClient.AgentId);
- AssetService.Store(asset);
-
- CreateNewInventoryItem(remoteClient, remoteClient.AgentId.ToString(), string.Empty, folderID, asset.Name, 0, callbackID, asset, invType, nextOwnerMask, creationDate);
- }
- else
- {
- m_log.ErrorFormat(
- "ScenePresence for agent uuid {0} unexpectedly not found in CreateNewInventoryItem",
- remoteClient.AgentId);
- }
- }
- else
- {
- IAgentAssetTransactions agentTransactions = this.RequestModuleInterface();
- if (agentTransactions != null)
- {
- agentTransactions.HandleItemCreationFromTransaction(
- remoteClient, transactionID, folderID, callbackID, description,
- name, invType, assetType, wearableType, nextOwnerMask);
- }
- }
- }
-
- ///
/// Link an inventory item to an existing item.
///
///
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index 1d562fd..b179683 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -2726,7 +2726,7 @@ namespace OpenSim.Region.Framework.Scenes
public virtual void SubscribeToClientInventoryEvents(IClientAPI client)
{
- client.OnCreateNewInventoryItem += CreateNewInventoryItem;
+
client.OnLinkInventoryItem += HandleLinkInventoryItem;
client.OnCreateNewInventoryFolder += HandleCreateInventoryFolder;
client.OnUpdateInventoryFolder += HandleUpdateInventoryFolder;
@@ -2853,7 +2853,7 @@ namespace OpenSim.Region.Framework.Scenes
public virtual void UnSubscribeToClientInventoryEvents(IClientAPI client)
{
- client.OnCreateNewInventoryItem -= CreateNewInventoryItem;
+
client.OnCreateNewInventoryFolder -= HandleCreateInventoryFolder;
client.OnUpdateInventoryFolder -= HandleUpdateInventoryFolder;
client.OnMoveInventoryFolder -= HandleMoveInventoryFolder; // 2; //!!
--
cgit v1.1