Redirected all calls to CachedUserProfile methods to the inventory service. Redirection of the RootFolder property is still todo. This compiles but probably inventory will be inconsistent.
parent
41ad610f3e
commit
7aa54593e0
|
@ -354,7 +354,16 @@ namespace OpenSim.Framework
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
protected int m_creationDate = (int)(DateTime.UtcNow - new DateTime(1970, 1, 1)).TotalSeconds;
|
protected int m_creationDate = (int)(DateTime.UtcNow - new DateTime(1970, 1, 1)).TotalSeconds;
|
||||||
|
|
||||||
|
public InventoryItemBase()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public InventoryItemBase(UUID id)
|
||||||
|
{
|
||||||
|
ID = id;
|
||||||
|
}
|
||||||
|
|
||||||
public object Clone()
|
public object Clone()
|
||||||
{
|
{
|
||||||
return MemberwiseClone();
|
return MemberwiseClone();
|
||||||
|
|
|
@ -192,40 +192,29 @@ namespace OpenSim.Region.CoreModules.Agent.AssetTransaction
|
||||||
{
|
{
|
||||||
if (XferUploaders.ContainsKey(transactionID))
|
if (XferUploaders.ContainsKey(transactionID))
|
||||||
{
|
{
|
||||||
CachedUserInfo userInfo = Manager.MyScene.CommsManager.UserProfileCacheService.GetUserDetails(
|
UUID assetID = UUID.Combine(transactionID, remoteClient.SecureSessionId);
|
||||||
remoteClient.AgentId);
|
|
||||||
|
|
||||||
if (userInfo != null)
|
AssetBase asset = Manager.MyScene.AssetService.Get(assetID.ToString());
|
||||||
|
|
||||||
|
if (asset == null)
|
||||||
{
|
{
|
||||||
UUID assetID = UUID.Combine(transactionID, remoteClient.SecureSessionId);
|
asset = GetTransactionAsset(transactionID);
|
||||||
|
|
||||||
AssetBase asset = Manager.MyScene.AssetService.Get(assetID.ToString());
|
|
||||||
|
|
||||||
if (asset == null)
|
|
||||||
{
|
|
||||||
asset = GetTransactionAsset(transactionID);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (asset != null && asset.FullID == assetID)
|
|
||||||
{
|
|
||||||
// Assets never get updated, new ones get created
|
|
||||||
asset.FullID = UUID.Random();
|
|
||||||
asset.Name = item.Name;
|
|
||||||
asset.Description = item.Description;
|
|
||||||
asset.Type = (sbyte)item.AssetType;
|
|
||||||
item.AssetID = asset.FullID;
|
|
||||||
|
|
||||||
Manager.MyScene.AssetService.Store(asset);
|
|
||||||
}
|
|
||||||
|
|
||||||
userInfo.UpdateItem(item);
|
|
||||||
}
|
}
|
||||||
else
|
|
||||||
|
if (asset != null && asset.FullID == assetID)
|
||||||
{
|
{
|
||||||
m_log.ErrorFormat(
|
// Assets never get updated, new ones get created
|
||||||
"[ASSET TRANSACTIONS]: Could not find user {0} for inventory item update",
|
asset.FullID = UUID.Random();
|
||||||
remoteClient.AgentId);
|
asset.Name = item.Name;
|
||||||
|
asset.Description = item.Description;
|
||||||
|
asset.Type = (sbyte)item.AssetType;
|
||||||
|
item.AssetID = asset.FullID;
|
||||||
|
|
||||||
|
Manager.MyScene.AssetService.Store(asset);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
IInventoryService invService = Manager.MyScene.InventoryService;
|
||||||
|
invService.UpdateItem(item);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -32,6 +32,7 @@ using log4net;
|
||||||
using OpenMetaverse;
|
using OpenMetaverse;
|
||||||
using OpenSim.Framework;
|
using OpenSim.Framework;
|
||||||
using OpenSim.Framework.Communications.Cache;
|
using OpenSim.Framework.Communications.Cache;
|
||||||
|
using OpenSim.Services.Interfaces;
|
||||||
|
|
||||||
namespace OpenSim.Region.CoreModules.Agent.AssetTransaction
|
namespace OpenSim.Region.CoreModules.Agent.AssetTransaction
|
||||||
{
|
{
|
||||||
|
@ -214,39 +215,31 @@ namespace OpenSim.Region.CoreModules.Agent.AssetTransaction
|
||||||
private void DoCreateItem(uint callbackID)
|
private void DoCreateItem(uint callbackID)
|
||||||
{
|
{
|
||||||
m_userTransactions.Manager.MyScene.AssetService.Store(m_asset);
|
m_userTransactions.Manager.MyScene.AssetService.Store(m_asset);
|
||||||
CachedUserInfo userInfo =
|
|
||||||
m_userTransactions.Manager.MyScene.CommsManager.UserProfileCacheService.GetUserDetails(
|
|
||||||
ourClient.AgentId);
|
|
||||||
|
|
||||||
if (userInfo != null)
|
IInventoryService invService = m_userTransactions.Manager.MyScene.InventoryService;
|
||||||
{
|
|
||||||
InventoryItemBase item = new InventoryItemBase();
|
|
||||||
item.Owner = ourClient.AgentId;
|
|
||||||
item.CreatorId = ourClient.AgentId.ToString();
|
|
||||||
item.ID = UUID.Random();
|
|
||||||
item.AssetID = m_asset.FullID;
|
|
||||||
item.Description = m_description;
|
|
||||||
item.Name = m_name;
|
|
||||||
item.AssetType = type;
|
|
||||||
item.InvType = invType;
|
|
||||||
item.Folder = InventFolder;
|
|
||||||
item.BasePermissions = 0x7fffffff;
|
|
||||||
item.CurrentPermissions = 0x7fffffff;
|
|
||||||
item.GroupPermissions=0;
|
|
||||||
item.EveryOnePermissions=0;
|
|
||||||
item.NextPermissions = nextPerm;
|
|
||||||
item.Flags = (uint) wearableType;
|
|
||||||
item.CreationDate = Util.UnixTimeSinceEpoch();
|
|
||||||
|
|
||||||
userInfo.AddItem(item);
|
InventoryItemBase item = new InventoryItemBase();
|
||||||
|
item.Owner = ourClient.AgentId;
|
||||||
|
item.CreatorId = ourClient.AgentId.ToString();
|
||||||
|
item.ID = UUID.Random();
|
||||||
|
item.AssetID = m_asset.FullID;
|
||||||
|
item.Description = m_description;
|
||||||
|
item.Name = m_name;
|
||||||
|
item.AssetType = type;
|
||||||
|
item.InvType = invType;
|
||||||
|
item.Folder = InventFolder;
|
||||||
|
item.BasePermissions = 0x7fffffff;
|
||||||
|
item.CurrentPermissions = 0x7fffffff;
|
||||||
|
item.GroupPermissions=0;
|
||||||
|
item.EveryOnePermissions=0;
|
||||||
|
item.NextPermissions = nextPerm;
|
||||||
|
item.Flags = (uint) wearableType;
|
||||||
|
item.CreationDate = Util.UnixTimeSinceEpoch();
|
||||||
|
|
||||||
|
if (invService.AddItem(item))
|
||||||
ourClient.SendInventoryItemCreateUpdate(item, callbackID);
|
ourClient.SendInventoryItemCreateUpdate(item, callbackID);
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
ourClient.SendAlertMessage("Unable to create inventory item");
|
||||||
m_log.ErrorFormat(
|
|
||||||
"[ASSET TRANSACTIONS]: Could not find user {0} for inventory item creation",
|
|
||||||
ourClient.AgentId);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
|
@ -39,6 +39,7 @@ using OpenSim.Framework.Communications;
|
||||||
using OpenSim.Framework.Communications.Cache;
|
using OpenSim.Framework.Communications.Cache;
|
||||||
using OpenSim.Region.Framework.Interfaces;
|
using OpenSim.Region.Framework.Interfaces;
|
||||||
using OpenSim.Region.Framework.Scenes;
|
using OpenSim.Region.Framework.Scenes;
|
||||||
|
using OpenSim.Services.Interfaces;
|
||||||
|
|
||||||
namespace OpenSim.Region.CoreModules.Avatar.Friends
|
namespace OpenSim.Region.CoreModules.Avatar.Friends
|
||||||
{
|
{
|
||||||
|
@ -654,8 +655,10 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
|
||||||
initiator.ControllingClient.SendAgentOnline(new UUID[] { fromAgentID });
|
initiator.ControllingClient.SendAgentOnline(new UUID[] { fromAgentID });
|
||||||
|
|
||||||
// find the folder for the friend...
|
// find the folder for the friend...
|
||||||
InventoryFolderImpl folder =
|
//InventoryFolderImpl folder =
|
||||||
initiator.Scene.CommsManager.UserProfileCacheService.GetUserDetails(toAgentID).FindFolderForType((int)InventoryType.CallingCard);
|
// initiator.Scene.CommsManager.UserProfileCacheService.GetUserDetails(toAgentID).FindFolderForType((int)InventoryType.CallingCard);
|
||||||
|
IInventoryService invService = initiator.Scene.InventoryService;
|
||||||
|
InventoryFolderBase folder = invService.GetFolderForType(toAgentID, AssetType.CallingCard);
|
||||||
if (folder != null)
|
if (folder != null)
|
||||||
{
|
{
|
||||||
// ... and add the calling card
|
// ... and add the calling card
|
||||||
|
|
|
@ -33,6 +33,7 @@ using OpenSim.Framework;
|
||||||
using OpenSim.Framework.Communications.Cache;
|
using OpenSim.Framework.Communications.Cache;
|
||||||
using OpenSim.Region.Framework.Interfaces;
|
using OpenSim.Region.Framework.Interfaces;
|
||||||
using OpenSim.Region.Framework.Scenes;
|
using OpenSim.Region.Framework.Scenes;
|
||||||
|
using OpenSim.Services.Interfaces;
|
||||||
|
|
||||||
namespace OpenSim.Region.CoreModules.Avatar.Gestures
|
namespace OpenSim.Region.CoreModules.Avatar.Gestures
|
||||||
{
|
{
|
||||||
|
@ -62,42 +63,32 @@ namespace OpenSim.Region.CoreModules.Avatar.Gestures
|
||||||
|
|
||||||
public virtual void ActivateGesture(IClientAPI client, UUID assetId, UUID gestureId)
|
public virtual void ActivateGesture(IClientAPI client, UUID assetId, UUID gestureId)
|
||||||
{
|
{
|
||||||
CachedUserInfo userInfo = m_scene.CommsManager.UserProfileCacheService.GetUserDetails(client.AgentId);
|
IInventoryService invService = m_scene.InventoryService;
|
||||||
|
|
||||||
if (userInfo != null)
|
InventoryItemBase item = invService.QueryItem(new InventoryItemBase(gestureId));
|
||||||
|
if (item != null)
|
||||||
{
|
{
|
||||||
InventoryItemBase item = userInfo.RootFolder.FindItem(gestureId);
|
item.Flags = 1;
|
||||||
if (item != null)
|
invService.UpdateItem(item);
|
||||||
{
|
|
||||||
item.Flags = 1;
|
|
||||||
userInfo.UpdateItem(item);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
m_log.ErrorFormat(
|
|
||||||
"[GESTURES]: Unable to find gesture to activate {0} for {1}", gestureId, client.Name);
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
m_log.ErrorFormat("[GESTURES]: Unable to find user {0}", client.Name);
|
m_log.WarnFormat(
|
||||||
|
"[GESTURES]: Unable to find gesture {0} to activate for {1}", gestureId, client.Name);
|
||||||
}
|
}
|
||||||
|
|
||||||
public virtual void DeactivateGesture(IClientAPI client, UUID gestureId)
|
public virtual void DeactivateGesture(IClientAPI client, UUID gestureId)
|
||||||
{
|
{
|
||||||
CachedUserInfo userInfo = m_scene.CommsManager.UserProfileCacheService.GetUserDetails(client.AgentId);
|
IInventoryService invService = m_scene.InventoryService;
|
||||||
|
|
||||||
if (userInfo != null)
|
InventoryItemBase item = invService.QueryItem(new InventoryItemBase(gestureId));
|
||||||
|
if (item != null)
|
||||||
{
|
{
|
||||||
InventoryItemBase item = userInfo.RootFolder.FindItem(gestureId);
|
item.Flags = 0;
|
||||||
if (item != null)
|
invService.UpdateItem(item);
|
||||||
{
|
|
||||||
item.Flags = 0;
|
|
||||||
userInfo.UpdateItem(item);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
m_log.ErrorFormat(
|
|
||||||
"[GESTURES]: Unable to find gesture to deactivate {0} for {1}", gestureId, client.Name);
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
m_log.ErrorFormat("[GESTURES]: Unable to find user {0}", client.Name);
|
m_log.ErrorFormat(
|
||||||
|
"[GESTURES]: Unable to find gesture to deactivate {0} for {1}", gestureId, client.Name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -35,6 +35,7 @@ using OpenSim.Framework;
|
||||||
using OpenSim.Framework.Communications.Cache;
|
using OpenSim.Framework.Communications.Cache;
|
||||||
using OpenSim.Region.Framework.Interfaces;
|
using OpenSim.Region.Framework.Interfaces;
|
||||||
using OpenSim.Region.Framework.Scenes;
|
using OpenSim.Region.Framework.Scenes;
|
||||||
|
using OpenSim.Services.Interfaces;
|
||||||
|
|
||||||
namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer
|
namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer
|
||||||
{
|
{
|
||||||
|
@ -154,7 +155,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer
|
||||||
"into agent {1}'s inventory",
|
"into agent {1}'s inventory",
|
||||||
folderID, new UUID(im.toAgentID));
|
folderID, new UUID(im.toAgentID));
|
||||||
|
|
||||||
InventoryFolderImpl folderCopy
|
InventoryFolderBase folderCopy
|
||||||
= scene.GiveInventoryFolder(new UUID(im.toAgentID), client.AgentId, folderID, UUID.Zero);
|
= scene.GiveInventoryFolder(new UUID(im.toAgentID), client.AgentId, folderID, UUID.Zero);
|
||||||
|
|
||||||
if (folderCopy == null)
|
if (folderCopy == null)
|
||||||
|
@ -247,53 +248,52 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer
|
||||||
// It will have been pushed to the client, too
|
// It will have been pushed to the client, too
|
||||||
//
|
//
|
||||||
|
|
||||||
CachedUserInfo userInfo =
|
//CachedUserInfo userInfo =
|
||||||
scene.CommsManager.UserProfileCacheService.
|
// scene.CommsManager.UserProfileCacheService.
|
||||||
GetUserDetails(client.AgentId);
|
// GetUserDetails(client.AgentId);
|
||||||
|
IInventoryService invService = scene.InventoryService;
|
||||||
|
|
||||||
if (userInfo != null)
|
InventoryFolderBase trashFolder =
|
||||||
|
invService.GetFolderForType(client.AgentId, AssetType.TrashFolder);
|
||||||
|
|
||||||
|
UUID inventoryEntityID = new UUID(im.imSessionID); // The inventory item/folder, back from it's trip
|
||||||
|
|
||||||
|
InventoryItemBase item = invService.QueryItem(new InventoryItemBase(inventoryEntityID));
|
||||||
|
InventoryFolderBase folder = null;
|
||||||
|
|
||||||
|
if (item != null && trashFolder != null)
|
||||||
{
|
{
|
||||||
InventoryFolderImpl trashFolder =
|
item.Folder = trashFolder.ID;
|
||||||
userInfo.FindFolderForType((int)AssetType.TrashFolder);
|
|
||||||
|
|
||||||
UUID inventoryEntityID = new UUID(im.imSessionID); // The inventory item/folder, back from it's trip
|
|
||||||
|
|
||||||
InventoryItemBase item = userInfo.RootFolder.FindItem(inventoryEntityID);
|
|
||||||
InventoryFolderBase folder = null;
|
|
||||||
|
|
||||||
if (item != null && trashFolder != null)
|
|
||||||
{
|
|
||||||
item.Folder = trashFolder.ID;
|
|
||||||
|
|
||||||
userInfo.DeleteItem(inventoryEntityID);
|
// Diva comment: can't we just update this item???
|
||||||
|
invService.DeleteItem(item);
|
||||||
scene.AddInventoryItem(client, item);
|
scene.AddInventoryItem(client, item);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
folder = userInfo.RootFolder.FindFolder(inventoryEntityID);
|
folder = invService.QueryFolder(new InventoryFolderBase(inventoryEntityID));
|
||||||
|
|
||||||
if (folder != null & trashFolder != null)
|
|
||||||
{
|
|
||||||
userInfo.MoveFolder(inventoryEntityID, trashFolder.ID);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if ((null == item && null == folder) | null == trashFolder)
|
if (folder != null & trashFolder != null)
|
||||||
{
|
{
|
||||||
string reason = String.Empty;
|
folder.ParentID = trashFolder.ID;
|
||||||
|
invService.MoveFolder(folder);
|
||||||
if (trashFolder == null)
|
|
||||||
reason += " Trash folder not found.";
|
|
||||||
if (item == null)
|
|
||||||
reason += " Item not found.";
|
|
||||||
if (folder == null)
|
|
||||||
reason += " Folder not found.";
|
|
||||||
|
|
||||||
client.SendAgentAlertMessage("Unable to delete "+
|
|
||||||
"received inventory" + reason, false);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ((null == item && null == folder) | null == trashFolder)
|
||||||
|
{
|
||||||
|
string reason = String.Empty;
|
||||||
|
|
||||||
|
if (trashFolder == null)
|
||||||
|
reason += " Trash folder not found.";
|
||||||
|
if (item == null)
|
||||||
|
reason += " Item not found.";
|
||||||
|
if (folder == null)
|
||||||
|
reason += " Folder not found.";
|
||||||
|
|
||||||
|
client.SendAgentAlertMessage("Unable to delete "+
|
||||||
|
"received inventory" + reason, false);
|
||||||
|
}
|
||||||
|
|
||||||
ScenePresence user = scene.GetScenePresence(new UUID(im.toAgentID));
|
ScenePresence user = scene.GetScenePresence(new UUID(im.toAgentID));
|
||||||
|
|
||||||
|
@ -405,17 +405,18 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
CachedUserInfo userInfo =
|
//CachedUserInfo userInfo =
|
||||||
scene.CommsManager.UserProfileCacheService.
|
// scene.CommsManager.UserProfileCacheService.
|
||||||
GetUserDetails(user.ControllingClient.AgentId);
|
// GetUserDetails(user.ControllingClient.AgentId);
|
||||||
|
|
||||||
if (userInfo == null)
|
//if (userInfo == null)
|
||||||
{
|
//{
|
||||||
m_log.Debug("[INVENTORY TRANSFER] Can't find user info of recipient");
|
// m_log.Debug("[INVENTORY TRANSFER] Can't find user info of recipient");
|
||||||
return;
|
// return;
|
||||||
}
|
//}
|
||||||
|
|
||||||
AssetType assetType = (AssetType)msg.binaryBucket[0];
|
AssetType assetType = (AssetType)msg.binaryBucket[0];
|
||||||
|
IInventoryService invService = scene.InventoryService;
|
||||||
|
|
||||||
if (AssetType.Folder == assetType)
|
if (AssetType.Folder == assetType)
|
||||||
{
|
{
|
||||||
|
@ -425,31 +426,23 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer
|
||||||
folder.ID = folderID;
|
folder.ID = folderID;
|
||||||
folder.Owner = user.ControllingClient.AgentId;
|
folder.Owner = user.ControllingClient.AgentId;
|
||||||
|
|
||||||
// Fetch from database
|
// Fetch from service
|
||||||
//
|
//
|
||||||
if (!userInfo.QueryFolder(folder))
|
folder = invService.QueryFolder(folder);
|
||||||
|
if (folder == null)
|
||||||
{
|
{
|
||||||
m_log.Debug("[INVENTORY TRANSFER] Can't find folder to give");
|
m_log.Debug("[INVENTORY TRANSFER] Can't find folder to give");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get folder info
|
user.ControllingClient.SendBulkUpdateInventory(folder);
|
||||||
//
|
|
||||||
InventoryFolderImpl folderInfo = userInfo.RootFolder.FindFolder(folder.ID);
|
|
||||||
if (folderInfo == null)
|
|
||||||
{
|
|
||||||
m_log.Debug("[INVENTORY TRANSFER] Can't retrieve folder to give");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
user.ControllingClient.SendBulkUpdateInventory(folderInfo);
|
//// This unelegant, slow kludge is to reload the folders and
|
||||||
|
//// items. Since a folder give can transfer subfolders and
|
||||||
// This unelegant, slow kludge is to reload the folders and
|
//// items, this is the easiest way to pull that stuff in
|
||||||
// items. Since a folder give can transfer subfolders and
|
////
|
||||||
// items, this is the easiest way to pull that stuff in
|
//userInfo.DropInventory();
|
||||||
//
|
//userInfo.FetchInventory();
|
||||||
userInfo.DropInventory();
|
|
||||||
userInfo.FetchInventory();
|
|
||||||
|
|
||||||
// Deliver message
|
// Deliver message
|
||||||
//
|
//
|
||||||
|
@ -463,20 +456,12 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer
|
||||||
item.ID = itemID;
|
item.ID = itemID;
|
||||||
item.Owner = user.ControllingClient.AgentId;
|
item.Owner = user.ControllingClient.AgentId;
|
||||||
|
|
||||||
// Fetch from database
|
// Fetch from service
|
||||||
//
|
//
|
||||||
if (!userInfo.QueryItem(item))
|
item = invService.QueryItem(item);
|
||||||
{
|
|
||||||
m_log.Debug("[INVENTORY TRANSFER] Can't find item to give");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Get item info
|
|
||||||
//
|
|
||||||
item = userInfo.RootFolder.FindItem(item.ID);
|
|
||||||
if (item == null)
|
if (item == null)
|
||||||
{
|
{
|
||||||
m_log.Debug("[INVENTORY TRANSFER] Can't retrieve item to give");
|
m_log.Debug("[INVENTORY TRANSFER] Can't find item to give");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -64,6 +64,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
|
||||||
Dictionary<AssetType, InventoryFolderBase> folders = m_Connector.GetSystemFolders(presence.UUID);
|
Dictionary<AssetType, InventoryFolderBase> folders = m_Connector.GetSystemFolders(presence.UUID);
|
||||||
m_log.DebugFormat("[INVENTORY CACHE]: OnMakeRootAgent in {0}, fetched system folders for {1} {2}: count {3}",
|
m_log.DebugFormat("[INVENTORY CACHE]: OnMakeRootAgent in {0}, fetched system folders for {1} {2}: count {3}",
|
||||||
presence.Scene.RegionInfo.RegionName, presence.Firstname, presence.Lastname, folders.Count);
|
presence.Scene.RegionInfo.RegionName, presence.Firstname, presence.Lastname, folders.Count);
|
||||||
|
|
||||||
if (folders.Count > 0)
|
if (folders.Count > 0)
|
||||||
lock (m_InventoryCache)
|
lock (m_InventoryCache)
|
||||||
m_InventoryCache.Add(presence.UUID, folders);
|
m_InventoryCache.Add(presence.UUID, folders);
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -435,17 +435,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
CachedUserInfo userProfile = CommsManager.UserProfileCacheService.GetUserDetails(remoteClient.AgentId);
|
SendInventoryUpdate(remoteClient, new InventoryFolderBase(folderID), fetchFolders, fetchItems);
|
||||||
|
|
||||||
if (null == userProfile)
|
|
||||||
{
|
|
||||||
m_log.ErrorFormat(
|
|
||||||
"[AGENT INVENTORY]: Could not find user profile for {0} {1}",
|
|
||||||
remoteClient.Name, remoteClient.AgentId);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
userProfile.SendInventoryDecendents(remoteClient, folderID, fetchFolders, fetchItems);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -543,19 +533,10 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
public void HandleCreateInventoryFolder(IClientAPI remoteClient, UUID folderID, ushort folderType,
|
public void HandleCreateInventoryFolder(IClientAPI remoteClient, UUID folderID, ushort folderType,
|
||||||
string folderName, UUID parentID)
|
string folderName, UUID parentID)
|
||||||
{
|
{
|
||||||
CachedUserInfo userProfile = CommsManager.UserProfileCacheService.GetUserDetails(remoteClient.AgentId);
|
InventoryFolderBase folder = new InventoryFolderBase(folderID, folderName, remoteClient.AgentId, (short)folderType, parentID, 1);
|
||||||
|
if (!InventoryService.AddFolder(folder))
|
||||||
if (null == userProfile)
|
|
||||||
{
|
{
|
||||||
m_log.ErrorFormat(
|
m_log.WarnFormat(
|
||||||
"[AGENT INVENTORY]: Could not find user profile for {0} {1}",
|
|
||||||
remoteClient.Name, remoteClient.AgentId);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!userProfile.CreateFolder(folderName, folderID, folderType, parentID))
|
|
||||||
{
|
|
||||||
m_log.ErrorFormat(
|
|
||||||
"[AGENT INVENTORY]: Failed to move create folder for user {0} {1}",
|
"[AGENT INVENTORY]: Failed to move create folder for user {0} {1}",
|
||||||
remoteClient.Name, remoteClient.AgentId);
|
remoteClient.Name, remoteClient.AgentId);
|
||||||
}
|
}
|
||||||
|
|
|
@ -3510,59 +3510,53 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
case 2: // Sell a copy
|
case 2: // Sell a copy
|
||||||
string sceneObjectXml = SceneObjectSerializer.ToOriginalXmlFormat(group);
|
string sceneObjectXml = SceneObjectSerializer.ToOriginalXmlFormat(group);
|
||||||
|
|
||||||
CachedUserInfo userInfo =
|
uint perms=group.GetEffectivePermissions();
|
||||||
CommsManager.UserProfileCacheService.GetUserDetails(remoteClient.AgentId);
|
|
||||||
|
|
||||||
if (userInfo != null)
|
if ((perms & (uint)PermissionMask.Transfer) == 0)
|
||||||
{
|
{
|
||||||
uint perms=group.GetEffectivePermissions();
|
m_dialogModule.SendAlertToUser(remoteClient, "This item doesn't appear to be for sale");
|
||||||
|
return false;
|
||||||
if ((perms & (uint)PermissionMask.Transfer) == 0)
|
|
||||||
{
|
|
||||||
m_dialogModule.SendAlertToUser(remoteClient, "This item doesn't appear to be for sale");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
AssetBase asset = CreateAsset(
|
|
||||||
group.GetPartName(localID),
|
|
||||||
group.GetPartDescription(localID),
|
|
||||||
(sbyte)AssetType.Object,
|
|
||||||
Utils.StringToBytes(sceneObjectXml));
|
|
||||||
AssetService.Store(asset);
|
|
||||||
|
|
||||||
InventoryItemBase item = new InventoryItemBase();
|
|
||||||
item.CreatorId = part.CreatorID.ToString();
|
|
||||||
|
|
||||||
item.ID = UUID.Random();
|
|
||||||
item.Owner = remoteClient.AgentId;
|
|
||||||
item.AssetID = asset.FullID;
|
|
||||||
item.Description = asset.Description;
|
|
||||||
item.Name = asset.Name;
|
|
||||||
item.AssetType = asset.Type;
|
|
||||||
item.InvType = (int)InventoryType.Object;
|
|
||||||
item.Folder = categoryID;
|
|
||||||
|
|
||||||
uint nextPerms=(perms & 7) << 13;
|
|
||||||
if ((nextPerms & (uint)PermissionMask.Copy) == 0)
|
|
||||||
perms &= ~(uint)PermissionMask.Copy;
|
|
||||||
if ((nextPerms & (uint)PermissionMask.Transfer) == 0)
|
|
||||||
perms &= ~(uint)PermissionMask.Transfer;
|
|
||||||
if ((nextPerms & (uint)PermissionMask.Modify) == 0)
|
|
||||||
perms &= ~(uint)PermissionMask.Modify;
|
|
||||||
|
|
||||||
item.BasePermissions = perms & part.NextOwnerMask;
|
|
||||||
item.CurrentPermissions = perms & part.NextOwnerMask;
|
|
||||||
item.NextPermissions = part.NextOwnerMask;
|
|
||||||
item.EveryOnePermissions = part.EveryoneMask &
|
|
||||||
part.NextOwnerMask;
|
|
||||||
item.GroupPermissions = part.GroupMask &
|
|
||||||
part.NextOwnerMask;
|
|
||||||
item.CurrentPermissions |= 8; // Slam!
|
|
||||||
item.CreationDate = Util.UnixTimeSinceEpoch();
|
|
||||||
|
|
||||||
userInfo.AddItem(item);
|
|
||||||
remoteClient.SendInventoryItemCreateUpdate(item, 0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
AssetBase asset = CreateAsset(
|
||||||
|
group.GetPartName(localID),
|
||||||
|
group.GetPartDescription(localID),
|
||||||
|
(sbyte)AssetType.Object,
|
||||||
|
Utils.StringToBytes(sceneObjectXml));
|
||||||
|
AssetService.Store(asset);
|
||||||
|
|
||||||
|
InventoryItemBase item = new InventoryItemBase();
|
||||||
|
item.CreatorId = part.CreatorID.ToString();
|
||||||
|
|
||||||
|
item.ID = UUID.Random();
|
||||||
|
item.Owner = remoteClient.AgentId;
|
||||||
|
item.AssetID = asset.FullID;
|
||||||
|
item.Description = asset.Description;
|
||||||
|
item.Name = asset.Name;
|
||||||
|
item.AssetType = asset.Type;
|
||||||
|
item.InvType = (int)InventoryType.Object;
|
||||||
|
item.Folder = categoryID;
|
||||||
|
|
||||||
|
uint nextPerms=(perms & 7) << 13;
|
||||||
|
if ((nextPerms & (uint)PermissionMask.Copy) == 0)
|
||||||
|
perms &= ~(uint)PermissionMask.Copy;
|
||||||
|
if ((nextPerms & (uint)PermissionMask.Transfer) == 0)
|
||||||
|
perms &= ~(uint)PermissionMask.Transfer;
|
||||||
|
if ((nextPerms & (uint)PermissionMask.Modify) == 0)
|
||||||
|
perms &= ~(uint)PermissionMask.Modify;
|
||||||
|
|
||||||
|
item.BasePermissions = perms & part.NextOwnerMask;
|
||||||
|
item.CurrentPermissions = perms & part.NextOwnerMask;
|
||||||
|
item.NextPermissions = part.NextOwnerMask;
|
||||||
|
item.EveryOnePermissions = part.EveryoneMask &
|
||||||
|
part.NextOwnerMask;
|
||||||
|
item.GroupPermissions = part.GroupMask &
|
||||||
|
part.NextOwnerMask;
|
||||||
|
item.CurrentPermissions |= 8; // Slam!
|
||||||
|
item.CreationDate = Util.UnixTimeSinceEpoch();
|
||||||
|
|
||||||
|
if (InventoryService.AddItem(item))
|
||||||
|
remoteClient.SendInventoryItemCreateUpdate(item, 0);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
m_dialogModule.SendAlertToUser(remoteClient, "Cannot buy now. Your inventory is unavailable");
|
m_dialogModule.SendAlertToUser(remoteClient, "Cannot buy now. Your inventory is unavailable");
|
||||||
|
@ -3577,8 +3571,8 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
|
|
||||||
foreach (UUID invID in invList)
|
foreach (UUID invID in invList)
|
||||||
{
|
{
|
||||||
TaskInventoryItem item = part.Inventory.GetInventoryItem(invID);
|
TaskInventoryItem item1 = part.Inventory.GetInventoryItem(invID);
|
||||||
if ((item.CurrentPermissions &
|
if ((item1.CurrentPermissions &
|
||||||
(uint)PermissionMask.Transfer) == 0)
|
(uint)PermissionMask.Transfer) == 0)
|
||||||
{
|
{
|
||||||
okToSell = false;
|
okToSell = false;
|
||||||
|
|
|
@ -542,7 +542,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
group.DetachToInventoryPrep();
|
group.DetachToInventoryPrep();
|
||||||
m_log.Debug("[DETACH]: Saving attachpoint: " +
|
m_log.Debug("[DETACH]: Saving attachpoint: " +
|
||||||
((uint)group.GetAttachmentPoint()).ToString());
|
((uint)group.GetAttachmentPoint()).ToString());
|
||||||
m_parentScene.updateKnownAsset(remoteClient, group,
|
m_parentScene.UpdateKnownItem(remoteClient, group,
|
||||||
group.GetFromAssetID(), group.OwnerID);
|
group.GetFromAssetID(), group.OwnerID);
|
||||||
m_parentScene.DeleteSceneObject(group, false);
|
m_parentScene.DeleteSceneObject(group, false);
|
||||||
return;
|
return;
|
||||||
|
@ -1307,7 +1307,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
group.UpdateGroupPosition(pos);
|
group.UpdateGroupPosition(pos);
|
||||||
group.RootPart.IsAttachment = false;
|
group.RootPart.IsAttachment = false;
|
||||||
group.AbsolutePosition = group.RootPart.AttachedPos;
|
group.AbsolutePosition = group.RootPart.AttachedPos;
|
||||||
m_parentScene.updateKnownAsset(remoteClient, group, group.GetFromAssetID(), group.OwnerID);
|
m_parentScene.UpdateKnownItem(remoteClient, group, group.GetFromAssetID(), group.OwnerID);
|
||||||
group.SetAttachmentPoint(attachmentPoint);
|
group.SetAttachmentPoint(attachmentPoint);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue