diff options
Diffstat (limited to '')
3 files changed, 11 insertions, 47 deletions
diff --git a/OpenSim/Framework/Communications/Cache/CachedUserInfo.cs b/OpenSim/Framework/Communications/Cache/CachedUserInfo.cs index 9e8c239..99dc45a 100644 --- a/OpenSim/Framework/Communications/Cache/CachedUserInfo.cs +++ b/OpenSim/Framework/Communications/Cache/CachedUserInfo.cs | |||
@@ -38,7 +38,7 @@ using OpenSim.Framework.Utilities; | |||
38 | 38 | ||
39 | namespace OpenSim.Framework.Communications.Caches | 39 | namespace OpenSim.Framework.Communications.Caches |
40 | { | 40 | { |
41 | public class CachedUserInfo : MarshalByRefObject | 41 | public class CachedUserInfo |
42 | { | 42 | { |
43 | private CommunicationsManager m_parentCommsManager; | 43 | private CommunicationsManager m_parentCommsManager; |
44 | // Fields | 44 | // Fields |
@@ -51,7 +51,7 @@ namespace OpenSim.Framework.Communications.Caches | |||
51 | } | 51 | } |
52 | 52 | ||
53 | // Methods | 53 | // Methods |
54 | public void FolderReceive(LLUUID userID, InventoryFolderBase folderInfo) | 54 | public void FolderReceive(LLUUID userID, InventoryFolder folderInfo) |
55 | { | 55 | { |
56 | if (userID == this.UserProfile.UUID) | 56 | if (userID == this.UserProfile.UUID) |
57 | { | 57 | { |
@@ -59,19 +59,19 @@ namespace OpenSim.Framework.Communications.Caches | |||
59 | { | 59 | { |
60 | if (folderInfo.parentID == LLUUID.Zero) | 60 | if (folderInfo.parentID == LLUUID.Zero) |
61 | { | 61 | { |
62 | this.RootFolder = new InventoryFolder(folderInfo); | 62 | this.RootFolder = folderInfo; |
63 | } | 63 | } |
64 | } | 64 | } |
65 | else if (this.RootFolder.folderID == folderInfo.parentID) | 65 | else if (this.RootFolder.folderID == folderInfo.parentID) |
66 | { | 66 | { |
67 | this.RootFolder.SubFolders.Add(folderInfo.folderID, new InventoryFolder(folderInfo)); | 67 | this.RootFolder.SubFolders.Add(folderInfo.folderID, folderInfo); |
68 | } | 68 | } |
69 | else | 69 | else |
70 | { | 70 | { |
71 | InventoryFolder folder = this.RootFolder.HasSubFolder(folderInfo.parentID); | 71 | InventoryFolder folder = this.RootFolder.HasSubFolder(folderInfo.parentID); |
72 | if (folder != null) | 72 | if (folder != null) |
73 | { | 73 | { |
74 | folder.SubFolders.Add(folderInfo.folderID, new InventoryFolder(folderInfo)); | 74 | folder.SubFolders.Add(folderInfo.folderID, folderInfo); |
75 | } | 75 | } |
76 | } | 76 | } |
77 | } | 77 | } |
@@ -131,7 +131,3 @@ namespace OpenSim.Framework.Communications.Caches | |||
131 | 131 | ||
132 | } | 132 | } |
133 | 133 | ||
134 | |||
135 | |||
136 | |||
137 | |||
diff --git a/OpenSim/Framework/Communications/Cache/InventoryFolder.cs b/OpenSim/Framework/Communications/Cache/InventoryFolder.cs index a212614..885cffc 100644 --- a/OpenSim/Framework/Communications/Cache/InventoryFolder.cs +++ b/OpenSim/Framework/Communications/Cache/InventoryFolder.cs | |||
@@ -35,9 +35,6 @@ using OpenSim.Framework.Interfaces; | |||
35 | using OpenSim.Framework.Data; | 35 | using OpenSim.Framework.Data; |
36 | using OpenSim.Framework.Types; | 36 | using OpenSim.Framework.Types; |
37 | using OpenSim.Framework.Utilities; | 37 | using OpenSim.Framework.Utilities; |
38 | using OpenSim.Framework.Console; | ||
39 | |||
40 | using InventoryCategory = OpenSim.Framework.Data.InventoryCategory; | ||
41 | 38 | ||
42 | namespace OpenSim.Framework.Communications.Caches | 39 | namespace OpenSim.Framework.Communications.Caches |
43 | { | 40 | { |
@@ -63,7 +60,7 @@ namespace OpenSim.Framework.Communications.Caches | |||
63 | } | 60 | } |
64 | 61 | ||
65 | // Methods | 62 | // Methods |
66 | public InventoryFolder CreateNewSubFolder(LLUUID folderID, string folderName, ushort type, InventoryCategory category) | 63 | public InventoryFolder CreateNewSubFolder(LLUUID folderID, string folderName, ushort type) |
67 | { | 64 | { |
68 | InventoryFolder subFold = new InventoryFolder(); | 65 | InventoryFolder subFold = new InventoryFolder(); |
69 | subFold.name = folderName; | 66 | subFold.name = folderName; |
@@ -71,12 +68,7 @@ namespace OpenSim.Framework.Communications.Caches | |||
71 | subFold.type = (short) type; | 68 | subFold.type = (short) type; |
72 | subFold.parentID = this.folderID; | 69 | subFold.parentID = this.folderID; |
73 | subFold.agentID = this.agentID; | 70 | subFold.agentID = this.agentID; |
74 | subFold.category = category; | 71 | this.SubFolders.Add(subFold.folderID, subFold); |
75 | if (!SubFolders.ContainsKey(subFold.folderID)) | ||
76 | this.SubFolders.Add(subFold.folderID, subFold); | ||
77 | else | ||
78 | MainLog.Instance.Warn("INVENTORYCACHE", "Attempt to create a duplicate folder {0} {1}", folderName, folderID); | ||
79 | |||
80 | return subFold; | 72 | return subFold; |
81 | } | 73 | } |
82 | 74 | ||
diff --git a/OpenSim/Framework/Communications/Cache/UserProfileCache.cs b/OpenSim/Framework/Communications/Cache/UserProfileCache.cs index 3dadf9c..390b938 100644 --- a/OpenSim/Framework/Communications/Cache/UserProfileCache.cs +++ b/OpenSim/Framework/Communications/Cache/UserProfileCache.cs | |||
@@ -35,11 +35,10 @@ using OpenSim.Framework.Interfaces; | |||
35 | using OpenSim.Framework.Types; | 35 | using OpenSim.Framework.Types; |
36 | using OpenSim.Framework.Utilities; | 36 | using OpenSim.Framework.Utilities; |
37 | using OpenSim.Framework.Data; | 37 | using OpenSim.Framework.Data; |
38 | using InventoryCategory = OpenSim.Framework.Data.InventoryCategory; | ||
39 | 38 | ||
40 | namespace OpenSim.Framework.Communications.Caches | 39 | namespace OpenSim.Framework.Communications.Caches |
41 | { | 40 | { |
42 | public class UserProfileCache : MarshalByRefObject | 41 | public class UserProfileCache |
43 | { | 42 | { |
44 | // Fields | 43 | // Fields |
45 | private CommunicationsManager m_parent; | 44 | private CommunicationsManager m_parent; |
@@ -104,7 +103,7 @@ namespace OpenSim.Framework.Communications.Caches | |||
104 | CachedUserInfo info = this.UserProfiles[remoteClient.AgentId]; | 103 | CachedUserInfo info = this.UserProfiles[remoteClient.AgentId]; |
105 | if (info.RootFolder.folderID == parentID) | 104 | if (info.RootFolder.folderID == parentID) |
106 | { | 105 | { |
107 | InventoryFolder createdFolder = info.RootFolder.CreateNewSubFolder(folderID, folderName, folderType, InventoryCategory.User); | 106 | InventoryFolder createdFolder = info.RootFolder.CreateNewSubFolder(folderID, folderName, folderType); |
108 | if (createdFolder != null) | 107 | if (createdFolder != null) |
109 | { | 108 | { |
110 | this.m_parent.InventoryService.AddNewInventoryFolder(remoteClient.AgentId, createdFolder); | 109 | this.m_parent.InventoryService.AddNewInventoryFolder(remoteClient.AgentId, createdFolder); |
@@ -115,7 +114,7 @@ namespace OpenSim.Framework.Communications.Caches | |||
115 | InventoryFolder folder = info.RootFolder.HasSubFolder(parentID); | 114 | InventoryFolder folder = info.RootFolder.HasSubFolder(parentID); |
116 | if (folder != null) | 115 | if (folder != null) |
117 | { | 116 | { |
118 | folder.CreateNewSubFolder(folderID, folderName, folderType, InventoryCategory.User); | 117 | folder.CreateNewSubFolder(folderID, folderName, folderType); |
119 | } | 118 | } |
120 | } | 119 | } |
121 | } | 120 | } |
@@ -125,21 +124,16 @@ namespace OpenSim.Framework.Communications.Caches | |||
125 | public void HandleFecthInventoryDescendents(IClientAPI remoteClient, LLUUID folderID, LLUUID ownerID, bool fetchFolders, bool fetchItems, int sortOrder) | 124 | public void HandleFecthInventoryDescendents(IClientAPI remoteClient, LLUUID folderID, LLUUID ownerID, bool fetchFolders, bool fetchItems, int sortOrder) |
126 | { | 125 | { |
127 | InventoryFolder fold = null; | 126 | InventoryFolder fold = null; |
128 | |||
129 | if (folderID == libraryRoot.folderID ) | 127 | if (folderID == libraryRoot.folderID ) |
130 | { | 128 | { |
131 | // we are looking for the root of the shared inventory | ||
132 | remoteClient.SendInventoryFolderDetails(libraryRoot.agentID, libraryRoot.folderID, libraryRoot.RequestListOfItems()); | 129 | remoteClient.SendInventoryFolderDetails(libraryRoot.agentID, libraryRoot.folderID, libraryRoot.RequestListOfItems()); |
133 | } | 130 | } |
134 | else if (( fold = libraryRoot.HasSubFolder(folderID)) != null) | 131 | else if (( fold = libraryRoot.HasSubFolder(folderID)) != null) |
135 | { | 132 | { |
136 | // we are looking for a sub folder of the shared inventory | ||
137 | remoteClient.SendInventoryFolderDetails(libraryRoot.agentID, folderID, fold.RequestListOfItems()); | 133 | remoteClient.SendInventoryFolderDetails(libraryRoot.agentID, folderID, fold.RequestListOfItems()); |
138 | } | 134 | } |
139 | else if (this.UserProfiles.ContainsKey(remoteClient.AgentId)) | 135 | else if (this.UserProfiles.ContainsKey(remoteClient.AgentId)) |
140 | { | 136 | { |
141 | //if we get here, we are looking the inventory of an agent in this sim | ||
142 | //now we need to see if we already have the inventory cached | ||
143 | if (this.UserProfiles[remoteClient.AgentId].RootFolder != null) | 137 | if (this.UserProfiles[remoteClient.AgentId].RootFolder != null) |
144 | { | 138 | { |
145 | CachedUserInfo info = this.UserProfiles[remoteClient.AgentId]; | 139 | CachedUserInfo info = this.UserProfiles[remoteClient.AgentId]; |
@@ -159,23 +153,9 @@ namespace OpenSim.Framework.Communications.Caches | |||
159 | } | 153 | } |
160 | } | 154 | } |
161 | } | 155 | } |
162 | else | ||
163 | { | ||
164 | //nope, inventory wasn't cached, so go to the inventory server and ask for the inventory | ||
165 | m_parent.InventoryService.RequestInventoryForUser(remoteClient.AgentId, ReceiveFolderInfo, ReceiveItemInfo); | ||
166 | } | ||
167 | } | 156 | } |
168 | } | 157 | } |
169 | 158 | ||
170 | public void ReceiveFolderInfo(LLUUID userID, InventoryFolderBase folderInfo) | ||
171 | { | ||
172 | } | ||
173 | |||
174 | public void ReceiveItemInfo(LLUUID userID, InventoryItemBase itemInfo) | ||
175 | { | ||
176 | } | ||
177 | |||
178 | |||
179 | public void HandleFetchInventory(IClientAPI remoteClient, LLUUID itemID, LLUUID ownerID) | 159 | public void HandleFetchInventory(IClientAPI remoteClient, LLUUID itemID, LLUUID ownerID) |
180 | { | 160 | { |
181 | if (ownerID == libraryRoot.agentID) | 161 | if (ownerID == libraryRoot.agentID) |
@@ -201,7 +181,7 @@ namespace OpenSim.Framework.Communications.Caches | |||
201 | /// <param name="userID"></param> | 181 | /// <param name="userID"></param> |
202 | private void RequestInventoryForUser(LLUUID userID, CachedUserInfo userInfo) | 182 | private void RequestInventoryForUser(LLUUID userID, CachedUserInfo userInfo) |
203 | { | 183 | { |
204 | this.m_parent.InventoryService.RequestInventoryForUser(userID, userInfo.FolderReceive, userInfo.ItemReceive); | 184 | this.m_parent.InventoryService.RequestInventoryForUser(userID, userInfo.FolderReceive, userInfo.ItemReceive); |
205 | } | 185 | } |
206 | 186 | ||
207 | /// <summary> | 187 | /// <summary> |
@@ -241,7 +221,3 @@ namespace OpenSim.Framework.Communications.Caches | |||
241 | } | 221 | } |
242 | } | 222 | } |
243 | 223 | ||
244 | |||
245 | |||
246 | |||
247 | |||