aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Framework')
-rw-r--r--OpenSim/Framework/Communications/Cache/CachedUserInfo.cs4
-rw-r--r--OpenSim/Framework/Communications/Cache/UserProfileCache.cs59
-rw-r--r--OpenSim/Framework/Communications/IInventoryServices.cs1
3 files changed, 39 insertions, 25 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}