diff options
7 files changed, 80 insertions, 28 deletions
diff --git a/OpenSim/Framework/Communications/Cache/CachedUserInfo.cs b/OpenSim/Framework/Communications/Cache/CachedUserInfo.cs index d850305..fc2f948 100644 --- a/OpenSim/Framework/Communications/Cache/CachedUserInfo.cs +++ b/OpenSim/Framework/Communications/Cache/CachedUserInfo.cs | |||
@@ -41,8 +41,8 @@ namespace OpenSim.Framework.Communications.Caches | |||
41 | public class CachedUserInfo | 41 | public class CachedUserInfo |
42 | { | 42 | { |
43 | // Fields | 43 | // Fields |
44 | public InventoryFolder RootFolder; | 44 | public InventoryFolder RootFolder = null; |
45 | public UserProfileData UserProfile; | 45 | public UserProfileData UserProfile = null; |
46 | 46 | ||
47 | // Methods | 47 | // Methods |
48 | public void FolderReceive(LLUUID userID, InventoryFolder folderInfo) | 48 | public void FolderReceive(LLUUID userID, InventoryFolder folderInfo) |
diff --git a/OpenSim/Framework/Communications/Cache/UserProfileCache.cs b/OpenSim/Framework/Communications/Cache/UserProfileCache.cs index 2271550..e65b6b2 100644 --- a/OpenSim/Framework/Communications/Cache/UserProfileCache.cs +++ b/OpenSim/Framework/Communications/Cache/UserProfileCache.cs | |||
@@ -98,17 +98,24 @@ namespace OpenSim.Framework.Communications.Caches | |||
98 | { | 98 | { |
99 | if (this.UserProfiles.ContainsKey(remoteClient.AgentId)) | 99 | if (this.UserProfiles.ContainsKey(remoteClient.AgentId)) |
100 | { | 100 | { |
101 | CachedUserInfo info = this.UserProfiles[remoteClient.AgentId]; | 101 | if (this.UserProfiles[remoteClient.AgentId].RootFolder != null) |
102 | if (info.RootFolder.folderID == parentID) | ||
103 | { | 102 | { |
104 | info.RootFolder.CreateNewSubFolder(folderID, folderName, folderType); | 103 | CachedUserInfo info = this.UserProfiles[remoteClient.AgentId]; |
105 | } | 104 | if (info.RootFolder.folderID == parentID) |
106 | else | 105 | { |
107 | { | 106 | InventoryFolder createdFolder = info.RootFolder.CreateNewSubFolder(folderID, folderName, folderType); |
108 | InventoryFolder folder = info.RootFolder.HasSubFolder(parentID); | 107 | if (createdFolder != null) |
109 | if (folder != null) | 108 | { |
109 | this.m_parent.InventoryServer.AddNewInventoryFolder(remoteClient.AgentId, createdFolder); | ||
110 | } | ||
111 | } | ||
112 | else | ||
110 | { | 113 | { |
111 | folder.CreateNewSubFolder(folderID, folderName, folderType); | 114 | InventoryFolder folder = info.RootFolder.HasSubFolder(parentID); |
115 | if (folder != null) | ||
116 | { | ||
117 | folder.CreateNewSubFolder(folderID, folderName, folderType); | ||
118 | } | ||
112 | } | 119 | } |
113 | } | 120 | } |
114 | } | 121 | } |
@@ -127,20 +134,23 @@ namespace OpenSim.Framework.Communications.Caches | |||
127 | } | 134 | } |
128 | else if (this.UserProfiles.ContainsKey(remoteClient.AgentId)) | 135 | else if (this.UserProfiles.ContainsKey(remoteClient.AgentId)) |
129 | { | 136 | { |
130 | CachedUserInfo info = this.UserProfiles[remoteClient.AgentId]; | 137 | if (this.UserProfiles[remoteClient.AgentId].RootFolder != null) |
131 | if (info.RootFolder.folderID == folderID) | ||
132 | { | 138 | { |
133 | if (fetchItems) | 139 | CachedUserInfo info = this.UserProfiles[remoteClient.AgentId]; |
140 | if (info.RootFolder.folderID == folderID) | ||
134 | { | 141 | { |
135 | remoteClient.SendInventoryFolderDetails(remoteClient.AgentId, folderID, info.RootFolder.RequestListOfItems()); | 142 | if (fetchItems) |
143 | { | ||
144 | remoteClient.SendInventoryFolderDetails(remoteClient.AgentId, folderID, info.RootFolder.RequestListOfItems()); | ||
145 | } | ||
136 | } | 146 | } |
137 | } | 147 | else |
138 | else | ||
139 | { | ||
140 | InventoryFolder folder = info.RootFolder.HasSubFolder(folderID); | ||
141 | if ((folder != null) && fetchItems) | ||
142 | { | 148 | { |
143 | remoteClient.SendInventoryFolderDetails(remoteClient.AgentId, folderID, folder.RequestListOfItems()); | 149 | InventoryFolder folder = info.RootFolder.HasSubFolder(folderID); |
150 | if ((folder != null) && fetchItems) | ||
151 | { | ||
152 | remoteClient.SendInventoryFolderDetails(remoteClient.AgentId, folderID, folder.RequestListOfItems()); | ||
153 | } | ||
144 | } | 154 | } |
145 | } | 155 | } |
146 | } | 156 | } |
@@ -154,10 +164,13 @@ namespace OpenSim.Framework.Communications.Caches | |||
154 | } | 164 | } |
155 | else if (this.UserProfiles.ContainsKey(remoteClient.AgentId)) | 165 | else if (this.UserProfiles.ContainsKey(remoteClient.AgentId)) |
156 | { | 166 | { |
157 | InventoryItemBase item = this.UserProfiles[remoteClient.AgentId].RootFolder.HasItem(itemID); | 167 | if (this.UserProfiles[remoteClient.AgentId].RootFolder != null) |
158 | if (item != null) | ||
159 | { | 168 | { |
160 | remoteClient.SendInventoryItemDetails(ownerID, item); | 169 | InventoryItemBase item = this.UserProfiles[remoteClient.AgentId].RootFolder.HasItem(itemID); |
170 | if (item != null) | ||
171 | { | ||
172 | remoteClient.SendInventoryItemDetails(ownerID, item); | ||
173 | } | ||
161 | } | 174 | } |
162 | } | 175 | } |
163 | } | 176 | } |
@@ -168,7 +181,7 @@ namespace OpenSim.Framework.Communications.Caches | |||
168 | /// <param name="userID"></param> | 181 | /// <param name="userID"></param> |
169 | private void RequestInventoryForUser(LLUUID userID, CachedUserInfo userInfo) | 182 | private void RequestInventoryForUser(LLUUID userID, CachedUserInfo userInfo) |
170 | { | 183 | { |
171 | //this.m_parent.InventoryServer.RequestInventoryForUser(userID, userInfo.FolderReceive, userInfo.ItemReceive); | 184 | this.m_parent.InventoryServer.RequestInventoryForUser(userID, userInfo.FolderReceive, userInfo.ItemReceive); |
172 | 185 | ||
173 | //for now we manually create the root folder, | 186 | //for now we manually create the root folder, |
174 | // but should be requesting all inventory from inventory server. | 187 | // but should be requesting all inventory from inventory server. |
diff --git a/OpenSim/Framework/Communications/IInventoryServices.cs b/OpenSim/Framework/Communications/IInventoryServices.cs index b78cba1..777dbe2 100644 --- a/OpenSim/Framework/Communications/IInventoryServices.cs +++ b/OpenSim/Framework/Communications/IInventoryServices.cs | |||
@@ -14,5 +14,6 @@ namespace OpenSim.Framework.Communications | |||
14 | public interface IInventoryServices | 14 | public interface IInventoryServices |
15 | { | 15 | { |
16 | void RequestInventoryForUser(LLUUID userID, InventoryFolderInfo folderCallBack, InventoryItemInfo itemCallBack); | 16 | void RequestInventoryForUser(LLUUID userID, InventoryFolderInfo folderCallBack, InventoryItemInfo itemCallBack); |
17 | void AddNewInventoryFolder(LLUUID userID, InventoryFolder folder); | ||
17 | } | 18 | } |
18 | } | 19 | } |
diff --git a/OpenSim/Region/Communications/Local/LocalInventoryService.cs b/OpenSim/Region/Communications/Local/LocalInventoryService.cs index 35c2c8c..6ba024a 100644 --- a/OpenSim/Region/Communications/Local/LocalInventoryService.cs +++ b/OpenSim/Region/Communications/Local/LocalInventoryService.cs | |||
@@ -47,5 +47,10 @@ namespace OpenSim.Region.Communications.Local | |||
47 | } | 47 | } |
48 | } | 48 | } |
49 | } | 49 | } |
50 | |||
51 | public void AddNewInventoryFolder(LLUUID userID, InventoryFolder folder) | ||
52 | { | ||
53 | this.AddFolder(folder); | ||
54 | } | ||
50 | } | 55 | } |
51 | } | 56 | } |
diff --git a/OpenSim/Region/Communications/OGS1/CommunicationsOGS1.cs b/OpenSim/Region/Communications/OGS1/CommunicationsOGS1.cs index 47d3148..af239f7 100644 --- a/OpenSim/Region/Communications/OGS1/CommunicationsOGS1.cs +++ b/OpenSim/Region/Communications/OGS1/CommunicationsOGS1.cs | |||
@@ -8,12 +8,17 @@ namespace OpenSim.Region.Communications.OGS1 | |||
8 | { | 8 | { |
9 | public class CommunicationsOGS1 : CommunicationsManager | 9 | public class CommunicationsOGS1 : CommunicationsManager |
10 | { | 10 | { |
11 | 11 | public OGS1InventoryService InvenService; | |
12 | |||
12 | public CommunicationsOGS1(NetworkServersInfo serversInfo, BaseHttpServer httpServer, AssetCache assetCache ) :base(serversInfo, httpServer, assetCache) | 13 | public CommunicationsOGS1(NetworkServersInfo serversInfo, BaseHttpServer httpServer, AssetCache assetCache ) :base(serversInfo, httpServer, assetCache) |
13 | { | 14 | { |
14 | OGS1GridServices gridInterComms = new OGS1GridServices(serversInfo, httpServer); | 15 | OGS1GridServices gridInterComms = new OGS1GridServices(serversInfo, httpServer); |
15 | GridServer = gridInterComms; | 16 | GridServer = gridInterComms; |
16 | InterRegion = gridInterComms; | 17 | InterRegion = gridInterComms; |
18 | |||
19 | InvenService = new OGS1InventoryService(); | ||
20 | InventoryServer = InvenService; | ||
21 | |||
17 | UserServer = new OGS1UserServices(this); | 22 | UserServer = new OGS1UserServices(this); |
18 | } | 23 | } |
19 | } | 24 | } |
diff --git a/OpenSim/Region/Communications/OGS1/OGS1InventoryService.cs b/OpenSim/Region/Communications/OGS1/OGS1InventoryService.cs new file mode 100644 index 0000000..e8355c6 --- /dev/null +++ b/OpenSim/Region/Communications/OGS1/OGS1InventoryService.cs | |||
@@ -0,0 +1,28 @@ | |||
1 | using System; | ||
2 | using System.Collections.Generic; | ||
3 | using libsecondlife; | ||
4 | using OpenSim.Framework.Communications; | ||
5 | using OpenSim.Framework.Data; | ||
6 | using InventoryFolder = OpenSim.Framework.Communications.Caches.InventoryFolder; | ||
7 | |||
8 | namespace OpenSim.Region.Communications.OGS1 | ||
9 | { | ||
10 | public class OGS1InventoryService : IInventoryServices | ||
11 | { | ||
12 | |||
13 | public OGS1InventoryService() | ||
14 | { | ||
15 | |||
16 | } | ||
17 | |||
18 | public void RequestInventoryForUser(LLUUID userID, InventoryFolderInfo folderCallBack, InventoryItemInfo itemCallBack) | ||
19 | { | ||
20 | |||
21 | } | ||
22 | |||
23 | public void AddNewInventoryFolder(LLUUID userID, InventoryFolder folder) | ||
24 | { | ||
25 | |||
26 | } | ||
27 | } | ||
28 | } | ||
diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs index f24def2..5123048 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.cs | |||
@@ -564,7 +564,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
564 | m_estateManager.sendRegionHandshake(client); | 564 | m_estateManager.sendRegionHandshake(client); |
565 | CreateAndAddScenePresence(client); | 565 | CreateAndAddScenePresence(client); |
566 | m_LandManager.sendParcelOverlay(client); | 566 | m_LandManager.sendParcelOverlay(client); |
567 | //commsManager.UserProfiles.AddNewUser(client.AgentId); | 567 | commsManager.UserProfiles.AddNewUser(client.AgentId); |
568 | } | 568 | } |
569 | 569 | ||
570 | protected virtual void SubscribeToClientEvents(IClientAPI client) | 570 | protected virtual void SubscribeToClientEvents(IClientAPI client) |
@@ -609,7 +609,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
609 | client.OnEstateOwnerMessage += new EstateOwnerMessageRequest(m_estateManager.handleEstateOwnerMessage); | 609 | client.OnEstateOwnerMessage += new EstateOwnerMessageRequest(m_estateManager.handleEstateOwnerMessage); |
610 | 610 | ||
611 | //client.OnCreateNewInventoryItem += CreateNewInventoryItem; | 611 | //client.OnCreateNewInventoryItem += CreateNewInventoryItem; |
612 | //client.OnCreateNewInventoryFolder += commsManager.UserProfiles.HandleCreateInventoryFolder; | 612 | client.OnCreateNewInventoryFolder += commsManager.UserProfiles.HandleCreateInventoryFolder; |
613 | client.OnFetchInventoryDescendents += commsManager.UserProfiles.HandleFecthInventoryDescendents; | 613 | client.OnFetchInventoryDescendents += commsManager.UserProfiles.HandleFecthInventoryDescendents; |
614 | client.OnRequestTaskInventory += RequestTaskInventory; | 614 | client.OnRequestTaskInventory += RequestTaskInventory; |
615 | 615 | ||