mirror of
https://github.com/opensim/opensim.git
synced 2026-08-07 01:35:46 +08:00
More inventory work, should be able to now create new inventory folders and them be stored in database (so are there on next login). Again only works in standalone mode with Account/password authentication turned on. [Creating new inventory items should be working very soon.]
The test is to make sure that it hasn't broke grid mode at all.
This commit is contained in:
@@ -41,8 +41,8 @@ namespace OpenSim.Framework.Communications.Caches
|
||||
public class CachedUserInfo
|
||||
{
|
||||
// Fields
|
||||
public InventoryFolder RootFolder;
|
||||
public UserProfileData UserProfile;
|
||||
public InventoryFolder RootFolder = null;
|
||||
public UserProfileData UserProfile = null;
|
||||
|
||||
// Methods
|
||||
public void FolderReceive(LLUUID userID, InventoryFolder folderInfo)
|
||||
|
||||
@@ -98,17 +98,24 @@ namespace OpenSim.Framework.Communications.Caches
|
||||
{
|
||||
if (this.UserProfiles.ContainsKey(remoteClient.AgentId))
|
||||
{
|
||||
CachedUserInfo info = this.UserProfiles[remoteClient.AgentId];
|
||||
if (info.RootFolder.folderID == parentID)
|
||||
if (this.UserProfiles[remoteClient.AgentId].RootFolder != null)
|
||||
{
|
||||
info.RootFolder.CreateNewSubFolder(folderID, folderName, folderType);
|
||||
}
|
||||
else
|
||||
{
|
||||
InventoryFolder folder = info.RootFolder.HasSubFolder(parentID);
|
||||
if (folder != null)
|
||||
CachedUserInfo info = this.UserProfiles[remoteClient.AgentId];
|
||||
if (info.RootFolder.folderID == parentID)
|
||||
{
|
||||
folder.CreateNewSubFolder(folderID, folderName, folderType);
|
||||
InventoryFolder createdFolder = info.RootFolder.CreateNewSubFolder(folderID, folderName, folderType);
|
||||
if (createdFolder != null)
|
||||
{
|
||||
this.m_parent.InventoryServer.AddNewInventoryFolder(remoteClient.AgentId, createdFolder);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
InventoryFolder folder = info.RootFolder.HasSubFolder(parentID);
|
||||
if (folder != null)
|
||||
{
|
||||
folder.CreateNewSubFolder(folderID, folderName, folderType);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -127,20 +134,23 @@ namespace OpenSim.Framework.Communications.Caches
|
||||
}
|
||||
else if (this.UserProfiles.ContainsKey(remoteClient.AgentId))
|
||||
{
|
||||
CachedUserInfo info = this.UserProfiles[remoteClient.AgentId];
|
||||
if (info.RootFolder.folderID == folderID)
|
||||
if (this.UserProfiles[remoteClient.AgentId].RootFolder != null)
|
||||
{
|
||||
if (fetchItems)
|
||||
CachedUserInfo info = this.UserProfiles[remoteClient.AgentId];
|
||||
if (info.RootFolder.folderID == folderID)
|
||||
{
|
||||
remoteClient.SendInventoryFolderDetails(remoteClient.AgentId, folderID, info.RootFolder.RequestListOfItems());
|
||||
if (fetchItems)
|
||||
{
|
||||
remoteClient.SendInventoryFolderDetails(remoteClient.AgentId, folderID, info.RootFolder.RequestListOfItems());
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
InventoryFolder folder = info.RootFolder.HasSubFolder(folderID);
|
||||
if ((folder != null) && fetchItems)
|
||||
else
|
||||
{
|
||||
remoteClient.SendInventoryFolderDetails(remoteClient.AgentId, folderID, folder.RequestListOfItems());
|
||||
InventoryFolder folder = info.RootFolder.HasSubFolder(folderID);
|
||||
if ((folder != null) && fetchItems)
|
||||
{
|
||||
remoteClient.SendInventoryFolderDetails(remoteClient.AgentId, folderID, folder.RequestListOfItems());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -154,10 +164,13 @@ namespace OpenSim.Framework.Communications.Caches
|
||||
}
|
||||
else if (this.UserProfiles.ContainsKey(remoteClient.AgentId))
|
||||
{
|
||||
InventoryItemBase item = this.UserProfiles[remoteClient.AgentId].RootFolder.HasItem(itemID);
|
||||
if (item != null)
|
||||
if (this.UserProfiles[remoteClient.AgentId].RootFolder != null)
|
||||
{
|
||||
remoteClient.SendInventoryItemDetails(ownerID, item);
|
||||
InventoryItemBase item = this.UserProfiles[remoteClient.AgentId].RootFolder.HasItem(itemID);
|
||||
if (item != null)
|
||||
{
|
||||
remoteClient.SendInventoryItemDetails(ownerID, item);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -168,7 +181,7 @@ namespace OpenSim.Framework.Communications.Caches
|
||||
/// <param name="userID"></param>
|
||||
private void RequestInventoryForUser(LLUUID userID, CachedUserInfo userInfo)
|
||||
{
|
||||
//this.m_parent.InventoryServer.RequestInventoryForUser(userID, userInfo.FolderReceive, userInfo.ItemReceive);
|
||||
this.m_parent.InventoryServer.RequestInventoryForUser(userID, userInfo.FolderReceive, userInfo.ItemReceive);
|
||||
|
||||
//for now we manually create the root folder,
|
||||
// but should be requesting all inventory from inventory server.
|
||||
|
||||
@@ -14,5 +14,6 @@ namespace OpenSim.Framework.Communications
|
||||
public interface IInventoryServices
|
||||
{
|
||||
void RequestInventoryForUser(LLUUID userID, InventoryFolderInfo folderCallBack, InventoryItemInfo itemCallBack);
|
||||
void AddNewInventoryFolder(LLUUID userID, InventoryFolder folder);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user