aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
authorMW2008-02-13 14:45:13 +0000
committerMW2008-02-13 14:45:13 +0000
commit49a5a00b8083ab5c2bdaa6a4c2528cc6e0989641 (patch)
treeac5c1949a294220c9e1949fd51e35f50d5cc220e /OpenSim
parent* Copied 'Friends' functionality from the MySQLUserData to MSSQLUserData (diff)
downloadopensim-SC_OLD-49a5a00b8083ab5c2bdaa6a4c2528cc6e0989641.zip
opensim-SC_OLD-49a5a00b8083ab5c2bdaa6a4c2528cc6e0989641.tar.gz
opensim-SC_OLD-49a5a00b8083ab5c2bdaa6a4c2528cc6e0989641.tar.bz2
opensim-SC_OLD-49a5a00b8083ab5c2bdaa6a4c2528cc6e0989641.tar.xz
Added a method to access a named folder in a users inventory, to the inventory Database interfaces. This could be useful for adding a item to a users inventory from say a web front end application or some other third party application. [note the method is only currently implemented in the sqlite provider]
Diffstat (limited to 'OpenSim')
-rw-r--r--OpenSim/Framework/Communications/IInventoryServices.cs8
-rw-r--r--OpenSim/Framework/Communications/InventoryServiceBase.cs6
-rw-r--r--OpenSim/Region/Communications/Local/LocalInventoryService.cs17
-rw-r--r--OpenSim/Region/Communications/OGS1/OGS1InventoryService.cs5
4 files changed, 36 insertions, 0 deletions
diff --git a/OpenSim/Framework/Communications/IInventoryServices.cs b/OpenSim/Framework/Communications/IInventoryServices.cs
index ddb19ba..0e09613 100644
--- a/OpenSim/Framework/Communications/IInventoryServices.cs
+++ b/OpenSim/Framework/Communications/IInventoryServices.cs
@@ -88,5 +88,13 @@ namespace OpenSim.Framework.Communications
88 /// <param name="userID"></param> 88 /// <param name="userID"></param>
89 /// <returns></returns> 89 /// <returns></returns>
90 List<InventoryFolderBase> RequestFirstLevelFolders(LLUUID userID); 90 List<InventoryFolderBase> RequestFirstLevelFolders(LLUUID userID);
91
92 /// <summary>
93 /// Returns the named folder in that users inventory, returns null if folder is not found.
94 /// </summary>
95 /// <param name="userID"></param>
96 /// <param name="folderName"></param>
97 /// <returns></returns>
98 InventoryFolderBase RequestNamedFolder(LLUUID userID, string folderName);
91 } 99 }
92} \ No newline at end of file 100} \ No newline at end of file
diff --git a/OpenSim/Framework/Communications/InventoryServiceBase.cs b/OpenSim/Framework/Communications/InventoryServiceBase.cs
index 74c07e1..c8748fa 100644
--- a/OpenSim/Framework/Communications/InventoryServiceBase.cs
+++ b/OpenSim/Framework/Communications/InventoryServiceBase.cs
@@ -141,6 +141,12 @@ namespace OpenSim.Framework.Communications
141 } 141 }
142 142
143 // See IInventoryServices 143 // See IInventoryServices
144 public virtual InventoryFolderBase RequestNamedFolder(LLUUID userID, string folderName)
145 {
146 return null;
147 }
148
149 // See IInventoryServices
144 public void CreateNewUserInventory(LLUUID user) 150 public void CreateNewUserInventory(LLUUID user)
145 { 151 {
146 InventoryFolderBase existingRootFolder = RequestUsersRoot(user); 152 InventoryFolderBase existingRootFolder = RequestUsersRoot(user);
diff --git a/OpenSim/Region/Communications/Local/LocalInventoryService.cs b/OpenSim/Region/Communications/Local/LocalInventoryService.cs
index 35eb89a..77a2a6e 100644
--- a/OpenSim/Region/Communications/Local/LocalInventoryService.cs
+++ b/OpenSim/Region/Communications/Local/LocalInventoryService.cs
@@ -100,6 +100,23 @@ namespace OpenSim.Region.Communications.Local
100 } 100 }
101 } 101 }
102 102
103 public override InventoryFolderBase RequestNamedFolder(LLUUID userID, string folderName)
104 {
105 List<InventoryFolderBase> folders = RequestFirstLevelFolders(userID);
106 InventoryFolderBase requestedFolder = null;
107
108 //need to make sure we send root folder first
109 foreach (InventoryFolderBase folder in folders)
110 {
111 if (folder.name == folderName)
112 {
113 requestedFolder = folder;
114 break;
115 }
116 }
117
118 return requestedFolder;
119 }
103 120
104 /// <summary> 121 /// <summary>
105 /// Send the given inventory folder and its item contents back to the requester. 122 /// Send the given inventory folder and its item contents back to the requester.
diff --git a/OpenSim/Region/Communications/OGS1/OGS1InventoryService.cs b/OpenSim/Region/Communications/OGS1/OGS1InventoryService.cs
index 81689ed..8ff62d0 100644
--- a/OpenSim/Region/Communications/OGS1/OGS1InventoryService.cs
+++ b/OpenSim/Region/Communications/OGS1/OGS1InventoryService.cs
@@ -175,6 +175,11 @@ namespace OpenSim.Region.Communications.OGS1
175 return null; 175 return null;
176 } 176 }
177 177
178 public virtual InventoryFolderBase RequestNamedFolder(LLUUID userID, string folderName)
179 {
180 return null;
181 }
182
178 public void CreateNewUserInventory(LLUUID user) 183 public void CreateNewUserInventory(LLUUID user)
179 { 184 {
180 } 185 }