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.afrisby
parent
a228b5984e
commit
ff08d4d016
|
@ -41,8 +41,8 @@ namespace OpenSim.Framework.Communications.Caches
|
||||||
public class CachedUserInfo
|
public class CachedUserInfo
|
||||||
{
|
{
|
||||||
// Fields
|
// Fields
|
||||||
public InventoryFolder RootFolder;
|
public InventoryFolder RootFolder = null;
|
||||||
public UserProfileData UserProfile;
|
public UserProfileData UserProfile = null;
|
||||||
|
|
||||||
// Methods
|
// Methods
|
||||||
public void FolderReceive(LLUUID userID, InventoryFolder folderInfo)
|
public void FolderReceive(LLUUID userID, InventoryFolder folderInfo)
|
||||||
|
|
|
@ -98,17 +98,24 @@ namespace OpenSim.Framework.Communications.Caches
|
||||||
{
|
{
|
||||||
if (this.UserProfiles.ContainsKey(remoteClient.AgentId))
|
if (this.UserProfiles.ContainsKey(remoteClient.AgentId))
|
||||||
{
|
{
|
||||||
CachedUserInfo info = this.UserProfiles[remoteClient.AgentId];
|
if (this.UserProfiles[remoteClient.AgentId].RootFolder != null)
|
||||||
if (info.RootFolder.folderID == parentID)
|
|
||||||
{
|
{
|
||||||
info.RootFolder.CreateNewSubFolder(folderID, folderName, folderType);
|
CachedUserInfo info = this.UserProfiles[remoteClient.AgentId];
|
||||||
}
|
if (info.RootFolder.folderID == parentID)
|
||||||
else
|
|
||||||
{
|
|
||||||
InventoryFolder folder = info.RootFolder.HasSubFolder(parentID);
|
|
||||||
if (folder != null)
|
|
||||||
{
|
{
|
||||||
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))
|
else if (this.UserProfiles.ContainsKey(remoteClient.AgentId))
|
||||||
{
|
{
|
||||||
CachedUserInfo info = this.UserProfiles[remoteClient.AgentId];
|
if (this.UserProfiles[remoteClient.AgentId].RootFolder != null)
|
||||||
if (info.RootFolder.folderID == folderID)
|
|
||||||
{
|
{
|
||||||
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
|
||||||
else
|
|
||||||
{
|
|
||||||
InventoryFolder folder = info.RootFolder.HasSubFolder(folderID);
|
|
||||||
if ((folder != null) && fetchItems)
|
|
||||||
{
|
{
|
||||||
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))
|
else if (this.UserProfiles.ContainsKey(remoteClient.AgentId))
|
||||||
{
|
{
|
||||||
InventoryItemBase item = this.UserProfiles[remoteClient.AgentId].RootFolder.HasItem(itemID);
|
if (this.UserProfiles[remoteClient.AgentId].RootFolder != null)
|
||||||
if (item != 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>
|
/// <param name="userID"></param>
|
||||||
private void RequestInventoryForUser(LLUUID userID, CachedUserInfo userInfo)
|
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,
|
//for now we manually create the root folder,
|
||||||
// but should be requesting all inventory from inventory server.
|
// but should be requesting all inventory from inventory server.
|
||||||
|
|
|
@ -14,5 +14,6 @@ namespace OpenSim.Framework.Communications
|
||||||
public interface IInventoryServices
|
public interface IInventoryServices
|
||||||
{
|
{
|
||||||
void RequestInventoryForUser(LLUUID userID, InventoryFolderInfo folderCallBack, InventoryItemInfo itemCallBack);
|
void RequestInventoryForUser(LLUUID userID, InventoryFolderInfo folderCallBack, InventoryItemInfo itemCallBack);
|
||||||
|
void AddNewInventoryFolder(LLUUID userID, InventoryFolder folder);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -47,5 +47,10 @@ namespace OpenSim.Region.Communications.Local
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void AddNewInventoryFolder(LLUUID userID, InventoryFolder folder)
|
||||||
|
{
|
||||||
|
this.AddFolder(folder);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,12 +8,17 @@ namespace OpenSim.Region.Communications.OGS1
|
||||||
{
|
{
|
||||||
public class CommunicationsOGS1 : CommunicationsManager
|
public class CommunicationsOGS1 : CommunicationsManager
|
||||||
{
|
{
|
||||||
|
public OGS1InventoryService InvenService;
|
||||||
|
|
||||||
public CommunicationsOGS1(NetworkServersInfo serversInfo, BaseHttpServer httpServer, AssetCache assetCache ) :base(serversInfo, httpServer, assetCache)
|
public CommunicationsOGS1(NetworkServersInfo serversInfo, BaseHttpServer httpServer, AssetCache assetCache ) :base(serversInfo, httpServer, assetCache)
|
||||||
{
|
{
|
||||||
OGS1GridServices gridInterComms = new OGS1GridServices(serversInfo, httpServer);
|
OGS1GridServices gridInterComms = new OGS1GridServices(serversInfo, httpServer);
|
||||||
GridServer = gridInterComms;
|
GridServer = gridInterComms;
|
||||||
InterRegion = gridInterComms;
|
InterRegion = gridInterComms;
|
||||||
|
|
||||||
|
InvenService = new OGS1InventoryService();
|
||||||
|
InventoryServer = InvenService;
|
||||||
|
|
||||||
UserServer = new OGS1UserServices(this);
|
UserServer = new OGS1UserServices(this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,28 @@
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using libsecondlife;
|
||||||
|
using OpenSim.Framework.Communications;
|
||||||
|
using OpenSim.Framework.Data;
|
||||||
|
using InventoryFolder = OpenSim.Framework.Communications.Caches.InventoryFolder;
|
||||||
|
|
||||||
|
namespace OpenSim.Region.Communications.OGS1
|
||||||
|
{
|
||||||
|
public class OGS1InventoryService : IInventoryServices
|
||||||
|
{
|
||||||
|
|
||||||
|
public OGS1InventoryService()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public void RequestInventoryForUser(LLUUID userID, InventoryFolderInfo folderCallBack, InventoryItemInfo itemCallBack)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public void AddNewInventoryFolder(LLUUID userID, InventoryFolder folder)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -564,7 +564,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
m_estateManager.sendRegionHandshake(client);
|
m_estateManager.sendRegionHandshake(client);
|
||||||
CreateAndAddScenePresence(client);
|
CreateAndAddScenePresence(client);
|
||||||
m_LandManager.sendParcelOverlay(client);
|
m_LandManager.sendParcelOverlay(client);
|
||||||
//commsManager.UserProfiles.AddNewUser(client.AgentId);
|
commsManager.UserProfiles.AddNewUser(client.AgentId);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected virtual void SubscribeToClientEvents(IClientAPI client)
|
protected virtual void SubscribeToClientEvents(IClientAPI client)
|
||||||
|
@ -609,7 +609,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
client.OnEstateOwnerMessage += new EstateOwnerMessageRequest(m_estateManager.handleEstateOwnerMessage);
|
client.OnEstateOwnerMessage += new EstateOwnerMessageRequest(m_estateManager.handleEstateOwnerMessage);
|
||||||
|
|
||||||
//client.OnCreateNewInventoryItem += CreateNewInventoryItem;
|
//client.OnCreateNewInventoryItem += CreateNewInventoryItem;
|
||||||
//client.OnCreateNewInventoryFolder += commsManager.UserProfiles.HandleCreateInventoryFolder;
|
client.OnCreateNewInventoryFolder += commsManager.UserProfiles.HandleCreateInventoryFolder;
|
||||||
client.OnFetchInventoryDescendents += commsManager.UserProfiles.HandleFecthInventoryDescendents;
|
client.OnFetchInventoryDescendents += commsManager.UserProfiles.HandleFecthInventoryDescendents;
|
||||||
client.OnRequestTaskInventory += RequestTaskInventory;
|
client.OnRequestTaskInventory += RequestTaskInventory;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue